vibeqc.Hamiltonian

class vibeqc.Hamiltonian(h1e, h2e, nuclear_repulsion=0.0, norb=0, nelec=0, ms2=0, description='')[source]

Bases: object

One- and two-electron integrals in an orthonormal spatial-orbital basis.

Parameters:
h1e

One-electron (core) Hamiltonian h_{pq}.

Type:

(norb, norb) ndarray

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.

Type:

(norb, norb, norb, norb) ndarray

nuclear_repulsion

Nuclear-nuclear repulsion energy E_nuc (Hartree).

Type:

float

norb

Number of spatial orbitals.

Type:

int

nelec

Number of electrons.

Type:

int

ms2

2 × S_z = n_alpha − n_beta. 0 for closed-shell singlets.

Type:

int

description

Human-readable label for logging / diagnostics.

Type:

str

__init__(h1e, h2e, nuclear_repulsion=0.0, norb=0, nelec=0, ms2=0, description='')
Parameters:
Return type:

None

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

h1e: ndarray
h2e: ndarray
nuclear_repulsion: float = 0.0
norb: int = 0
nelec: int = 0
ms2: int = 0
description: str = ''
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.CASCI and by vibe-qc’s own casci/casscf/nevpt2/caspt2 family: the lowest

n_core = (self.nelec − n_active_elec) // 2

molecular orbitals form a doubly-occupied inactive core, the next n_active_orb are 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’s g_{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 energy

    E_core = 2 Σ_c h_cc + Σ_cd (2 g_{cdcd} − g_{cddc})

    so that E_total = (active CI eigenvalue) + nuclear_repulsion equals the untruncated CASCI total energy.

This is the proper frozen-core truncation: the dressing term and the E_core offset 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_elec must be even and non-negative.

  • ms2 (int, optional) – 2 S_z of the active electrons. Defaults to the parent Hamiltonian’s ms2 — the doubly-occupied inactive core carries no net spin, so all of the molecule’s 2 S_z lives in the active window.

Returns:

norb = n_active_orb, nelec = n_active_elec, with the dressed one-electron term and the inactive energy folded into nuclear_repulsion. self must 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:

Hamiltonian

Notes

The dressing is the same validated routine the CASCI path uses (vibeqc.solvers._casci._frozen_core_dressing); active_space is the entry point for the determinant solvers (fci, selected_ci, dmrg, v2rdm, cisd, transcorrelated_ci) that operate directly on a truncated Hamiltonian.