py-electrostatic: Long-range Electrostatics for Polar Materials

py-electrostatic is a Python package for computing long-range electrostatic interactions in polar materials using Born effective charges and dielectric tensors. It integrates seamlessly with ASE (Atomic Simulation Environment) and can be combined with other calculators for machine learning potentials, DFT, and more.

Key Features

  • Born Effective Charges: Uses proper Born effective charge tensors for accurate polar interactions

  • Ewald Summation: Efficient k-space summation with automatic convergence handling

  • NUFFT Acceleration: Optional Non-Uniform FFT for O(N²) scaling (vs O(N³) standard)

  • ASE Integration: Full compatibility with ASE calculators for MD, optimization, and more

  • SSCHA Integration: Works with the Stochastic Self-Consistent Harmonic Approximation code

  • Julia Acceleration: High-performance Julia backend for stress tensors and fast evaluation

Quick Start

import pyelectrostatic.calculator as calc
import cellconstructor as CC

# Load structure with effective charges
dyn = CC.Phonons.Phonons("BaTiO3_")

# Initialize calculator
calculator = calc.ElectrostaticCalculator()
calculator.eta = 0.5
calculator.cutoff = 5.0
calculator.init_from_phonons(dyn)

# Compute energy and forces
atm = dyn.structure.get_ase_atoms()
atm.calc = calculator
energy = atm.get_total_energy()
forces = atm.get_forces()

Documentation Contents

Citation

If you use py-electrostatic in your research, please cite:

  1. Monacelli and N. Marzari, Electrostatic interactions in atomistic and machine-learned potentials for polar materials, Phys. Rev. B 113, 094101 (2026).

See the Citations page for full citation information and BibTeX.

Indices and tables