_images/logo-white.svg

PyEF: Electric Field Analysis for Molecular Systems

PyEF computes electric fields, electrostatic potentials, and partial charges from quantum mechanical calculations.

Overview

PyEF processes molden files from QM calculations to compute:

  • Electric Fields: At specific bonds or molecular sites

  • Electrostatic Potentials (ESP): At metal centers or points of interest

  • Partial Charges: Via multiple partitioning schemes (Hirshfeld, CHELPG, Mulliken, etc.)

The package provides both a command-line interface for batch processing and a Python API for interactive analysis.

Main Functions

All functions are methods of the Electrostatics class. Click the links for full documentation.

Function

Description

Documentation

getEfield()

Calculate electric fields at specific bonds

Guide · API

getESP()

Calculate electrostatic potential at atomic sites

Guide · API

getCharges()

Compute partial charges for all atoms

Guide · API

getElectrostatic_stabilization()

Calculate electrostatic stabilization energy

Guide · API

Quick Start

Installation

git clone git@github.com:hjkgrp/pyEF.git
cd pyEF
conda env create -f environment.yml
conda activate pyef
pip install -e .

Python API Example

from pyef.analysis import Electrostatics

# Initialize
es = Electrostatics(['optim.molden'], ['optim.xyz'])

# Calculate electric field at a bond
df = es.getEfield('Hirshfeld_I', 'output', '/path/to/multiwfn',
                  input_bond_indices=[(25, 26)])

# For ESP, initialize with esp_atom_idx
es_esp = Electrostatics(['optim.molden'], ['optim.xyz'], esp_atom_idx=[30])
esp_df = es_esp.getESP('Hirshfeld_I', 'esp_output', '/path/to/multiwfn')

Documentation

Citation

@software{pyef,
  title = {PyEF: Electric Field Analysis for Molecular Systems},
  author = {Manetsch, Melissa and Kastner, David W.},
  year = {2025},
  url = {https://github.com/hjkgrp/pyEF}
}

License

PyEF is released under the MIT License.

Authors: Melissa Manetsch and David W. Kastner