Registry / ai-ml / openfermionpyscf

openfermionpyscf

JSON →
library0.5pypypi✓ verified 90d ago

A plugin that interfaces OpenFermion with PySCF, enabling the construction of fermionic Hamiltonians from molecular orbital integrals computed by PySCF. Current version 0.5. Low release cadence; no updates since 2021.

pip install openfermionpyscf
INSTALL
IMPORT
SIG · OPENFERMIONPYSCF
O
openfermionpyscf
ai-mlpythonv0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

run_pyscf
✓ from openfermionpyscf import run_pyscf
✗ from openfermionpyscf.plugin import run_pyscf
run_pyscf is a top-level function; submodule import is incorrect.

Compute H2 Hamiltonian using OpenFermion and PySCF.

from openfermion import MolecularData from openfermionpyscf import run_pyscf # Set up molecule mol = MolecularData( geometry=[('H', (0., 0., 0.)), ('H', (0., 0., 0.7414))], basis='sto-3g', multiplicity=1, charge=0 ) mol = run_pyscf(mol) print(mol.get_hamiltonian())
Debug
Known issues
gotcharun_pyscf modifies the MolecularData object in-place and returns it. Do not use the returned value as a separate instance; it is the same object.
fix
Use the returned object or simply use the original variable; they are identical.
affects: <=0.5
deprecatedThe function run_pyscf uses a deprecated interface for PySCF 2.x. Future versions of PySCF may break compatibility.
fix
Pin PySCF to a compatible version (e.g., <2.1) or contribute an update to the plugin.
affects: 0.5
gotchaIf pyscf is not installed separately, importing openfermionpyscf will fail with no clear error. The package does not list pyscf as a dependency.
fix
Install pyscf explicitly: pip install pyscf
affects: <=0.5
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyscf'
openfermionpyscf does not install pyscf automatically.
fix
pip install pyscf
AttributeError: module 'openfermionpyscf' has no attribute 'run_pyscf'
Using an outdated version of the package or incorrect import path.
fix
Ensure openfermionpyscf is version 0.5 or later. Import as 'from openfermionpyscf import run_pyscf'.
KeyError: 'mo_occ'
PySCF version mismatch; the plugin expects a specific format from PySCF's output.
fix
Downgrade PySCF to a version compatible with openfermionpyscf 0.5 (e.g., pyscf==1.7.6).
Upgrade
Version history
0.5latest on PyPI · released Dec 22, 2020
Audit
Dependencies
openfermionrequiredCore library for fermionic Hamiltonians
pyscfrequiredRequired for molecular integral computation
Agent activity
4 hits · last 30 days
node
4
Resources
openfermionpyscf — pip install openfermionpyscf · libregistry