Skip to content

Emieeel/fragpt2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FragPT2

Fragment-embedding CASCI/PT2 library built on PySCF. FragPT2 assumes a partition of a molecular active space into two fragments and computes an embedding energy with optional second-order perturbative corrections: dispersion, single charge transfer (1CT), double charge transfer (2CT), and triplet–triplet (TT) terms.

Based on the paper: J. Chem. Theory Comput. (2025) (DOI: 10.1021/acs.jctc.4c01221)

Install

Requirements

  • Python >= 3.8
  • numpy, scipy, pyscf (declared in pyproject.toml)

Editable install from repo root:

python -m pip install -e .

Quickstart

Run the included water–ammonia example from the repository root:

python examples/water_ammonia/water_ammonia_calculation.py
  • fragci.FragCI: sets up active fragments, extracts active-space integrals, and runs the self-consistent CASCI loop. Pluggable fcisolver defaults to PySCF FCI.
  • fragpt2.FragPT2: inherits from FragCI and adds PT2 drivers for dispersion (run_disp), charge-transfer (run_1ct, run_2ct), and TT (run_tt).
  • utils.pyscf_util.unpack_pyscf: loads MO energies and coefficients from a simple text format used by the examples.

Conventions you should know

  • All MO indices in the code are 0-based. Examples convert human-friendly 1-based inputs via np.array(idx) - 1.
  • The integrals tuple is (c1, c2) with chemists' two-electron convention; the active-space projection returns (c0, c1, c2) where c0 is the core energy contribution.
  • Fragment-local indices l1_idx, l2_idx enumerate positions within the active space; act_idx_l1/act_idx_l2 are the corresponding global MO indices.

Performance notes

  • 4-RDMs and especially 5-RDMs are expensive. FragPT2 caches intermediates on the instance (self.rdms, self.rdms5, ct_rdms, etc.). Reuse the same object to avoid recomputation.

About

Fragment embedding using localized orbitals and (partially contracted) perturbation theory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published