fix: [Phase 3] Implement Intrinsic Bond Order (IBO)#6
Conversation
Fixes #3 This commit implements intrinsic bond order (IBO) calculation with bond polarity correction as specified in Issue #3. Key features: - Calculate intrinsic bond strength using Wiberg bond orders - Implement bond polarity correction based on electronegativity differences - Generate bond order matrix for all atom pairs - Compare with Wiberg bond orders for analysis Implementation details: - Created pymultiwfn/bonding/intrinsic.py with core IBO algorithms - Added get_intrinsic_bond_order() and get_intrinsic_bond_order_matrix() methods to the Bonding class - Implemented electronegativity-based polarity correction - Added comprehensive test suite with 19 tests The IBO is calculated as: IBO_ij = W_ij * (1 - polarity_correction) where polarity_correction accounts for ionic character based on electronegativity differences and charge transfer.
|
🤖 Hi @newtontech, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
🤖 I'm sorry @newtontech, but I was unable to process your request. Please see the logs for more details. |
Kimi CLI ReviewGenerated with PR Review: Implement Intrinsic Bond Order (IBO)总体评估PR 实现了 Issue #3 要求的 IBO(Intrinsic Bond Order)计算功能,包含核心算法、Bonding 类集成和测试套件。代码结构清晰,API 设计合理,但存在若干需要关注的安全性和正确性问题。 🔴 严重问题 (Blocking)1.
|
Summary
This PR implements intrinsic bond order (IBO) calculation with bond polarity correction as specified in Issue #3. The IBO provides a measure of the intrinsic covalent character of chemical bonds by accounting for ionic character through electronegativity-based polarity corrections.
Changes
New file:
pymultiwfn/bonding/intrinsic.py- Core IBO implementationIntrinsicBondResultdataclass for structured resultsUpdated file:
pymultiwfn/bonding/bonding.py- Bonding class integrationget_intrinsic_bond_order()method for single bond pairget_intrinsic_bond_order_matrix()method for all bondsNew file:
tests/bonding/test_intrinsic_bond.py- Comprehensive test suiteImplementation Details
The intrinsic bond order is calculated using the formula:
where:
W_ijis the Wiberg bond orderpolarity_correctionaccounts for ionic character based on:Key Features:
Testing
All tests pass successfully:
Manual testing with mock data confirms:
API Usage
Fixes
Fixes #3