sci_solvers.fulqrum_ramps¶
RAMPS subspace expansion with fulqrum, for spatial and spinless determinants.
fulqrum's RAMPS (fulqrum.ramps.ramps_open) grows a determinant subspace around a
core: starting from every core determinant it enumerates the determinants the
Hamiltonian connects to it, and adds each one whose second-order perturbative energy
estimate prefactor * |H_ij|^2 / (E_target - H_jj) exceeds tol. With
max_recursion > 1 the added determinants seed the next layer. The result is a
compact, Hamiltonian-selected determinant set (a general-determinant basis), typically
much smaller than a Cartesian-product or all-excitations expansion of similar accuracy.
The score uses only |H_ij| and the real E_target - H_jj, so RAMPS applies
unchanged to complex Hermitian operators. Two wrappers follow the sci-solvers string
conventions:
- :func:
ramps_expand: spatial determinants as parallel(alpha, beta)arrays, formode="gdb"solvers; real or complex Hermitian integrals. - :func:
ramps_expand_spinless: flatN-particle spin-orbital determinants, for the spinless (scalarnelec) path; complex Hermitian spin-orbital integrals.
Both reuse the cached fulqrum operators of :mod:sci_solvers.fulqrum_ci_problem. Needs
the optional fulqrum extra.
ramps_expand
¶
ramps_expand(hcore: ndarray, eri: ndarray, strs_a: ndarray, strs_b: ndarray, target_energy: float, *, tol: float = 1e-06, max_recursion: int = 1, check_hermitian: bool = True, atol: float = 1e-07, rtol: float = 1e-05) -> tuple[ndarray, ndarray]
Grow a spatial determinant subspace around a core with fulqrum's RAMPS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hcore
|
ndarray
|
One-electron integrals, |
required |
eri
|
ndarray
|
Chemist-notation two-electron integrals, |
required |
strs_a
|
ndarray
|
Alpha CI strings (bitmask integers) of the core determinants, parallel
to |
required |
strs_b
|
ndarray
|
Beta CI strings of the core determinants, parallel to |
required |
target_energy
|
float
|
Electronic energy (no nuclear repulsion) of the state the expansion targets, typically the core's ground-state energy. It sets the perturbative denominators. |
required |
tol
|
float
|
Selection threshold on the perturbative energy estimate; smaller keeps more determinants. |
1e-06
|
max_recursion
|
int
|
Number of selection layers, each seeded by the previous layer's additions. |
1
|
check_hermitian
|
bool
|
For complex integrals, verify the Hermiticity symmetries the CI builders check. |
True
|
atol
|
float
|
Absolute tolerance for those checks. |
1e-07
|
rtol
|
float
|
Relative tolerance for those checks. |
1e-05
|
Returns:
| Type | Description |
|---|---|
ndarray
|
|
ndarray
|
every core determinant included (first, in their input order, deduplicated), |
tuple[ndarray, ndarray]
|
followed by the additions in the order RAMPS selected them. Particle numbers are |
tuple[ndarray, ndarray]
|
preserved, since the Hamiltonian conserves them. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the integral shapes are inconsistent, the string arrays are not
parallel or empty, |
Notes
For a core determinant (or a determinant added in an earlier layer) i with
prefactor p_i, each connected determinant j outside the subspace scores
.. math::
\epsilon_j = p_i \, \frac{|H_{ij}|^2}{E_{\text{target}} - H_{jj}},
with p_i = 1 / E_target for the core, and j is added when
|epsilon_j| > tol. An added j seeds the next layer with
p_j = epsilon_j / (E_target - H_jj). H_jj and E_target are real for
a Hermitian H, so the score is the same for real and complex integrals.
ramps_expand_spinless
¶
ramps_expand_spinless(hcore: ndarray, eri: ndarray, strs: ndarray, target_energy: float, *, tol: float = 1e-06, max_recursion: int = 1, check_hermitian: bool = True, atol: float = 1e-07, rtol: float = 1e-05) -> ndarray
Grow a spinless (flat spin-orbital) determinant subspace with fulqrum's RAMPS.
The spinless counterpart of :func:ramps_expand, on the operator
:func:~sci_solvers.fulqrum_ci_problem.fulqrum_spinless_subspace_hamiltonian builds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hcore
|
ndarray
|
Complex Hermitian spin-orbital one-electron integrals, |
required |
eri
|
ndarray
|
Complex chemist-notation spin-orbital ERI, |
required |
strs
|
ndarray
|
|
required |
target_energy
|
float
|
Electronic energy of the targeted state, typically the core's ground energy. |
required |
tol
|
float
|
Selection threshold on the perturbative energy estimate. |
1e-06
|
max_recursion
|
int
|
Number of selection layers. |
1
|
check_hermitian
|
bool
|
Verify the Hermiticity symmetries before building. |
True
|
atol
|
float
|
Absolute tolerance for those checks. |
1e-07
|
rtol
|
float
|
Relative tolerance for those checks. |
1e-05
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The expanded determinants as an int64 array: the core first (deduplicated, in |
ndarray
|
input order), then the additions. The particle number is preserved. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the integrals are real or inconsistently shaped, |