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)
Requirements
- Python >= 3.8
- numpy, scipy, pyscf (declared in
pyproject.toml)
Editable install from repo root:
python -m pip install -e .Run the included water–ammonia example from the repository root:
python examples/water_ammonia/water_ammonia_calculation.pyfragci.FragCI: sets up active fragments, extracts active-space integrals, and runs the self-consistent CASCI loop. Pluggablefcisolverdefaults to PySCF FCI.fragpt2.FragPT2: inherits fromFragCIand 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.
- 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)wherec0is the core energy contribution. - Fragment-local indices
l1_idx,l2_idxenumerate positions within the active space;act_idx_l1/act_idx_l2are the corresponding global MO indices.
- 4-RDMs and especially 5-RDMs are expensive.
FragPT2caches intermediates on the instance (self.rdms,self.rdms5,ct_rdms, etc.). Reuse the same object to avoid recomputation.