Conversation
…ent in shielding module
…ponent calculation
…in Gaussian calculations
… based on distance and alpha values
…uivalent_gaussian_exponent, and gaussian_coulomb_integral functions
19 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the mathematical foundation for the Charge Equilibration (QEq) method by introducing shielded Coulomb integral calculations. The implementation uses Gaussian approximations of Slater-type orbitals to compute atomic interactions, which form the off-diagonal elements of the QEq matrix.
Key Changes:
- Implements
gaussian_coulomb_integralfunction with supporting mathematical primitives (Slater exponents, Gaussian approximations, screened potentials) - Creates new
mathmodule structure withconstantsandshieldingsubmodules - Adds comprehensive test coverage validating against known reference values and physical properties
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/math/shielding.rs |
Core implementation of shielded Coulomb integral calculation with Slater-to-Gaussian conversion and comprehensive test suite |
src/math/mod.rs |
Module declaration for new math package |
src/math/constants.rs |
Physical constants (Bohr-to-Angstrom, Hartree-to-eV conversions, distance threshold) |
src/lib.rs |
Exposes new math module in library public API |
resources/qeq.data.toml |
Updated documentation comments to clarify QEq framework context |
Cargo.toml |
Added libm dependency for erf function and approx for floating-point test assertions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Introduces the core mathematical engine for the
cheqlibrary by implementing the shielded Coulomb integral (J_AB) calculation, a cornerstone of the Charge Equilibration (QEq) method. This involves creating a newmathmodule that includes physical constants and ashieldingsubmodule. The implementation accurately models the interaction between Slater-type orbitals (STOs) using a robust Gaussian approximation, which is essential for calculating the off-diagonal elements of the QEq matrix.Changes:
Implemented Shielded Coulomb Integral (
gaussian_coulomb_integral):gaussian_coulomb_integralfunction that calculates the interaction energy between two atoms based on their distance, principal quantum number, and covalent radius.slater_exponentto determine the orbital exponent (zeta).equivalent_gaussian_exponentusing fitted coefficients (c_n) to approximate STOs with Gaussian functions.screened_potentialusing the error function (erf) to compute the final integral, correctly handling theR -> 0limit to avoid singularities.Established Math Module (
math):mathmodule to house all mathematical and physical logic.constantssubmodule to define key physical constants (BOHR_TO_ANGSTROM,HARTREE_TO_EV).shieldingsubmodule to contain the integral logic.Added Comprehensive Unit and Integration Tests:
shieldingmodule.J_AB -> 1/R), symmetry (J_AB = J_BA), and behavior at zero distance.Added Dependencies:
libmcrate for access to a high-qualityerfimplementation.approxto the dev-dependencies for robust floating-point comparisons in tests.