General-algebra solvers¶
ARPACK, Davidson, LOBPCG, PRIMME, SLEPc, EVSL and PySCF Davidson share the Hamiltonian reduction and result interface. They differ in the eigensolver used for each subspace. Method papers and upstream code are listed on the landing page.
Usage¶
from sci_solvers.energy_solvers.factory import create_solver
from sci_solvers.hamiltonian import HamiltonianData
ham = HamiltonianData.from_fcidump("FCIDUMP")
solver = create_solver("arpack", symmetrize_spin=False, hamiltonian=ham, mode="gdb", nroots=3)
results = solver.sci_solver_callable_eigen_states(
[(strs_a, strs_b)],
ham.hcore,
ham.eri,
ham.num_orbitals,
(ham.num_elec_a, ham.num_elec_b),
)
energies = [root.energy for root in results[0].states]
The alpha/beta arrays are parallel pairs in GDB and independent sets in TPB.
TPB inputs must be sorted and unique. Set compute_rdm2=True to retain the 2-RDM.
hamiltonian_backend="fulqrum" selects an alternative CPU builder, except for
PySCF Davidson; see Fulqrum.
Backends¶
arpack¶
SciPy eigsh for the lowest eigenvalues. use_operator=True (default) applies
matrix-vector products without assembling the matrix; False assembles it.
ncv sets the Lanczos subspace size. Real and complex Hermitian inputs are supported.
davidson¶
Our matrix-free block-Davidson implementation, with real and complex support.
davidson_block_size bounds the subspace and max_cycle limits iterations.
Use max_cycle, rather than the family-wide maxiter, for this backend.
lobpcg¶
SciPy's block eigensolver with a diagonal preconditioner, for real or complex
Hermitian inputs. seed controls the initial block.
primme¶
PRIMME's preconditioned eigensolver for real or complex Hermitian inputs.
Install with uv sync --extra primme.
slepc¶
SLEPc/PETSc through slepc4py. storage="shell" uses a matrix-free operator;
"aij" assembles CSR. eps_type selects the eigensolver and comm the MPI
communicator. Complex inputs require PETSc built with complex scalars.
Install with uv sync --extra slepc.
evsl¶
Real-valued filtered Lanczos for eigenvalues in an interval. window=(lo, hi)
sets the interval; without it, a density-of-states estimate selects a low-energy
band. Requires a built libevsl; see the
build scripts.
pyscf_davidson¶
PySCF's fixed-space Davidson, with native spin projection through spin_sq.
It supports real TPB inputs only and reads the raw integrals directly.
GDB, spinless inputs and the Fulqrum builder are unsupported.
Except for PySCF Davidson, spin_sq uses a post-solve filter that retains roots
with the requested S². The complex-capable backends also support flat spinless
determinants with a scalar particle count.
See the API reference for all classes and options.