CIPSIXX Selection Algorithm#
Build a multistate determinant space in the prepared selected-orbital window.
CIPSIXX reads integrals from the shared HDF5, grows a variational CI basis and
exports its spin-completed model space for DIAGPT/HEFFSO. Count determinants
after spin closure for targets and comparisons; also report the number
before closure and the number added. Since CIPSIXX 0.3.0 the selector
diagonalizes that closed space itself (variational_space: closed, the default
with a closure), so its energies describe the exported model space.
This page explains the current algorithm and how the mppt.cipsixx settings
change it. Use the YAML input reference for
exact types, defaults, and validation rules. Use the
unified workflow guide for execution,
restart, and checkpoint behavior.
Pinned selector release#
MPPT pins CIPSIXX v0.3.0, commit
9f6e2ef94826ff0a1c787e92efd5a809f2064e44. Selector tags use immutable
vMAJOR.MINOR.PATCH names and match the binary version:
cipsixx_select --version
# cipsixx_select 0.3.0
This release diagonalizes the spin-closed space exported to DIAGPT and records
the selection history at full precision in /cipsixx/iterations and
/cipsixx/final. It changes determinant sets and energies; see
the variational space and the
0.3.0 release notes.
v0.2.0 added bounded candidate storage, packed generation, fixed-input replay,
connection/CI reuse, incremental closure counting and chunked atomic HDF5 export.
Set Memory Budgets Before Selection#
Always choose explicit resource budgets for a production selection. The
default hash backend can grow large intermediate tables even for a small final
target. Use bounded storage to spill contributions to disk while preserving
their signed sums. Add these controls to mppt.cipsixx, sized for the worker:
candidate_storage: bounded
candidate_buffer_mib: 4096
candidate_workspace_mib: 256
candidate_output_mib: 512
candidate_scratch_mib: 65536
omp_num_threads: 8
blas_num_threads: 1
Keep the existing initial space, frozen orbitals, roots and selection thresholds.
Run pyscf2mppt input.yaml; the launcher creates run-local scratch/cipsixx.
candidate_scratch can select another filesystem. Hash remains the default.
This example provides 4 GiB of contribution buffers, 256 MiB of reduction workspace, 512 MiB of materialized candidate output and a 64 GiB scratch quota. These are separate storage budgets, not a total-process RAM cap or a guarantee that the selection fits on disk. Integrals, CI matrices and solver workspace remain additional allocations. The bounded codec supports at most 192 selected spatial orbitals.
Log lines containing candidate phase=... and reserved_record_bytes=... confirm
bounded execution. max_candidates, batch_size and printed candidate counts
do not bound hash accumulation memory. See the
YAML resource reference
and the restart/replay guide.
Budget RAM for the resident integrals, CI eigenvectors, final determinant list
and dense CI Hamiltonian in addition to those payloads. One float64 dense
matrix of dimension 10000 occupies about 0.745 GiB; diagonalization may need
additional matrices/workspace. With the default closed variational space the
dimension is the closure-expanded space, typically 2–3 times the selected
determinants; variational_space: selected diagonalizes only the latter.
Bounded storage spills candidate records, not every allocation in the process.
Reserve actual scratch capacity and a worker-level memory limit/headroom; a
scratch quota or output cap can fail cleanly rather than make an oversized job
fit. molecule.max_memory and export max_mem_bytes do not cap this native stage.
OpenMP distributes parent-determinant generation and bounded partition/reduction
work. Multistate contributions are accumulated/scored for all roots; the current
packed path shares parent connections across roots rather than promising one
thread per root. More workers can accelerate these stages, subject to available
parallel work and I/O. blas_num_threads: 1 keeps nested BLAS teams from
oversubscribing the selector workers. Inspect generation, reduction and
diagonalization timings separately.
Three Separate Growth Recipes#
Choose one recipe below inside the already initialized mppt.cipsixx block.
Keep the roots, initial CAS, empty frozen list where intended and memory budgets
from the main input. Values illustrate policy, not transferable convergence
thresholds. Spin-projection closure and final diagonalization are already on.
Write the complete growth recipe explicitly, even for default-valued choices:
Recipe |
Fields to write |
|---|---|
Top-k |
|
Fixed coefficient threshold |
|
Adaptive coefficient threshold |
|
min_new_determinants may keep its omitted default 100. The explicit recipe lets
the reader see the batch limit or starting cutoff and its relaxation schedule
directly in the saved input. It is a workflow rule, not a change to schema defaults.
Fixed Coefficient Threshold#
selection_growth: threshold
min_abs_coefficient: 1.0e-4
max_selected: 10000
The nonobvious threshold name is min_abs_coefficient. Admit candidates
whose absolute first-order coefficient is at least this value (weighted
in multistate mode). A higher threshold is stricter and normally admits fewer
candidates; a small or zero threshold can admit a very large batch. Each step
only sees singles/doubles connected to the current CI space, not an enumeration
of all possible determinants. Repeated growth can reach higher excitation ranks
relative to the original seed.
All passing candidates are added, subject to an optional max_candidates cap.
batch_size has no effect here. The target is checked after the batch and can
be exceeded substantially. max_iterations still bounds the number of steps.
Adaptive Coefficient Threshold#
selection_growth: threshold
adaptive_threshold: true
min_abs_coefficient: 1.0e-3
threshold_multiplier: 0.75
max_selected: 10000
max_iterations: 80
Start with important candidates, diagonalize the enlarged CI space, then admit less important candidates using the updated states. This can produce a different trajectory and final space from a fixed low threshold.
The threshold does not decrease on every iteration. With the default
min_new_determinants: 100, it is held while at least 100 new determinants are
added to the selector’s CI basis in a step. After the initial step, fewer than
100 additions trigger multiplication by the explicitly chosen 0.75, down to the default
floor of 1e-7. The next iteration uses that lowered threshold. Thus plentiful
important candidates delay the move to weaker contributions. An empty initial
pass can be retried; no-progress termination occurs once the selected threshold
cannot be lowered. The iteration budget of 80 is explicit to allow this schedule.
Only the threshold of the chosen selection_metric is adapted. An explicitly
nonzero threshold of the other metric remains an additional fixed filter.
Targeted Top-K#
selection_growth: topk
batch_size: 250
max_selected: 10000
max_iterations: 80
Always write selection_growth explicitly, choosing topk or threshold.
The software default remains top-k, but the selected strategy and its
batch_size belong in the saved input. Coefficient ranking remains the default.
Each iteration takes the most important retained candidates,
up to 250 new CI-basis determinants and the remaining target budget, then
rediagonalizes. Always specify the chosen batch_size, including 250.
Closure additions can take the final count beyond 10000.
Top-k acts like a data-dependent cutoff for one fixed candidate ranking, but is not generally equivalent to adaptive threshold. Fixed batch size versus a fixed/relaxed score cutoff, ties, changing CI vectors, root weights and closure all affect the next iteration. No equivalence of final spaces is implied.
A positive target is necessary for batched top-k in this implementation.
With no target, every retained candidate is added; batch_size alone is not a
growth bound. Leaving the default 12 iterations may stop before a large target.
Conflicts And Precedence#
Combination |
Actual behavior |
|---|---|
|
Rejected; neither mode wins. |
|
Threshold growth wins; batch size is ignored. |
|
Filters run first, then top-k ranks the survivors; avoid this hybrid unless deliberate. |
Both coefficient and energy thresholds |
Both must pass for an eligible root; the metric chooses ranking, not which filter exists. |
max_candidates limits the retained candidate list for one iteration after
accumulation/filtering. max_selected is the stopping target for the
accumulated closure-expanded model. Neither bounds intermediate candidate
memory. With top-k, an explicit smaller max_candidates also restricts the
available batch; otherwise the selector can retain only the desired top batch.
Selection Flow#
Selection changes the model space and its completeness in S and, when applicable, L/J. Larger selections can increase or decrease MPPT multiplet splittings until convergence; determinant count alone is not a symmetry certificate. See MPPT symmetry and convergence before interpreting differences between selected calculations or rotated inputs.
Each ordinary iteration diagonalizes the space that existed at the start of that iteration. Candidate determinants are appended afterward, followed by their missing spin partners in the closed variational space. A final diagonalization is therefore required when the final coefficients and weights must describe the fully grown space.
Initial Determinant Space#
initial_space chooses the starting variational basis.
Value |
Initial basis |
Required information |
|---|---|---|
|
One determinant occupying the lowest alpha and beta orbitals |
Electron counts embedded by the PySCF dump |
|
Every alpha/beta occupation combination in |
Active orbitals and either |
|
A normalized determinant list read from HDF5 |
An existing |
For CAS initialization, core_orbitals are doubly occupied in every reference
determinant and are not included in the active electron count. A total
cas_electrons value is split as ceil(N/2) alpha and floor(N/2) beta unless
the spin-resolved counts are supplied explicitly.
The determinant-list route reads alpha/beta bitsets. It uses stored
coefficients when present, otherwise weights, otherwise equal values, and
normalizes the resulting reference vector. Pointing determinants_group at
/cipsixx/selected_determinants restarts growth from an earlier CI
selection.
YAML orbital labels are one-based. The dump and selector use zero-based selected-space indices internally.
Variational Diagonalization#
At the start of each iteration CIPSIXX builds the dense Hamiltonian in the
current determinant basis and requests the lowest n_roots eigenpairs. The
diagonalizer cannot return more roots than the current determinant-space
dimension.
Omit selected_root in normal multistate inputs. It is the requested
single-state root, numbered from zero in ascending energy order. In single-state mode it supplies the reference
coefficients used for candidate generation. In multi-state mode every returned
root can score candidates, but selected_root still supplies the reported
variational energy and the final stored CI coefficients.
Energies belong to the closed space by default. With
variational_space: closed (the default whenever spin_adaptation_closure is
not none), the closure of the current determinants is added before every
diagonalization. The energies, CI coefficients, occupations and next
generators then belong to the space exported to DIAGPT. Before CIPSIXX 0.3.0,
and with variational_space: selected, only the selected determinants were
diagonalized: those spin-contaminated energies lie above the exported space
and do not describe it. On RuO₂ with target 1000 and four roots the closed
ground state lies 2.6 mEh lower and the selection takes about 2.7 times the
wall time.
The initial CI space must contain at least selected_root + 1
determinants. Custom multistate weighting currently also requires the initial
space to provide all n_roots roots because root_weights has one value per
configured root. The HF initial space contains one determinant, so excited-root
or custom multistate selection must start from a sufficiently large CAS or HDF5
determinant list.
Orbital Populations After Selection#
/cipsixx/final/root_occupations[root, p] stores the spin-summed natural
diagonal occupations of every root after the final diagonalization, and
/cipsixx/iterations/root_occupations stores them for each iteration. Both use
zero-based selected-space orbitals and sum to the selected-space electron
count. For full densities of selected_root, use the final determinants and
coefficients in /cipsixx/selected_determinants. The determinant
selected_root column records which root selected a candidate; it does not
supply separate final eigenvectors. Selection weights are not normalized
populations.
Map the selected-space indices back to the full orbital IDs and restore the frozen doubly occupied orbitals when checking the total electron count. Keep the selected-CI density separate from HEFFSO’s SOC-state occupations. HEFFSO’s retained-state bare occupations do not include an effective density-operator correction from the external perturbative space.
When changing the orbital selection window, compare total CI energies using
the native selected-space energy plus E_frozen and PotNEcor. The frozen-core
constant changes when an occupied shell enters selection. Each ordinary
iteration row precedes its growth batch; the final row of both CSV reports and
/cipsixx/final hold the energies of the fully grown space.
Orbital populations depend on the chosen orbitals. Sum complete identified shell groups, retain the character weights, and use the full one-particle density in a common orbital basis for density differences across rotations.
Candidate Generation#
For each current determinant with a nonzero reference coefficient, CIPSIXX generates spin-conserving external:
alpha and beta single excitations;
alpha-alpha and beta-beta double excitations;
alpha-beta double excitations.
Determinants already present in the variational space are excluded. When several parent determinants generate the same external determinant, their matrix-element contributions are accumulated before scoring.
frozen_orbitals cannot be used as excitation holes or as excitation
particles. Consequently, freezing an unoccupied orbital also prevents an
electron from entering it. When frozen_orbitals is omitted,
core_orbitals is used as the frozen list. In the managed workflow,
frozen_orbitals: [] emits --frozen-orbitals none and suppresses that
fallback. When invoking cipsixx_select directly on a PySCF dump, pass the same
CLI option because the current HDF5 contract does not distinguish an omitted
list from an explicitly empty list.
Large Active Spaces#
Candidate generation is a current scaling limit, especially with many unfrozen occupied orbitals and many possible electron moves.
Model growth rebuilds contributions and diagonalizes the changed model. Empty adaptive-threshold retries reuse CI for unchanged P; bounded storage also reuses value-validated connections for rescoring.
The default hash backend materializes candidate tables. Coefficient/energy filtering happens after complete signed accumulation; those filters do not bound the tables’ peak memory.
max_selected,batch_sizeandmax_candidatesdo not cap that intermediate memory. A small final target can still require a large candidate set.One or a few larger growth steps may be practical when a long iterative sequence is too expensive. This changes the selection trajectory; it is not a convergence guarantee or a fixed program limit on iteration count.
For scale, a 141-orbital, 110-alpha/109-beta space with no frozen orbitals has 17,608,109 possible single/double excitations per parent before integral gates. Twelve parents imply roughly 211 million visits before merging duplicates. Those combinatorial counts explain why a large, mobile electron space can be costly even when the requested selected space is small.
Choose frozen orbitals and active spaces from the scientific model, not merely to reduce runtime. The export memory setting does not impose a native CIPSIXX RSS limit. Use the iteration CSVs to inspect generation time and actual growth.
Native bounded storage#
For standalone selection, add these options to the native command after creating an existing scratch directory:
--candidate-storage bounded
--candidate-buffer-mib 512
--candidate-workspace-mib 16
--candidate-scratch /path/to/existing/scratch
Record/workspace budgets are shared across workers. Partition-owned reduction and spill/merge preserve complete signed parent sums before scoring. The codec supports 1–192 selected spatial orbitals and uint32 parent indices.
These are payload budgets, not a process RSS cap: integrals, final models,
dense CI and runtime overhead remain resident. --candidate-output-mib bounds
materialized candidate payload when nonzero; 0 retains unlimited vector output.
Native threshold streaming avoids a second accepted-candidate vector but still
needs final model storage and scratch space. Use cipsixx_select --help for the
scratch quota, reducer, partition and file-handle controls.
Perturbative Quantities#
For root m, current determinants I, and an external candidate J, the
selector computes:
E0_m = sum_I(c_Im^2 * E_zeroth_I)
S_Jm = sum_I(H_JI * c_Im)
Delta_Jm = E0_m - E_zeroth_J
c1_Jm = S_Jm / Delta_Jm
E2_Jm = S_Jm * c1_Jm
E_zeroth_I is the diagonal zeroth-order configuration energy. The current
executable obtains it from the selected-space Fock diagonal.
A root contribution is discarded when
abs(Delta_Jm) <= denominator_tolerance.
selection_metric chooses the primary score:
Value |
Primary score |
|---|---|
|
|
|
|
Both quantities are always computed. min_abs_coefficient and
min_abs_energy are conjunctive filters: a candidate must pass both nonzero
thresholds even when only one quantity is the ranking metric. Single-state mode
compares the raw absolute quantities. Multi-state mode compares the
root-weighted absolute quantities, so a nonuniform weighting policy changes
admission as well as ranking. Equality passes.
Keep coefficient ranking for routine selection. It estimates the candidate’s first-order wavefunction amplitude, not a normalized probability or the second-order energy itself. The energy estimate is the coupling times that coefficient, so the two rankings can differ when couplings/denominators differ. These perturbative quantities select a CI basis; they are not the final MPPT2 energy correction produced by DIAGPT.
max_candidates, when set, keeps only the highest-scoring retained candidates
for the iteration. It is applied after denominator and threshold filtering.
Single-State And Multi-State Scoring#
Use multi_state: true and override state_weighting: legacy-taum for the
usual manifold calculation. The software default remains uniform; this is
a deliberate workflow recommendation. Omit root_weights unless assigning
custom unequal priorities. CASSCF averaging weights and DIAGPT state_weights
are independent controls; their equal defaults need no explicit lists.
With multi_state: false, only selected_root generates and scores
candidates.
With multi_state: true, every returned root computes its own perturbative
quantities. For each candidate, the root with the largest weighted primary
score wins. The candidate stores that root’s coupling, denominator,
coefficient, second-order energy, and root index. Ties select the lower root
index.
state_weighting defines the score multiplier w_m:
Mode |
Weight |
|---|---|
|
|
|
|
|
|
|
|
The weights are not normalized. A zero custom weight suppresses that root’s candidate score. Custom weights require exactly one value per configured root and at least one positive value.
legacy-taum compensates for the dilution of individual coefficients in a
multireference root. A one-determinant root has multiplier one; a normalized
root spread equally over K determinants has multiplier √K. A smaller largest
coefficient therefore gives that root’s external candidates a larger score.
It favors roots with distributed CI weight, not simply roots with more rows,
and does not prove equal correlation quality between states.
Both thresholds are checked per root first. The winning root has the largest weighted primary score among eligible roots. A failing root does not hide another root that passes both filters.
Targets, Growth, And Stopping#
max_selected is a stopping target, not a hard maximum. The target count is the
size of the output-side spin-closure-expanded model space, while candidates are
added to the selector’s variational space. One newly added
determinant can therefore add several rows to the target count.
Top-K Growth#
With selection_growth: topk and a target, each iteration adds at most:
min(batch_size, remaining target count, retained candidate count)
Spin closure can still make the resulting target count exceed
max_selected. When max_selected is null, there is no remaining target
budget, and top-k growth adds all retained candidates; batch_size does not
cap that no-target case.
Threshold Growth#
With selection_growth: threshold, every retained candidate is added.
batch_size is ignored. max_candidates can still cap the retained list, and
the target is checked only after the complete threshold batch, so overshoot is
expected.
Adaptive Thresholds#
Adaptive thresholds are valid only with threshold growth. When an iteration
after the initial iteration adds fewer than min_new_determinants, the
threshold for the selected metric is multiplied by threshold_multiplier and
clamped to threshold_floor. The multiplier must be strictly between zero and
one.
The iteration report records the threshold used in that iteration. Any reduction takes effect in a later iteration.
Stop Conditions#
Selection stops when the first applicable condition occurs:
the closure-expanded target count reaches
max_selected;no candidates remain under fixed-threshold growth;
no new unique determinants can be added;
max_iterationsis exhausted.
There is no energy-convergence or perturbative-energy-convergence stopping criterion. The run can finish without reaching a configured target.
An empty adaptive pass continues only when the selected threshold was reduced or the initial-iteration retry is needed. A fixed secondary filter does not cause repeated empty passes once the selected threshold reaches its floor.
With max_selected: null, target stopping is disabled. The managed Python
workflow still passes its default max_iterations: 12, so a no-target run can
perform up to twelve all-candidate growth iterations before another stop
condition ends it.
Final Diagonalization#
final_diagonalization: always diagonalizes the grown space after the last
iteration that added determinants. It refreshes final selected-root
coefficients and weights, making them authoritative for the complete variational
space.
final_diagonalization: never skips only that final pass. It does not skip the
diagonalization at the start of every ordinary selection iteration. Existing
determinants then retain coefficients from the pre-growth space, while newly
added determinants retain perturbative admission coefficients. The executable
prints a warning, and such output should be treated as a deliberate
handoff/performance experiment rather than a final CI result.
If an explicit target is already satisfied by the initial space, always
performs one diagonalization and never returns without building the
Hamiltonian.
Spin Closure, Counts And Model-Space Export#
CIPSIXX writes two determinant representations with different responsibilities.
HDF5 path |
Meaning |
|---|---|
|
Initial and selected determinants used as the CI variational basis and restart input |
|
Spin-closed, reordered, quasi-restricted compatibility view consumed by DIAGPT and HEFFSO |
spin_adaptation_closure is applied to target counting and export and, with
the default variational_space: closed, to every variational diagonalization:
Mode |
Export behavior |
|---|---|
|
Export only the selected CI basis |
|
Add missing alpha/beta-swapped partners when alpha and beta counts are equal |
|
Add all same-spatial-occupation assignments with the same alpha and beta electron counts |
The exporter then applies the quasi-restricted conventions required downstream:
closure determinants are deduplicated;
majority-alpha sources are globally spin-flipped into the required majority-beta convention;
determinants are represented as holes and particles relative to a closed-shell vacuum;
odd-electron records receive the compatibility electron-at-infinity marker;
records are reordered so spin variants of one spatial configuration remain contiguous;
metatis clamped to the smaller ofn_rootsand the exported row count.
With variational_space: closed, closure determinants are stored in
/cipsixx/selected_determinants with CI coefficients and zero perturbative
provenance, and the exported adapter spans the CIPSIXX wavefunction. With
variational_space: selected, closure rows are not diagonalized and the
exported adapter is not a CIPSIXX wavefunction.
Keep the default spin-projection closure. It completes spin assignments
of retained spatial occupations at fixed alpha/beta counts and helps avoid
spin-imbalanced downstream spaces. This is more than globally swapping alpha
and beta labels; the narrower spin-complement mode is limited to equal counts.
Report the closure-expanded determinant total first. Alongside it, record the
CI-basis size before closure, added count and expansion ratio. For example,
10000 after closure from 5000 means 5000 added, ratio 2. In the closed space,
variational_dimension − closure_count is the selected size and
closure_count the added partners; with variational_space: selected the
iteration CSV’s target_count_after and determinant_count_after expose the
two sizes.
The difference diagnoses how much spin completion was missing from selection.
It is not itself a quality score: a ratio near two does not prove that only
strong configurations were selected, nor that later growth merely duplicates
opposite spins. Interpret its trend with energies, weights and state character.
MPPT2 does not automatically preserve every expected multiplet degeneracy. Uneven determinant selection or too few retained states can worsen splitting; spin closure helps spin balance but does not certify full S/L/J completeness. Convergence of symmetry-expected gaps can support a balanced calculation, yet more determinants need not improve gaps monotonically. Do not require all microstates to merge, particularly in a crystal field. Applicable zero-field Kramers protection is a separate condition. See symmetry and convergence.
The current spin-projection closure skips determinants with more than eight singly occupied spatial orbitals. Export also rejects a quasi-restricted excitation rank above eight. These are current compatibility limits, not requests to truncate selection silently.
Iteration Reports#
iteration_report defaults to cipsixx_iterations.csv. Each ordinary
iteration records:
selector CI-basis determinant counts before and after growth;
filtered/capped candidate count and actual additions;
closure-expanded target count after growth;
coefficient and energy thresholds used;
largest retained coefficient and energy contributions;
selected-root variational energy before growth;
Hamiltonian-build, diagonalization, and selection timings.
root_energy_report defaults to cipsixx_root_energies.csv and records every
root returned by each ordinary iteration.
Neither CSV receives a separate row for the final post-growth rediagonalization. Its selected-root energy appears in the executable’s final log summary. Reports are also not durable checkpoint outputs: a reused selection stage does not regenerate them.
Configuration Guide#
Goal |
Recommended controls |
|---|---|
Ground-state single-state selection |
Omit root/multistate controls; their defaults already select the lowest root |
One excited-state selection |
Start from enough CAS/HDF5 determinants, increase |
Balanced selection across roots |
|
Bounded per-iteration CI growth |
Explicitly set |
Admit every candidate above scientific thresholds |
|
Relax a sparse threshold automatically |
Threshold growth plus |
Restart from an earlier selection |
|
Authoritative final coefficients |
Keep |
Do not copy determinant targets or perturbative thresholds between unrelated
systems without convergence studies. See benchmarks for
measured scaling and the distinction between the stopping target, pre-closure
CI dimension and reported closure-expanded ncf; see outputs for persisted files
and HDF5 groups; and see the selected-route contract for
the separate meaning of selected integral routing.