Skip to content

Add dipole electrostatic potential and field functions#4

Open
rahulbalaji13 wants to merge 1 commit intotheochem:mainfrom
rahulbalaji13:feature/dipole-electrostatics
Open

Add dipole electrostatic potential and field functions#4
rahulbalaji13 wants to merge 1 commit intotheochem:mainfrom
rahulbalaji13:feature/dipole-electrostatics

Conversation

@rahulbalaji13
Copy link

Implements dipole_potential() and dipole_field() following the same vectorized NumPy pattern as the monopole functions. Includes proper handling of edge cases (r->0) and comprehensive docstrings with physics formulas.

Builds on PR #2 to extend electrostatics module toward full multipole support.

Context

This PR addresses issue #1 (GSoC 2026: Electrostatics beyond the atomic charges) by implementing the dipole contribution to the multipole electrostatics module.

Implementation Details

  • dipole_potential(p, r_vec): Computes V = (p · r̂) / r² in atomic units
  • dipole_field(p, r_vec): Computes E = (1/r³)[3(p·r̂)r̂ - p] in atomic units
  • Follows the same vectorized NumPy pattern as monopole functions (PR Add monopole electrostatic potential and field with unit tests #2)
  • Handles edge cases: r → 0 returns 0.0/zeros safely
  • Supports both single positions and arrays
  • Comprehensive docstrings with physics formulas

Next Steps

After this PR is reviewed, I plan to:

  1. Implement quadrupole functions
  2. Create unified multipole interface
  3. Add comprehensive unit tests for dipole functions
  4. Build analysis utilities (field projection, comparison metrics)

Related

Implements dipole_potential() and dipole_field() following the same vectorized NumPy pattern as the monopole functions. Includes proper handling of edge cases (r->0) and comprehensive docstrings with physics formulas.

Builds on PR theochem#2 to extend electrostatics module toward full multipole support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant