qrunch.chemistry.subspace_diagonalization.natural_orbitals

Natural-orbital rotations and determinant basis transformations for CI subspaces.

Functions

aligned_natural_orbitals(one_rdm[, ...])

Compute natural orbital occupation numbers and transformation matrix aligned with the reference basis.

natural_orbital_density_matrices(...)

Build the density matrices whose eigenvectors define the natural-orbital rotations.

natural_orbital_rotation_matrices(...)

Compute one orbital rotation for each supplied density matrix.

transform_determinants_to_natural_orbital_basis(...)

Transform determinants while preserving the Hamiltonian's occupation representation.

aligned_natural_orbitals(one_rdm: NDArray[float64], degeneracy_threshold: float = 1e-07) → tuple[NDArray[float64], NDArray[float64]]

Compute natural orbital occupation numbers and transformation matrix aligned with the reference basis.

Diagonalizes the 1-RDM \(\gamma = U n U^T\) such that occupation numbers \(n\) are sorted descending, and columns of \(U\) are aligned with the reference basis using Procrustes alignment in degenerate subspaces and positive diagonal elements.

Parameters:
  • one_rdm (NDArray[float64]) – Symmetric 1-RDM matrix of shape (n_orbitals, n_orbitals).

  • degeneracy_threshold (float) – Threshold for grouping degenerate eigenvalues during alignment.

Return type:

tuple[NDArray[float64], NDArray[float64]]

natural_orbital_density_matrices(determinants: list[int], coefficients: NDArray[float64], hamiltonian: FermionHermitianSum | PairedHardcoreBosonHermitianSum) → tuple[NDArray[float64], ...]

Build the density matrices whose eigenvectors define the natural-orbital rotations.

Parameters:
  • determinants (list[int]) – List of computational-basis Slater / paired-electron determinants as integers.

  • coefficients (NDArray[float64]) – CI expansion coefficients for each determinant in determinants.

  • hamiltonian (FermionHermitianSum | PairedHardcoreBosonHermitianSum) – Hamiltonian metadata defining the determinant and integral representation.

Return type:

tuple[NDArray[float64], …]

natural_orbital_rotation_matrices(density_matrices: tuple[NDArray[float64], ...]) → tuple[NDArray[float64], ...]

Compute one orbital rotation for each supplied density matrix.

Parameters:

density_matrices (tuple[NDArray[float64], ...]) – Spin-summed restricted or separate unrestricted one-particle density matrices.

Return type:

tuple[NDArray[float64], …]

transform_determinants_to_natural_orbital_basis(determinants: list[int], coefficients: NDArray[float64], rotation_matrices: tuple[NDArray[float64], ...], hamiltonian: FermionHermitianSum | PairedHardcoreBosonHermitianSum, *, threshold: float = 0.0001) → list[int]

Transform determinants while preserving the Hamiltonian’s occupation representation.

Parameters:
  • determinants (list[int]) – Determinants spanning the current subspace.

  • coefficients (NDArray[float64]) – Ground-state CI coefficients in determinant order.

  • rotation_matrices (tuple[NDArray[float64], ...]) – One restricted or two unrestricted natural-orbital rotations.

  • hamiltonian (FermionHermitianSum | PairedHardcoreBosonHermitianSum) – Hamiltonian metadata defining the determinant representation.

  • threshold (float) – Minimum absolute transformed coefficient to retain.

Return type:

list[int]