When calculating partial charges for an ion, their sum should retain the ion’s total charge. chematic v1.1.3 adds an EEM implementation with that constraint: the atomic charges sum to −1 for OH⁻ and +1 for NH₄⁺.
Running RDKit 2026.09.1’s CalcEEMcharges on the same atomic coordinates reverses the sign of the total in these two examples. This behavior is reported in RDKit issue #9688. We compared the published chematic v1.1.3 npm package with the published RDKit 2026.09.1 Python package.
Compare total charges at the same coordinates
For OH⁻, O and H are separated by 0.97 Å. NH₄⁺ uses a tetrahedral arrangement around N with 1.01 Å N–H bonds. Both libraries receive the same atom order and coordinates.
ion formal charge chematic 1.1.3 RDKit 2026.09.1
OH- -1 -1.000000 1.000000
NH4+ 1 1.000000 -1.000000
The calculated columns are sums over all atomic EEM charges. Charges are expressed in elementary-charge units: a total of −1 represents one net negative charge. The comparison data also contains the coordinates and individual atomic values.
Solve with total charge as a constraint
The electronegativity equalization method, EEM, calculates partial charges from element parameters and interatomic distances. chematic uses parameters from the published NEEMP model.
In v1.1.3, the linear system includes sum(q_i) = Q, where q_i is an atomic partial charge and Q is the sum of formal charges in the molecule. An explicit mapping of matrix rows and columns lets the solver determine the atomic charges and satisfy the total-charge constraint together. The returned values retain the requested ionic charge.
The Rust implementation and Python regression tests check that the OH⁻ and NH₄⁺ sums equal their formal charges.
Run the published npm package
With Node.js installed, save v113-eem.mjs in an empty working directory and run:
npm init -y
npm install --save-exact @kent-tokyo/chematic@1.1.3
node v113-eem.mjs
[OH-] -1.000000
[NH4+] 1.000000
The script creates molecules with explicit hydrogens and passes coordinates in Å in atom order. The calculation API is eem_charges_json(mol, coordsJson). Its charges array follows the same atom order, so each value can be attached to an atom index in a table or structure drawing.
For OH⁻, the individual values are approximately −1.063214 for O and +0.063214 for H. Partial charges are real-valued assignments made by the model; these two values sum to −1. They can feed atom coloring or charge-based molecular features while retaining the ion’s total charge.
The comparison ran on macOS arm64 on October 13, 2026. We provide the RDKit reproduction script and an execution record containing package details, the environment, and file hashes.