vibeqc.Hamiltonian¶
- class vibeqc.Hamiltonian(h1e, h2e, nuclear_repulsion=0.0, norb=0, nelec=0, ms2=0, description='')[source]¶
Bases:
objectOne- and two-electron integrals in an orthonormal spatial-orbital basis.
- Parameters:
- h2e¶
Two-electron integrals in physicist’s notation: g_{pqrs} = (pr|qs) = ∫∫ φ_p*(r₁) φ_q*(r₂) r₁₂⁻¹ φ_r(r₁) φ_s(r₂). Stored as a 4-index tensor with anti-symmetry NOT folded in — the solvers apply Slater–Condon rules that need the full tensor.
- __init__(h1e, h2e, nuclear_repulsion=0.0, norb=0, nelec=0, ms2=0, description='')¶
Methods
__init__(h1e, h2e[, nuclear_repulsion, ...])active_space(n_active_orb, n_active_elec, *)Project onto a frozen-core-dressed CAS(
n_active_elec,n_active_orb).Attributes
- active_space(n_active_orb, n_active_elec, *, ms2=None)[source]¶
Project onto a frozen-core-dressed CAS(
n_active_elec,n_active_orb).Standard complete-active-space partition (Roos, Taylor & Siegbahn, Chem. Phys. 48, 157 (1980); textbook form in Helgaker, Jørgensen & Olsen, Molecular Electronic-Structure Theory, §11/§12), identical to the convention used by
mcscf.CASCIand by vibe-qc’s owncasci/casscf/nevpt2/caspt2family: the lowestn_core = (self.nelec − n_active_elec) // 2
molecular orbitals form a doubly-occupied inactive core, the next
n_active_orbare active, and the remainder are virtual. The returned Hamiltonian lives in the active orbital block but folds the inactive electrons back in exactly, so a CI over the active determinants reproduces the full-space energy:h1e— active block dressed by the inactive mean field (physicist’sg_{pqrs} = ⟨pq|rs⟩):h̃_pq = h_pq + Σ_c (2 g_{pcqc} − g_{pccq}) (p, q active)
h2e— the active–active–active–active sub-tensor;nuclear_repulsion— the original E_nuc plus the constant inactive energyE_core = 2 Σ_c h_cc + Σ_cd (2 g_{cdcd} − g_{cddc})
so that
E_total = (active CI eigenvalue) + nuclear_repulsionequals the untruncated CASCI total energy.
This is the proper frozen-core truncation: the dressing term and the
E_coreoffset are what a bare integral slice (h1e[active, active]) silently drops — without them the reported energy is the active-only contribution, off by ~``E_core`` Hartree.- Parameters:
n_active_orb (int) – Number of active spatial orbitals (
1 ≤ n_active_orb ≤ norb).n_active_elec (int) – Number of electrons in the active space. The inactive count
self.nelec − n_active_elecmust be even and non-negative.ms2 (int, optional) –
2 S_zof the active electrons. Defaults to the parent Hamiltonian’sms2— the doubly-occupied inactive core carries no net spin, so all of the molecule’s2 S_zlives in the active window.
- Returns:
norb = n_active_orb,nelec = n_active_elec, with the dressed one-electron term and the inactive energy folded intonuclear_repulsion.selfmust be the full MO-basis Hamiltonian (all orbitals) — the dressing needs the core–active integrals that a pre-sliced Hamiltonian would no longer carry.- Return type:
Notes
The dressing is the same validated routine the CASCI path uses (
vibeqc.solvers._casci._frozen_core_dressing);active_spaceis the entry point for the determinant solvers (fci,selected_ci,dmrg,v2rdm,cisd,transcorrelated_ci) that operate directly on a truncatedHamiltonian.