Analysis Of Finished Runs#
pyscf2mppt analyze reads a completed run and writes parent compositions, the
HEFFSO state-property report and magnetic tables. It does not rerun the
electronic-structure calculation. The MPPT viewer draws level diagrams, spectra
and parent links from these files.
Analyze A Finished Run#
pyscf2mppt analyze runs/ce
The command prints where the results are and the outcome of each task:
created: runs/ce/analysis/20261116T204500123456Z
parents: complete
heffso_report: complete
magnetic: skipped (Magnetic properties are disabled in this result)
Results go to runs/ce/analysis/<UTC>/. Nothing else in the run changes.
analysis/latest.json names the current analysis.
An identical analysis is never recomputed. An analysis is identified by the
SHA256 of every input file, the options that can affect it and the analysis
schema version. Only options of tasks whose inputs are present count: a run
without a DIAGPT handoff skips parent analysis, so changing --stage,
--spin-tolerance or --minimum-weight reuses its analysis. When
analysis/ already holds one with the same identity and unchanged outputs,
the command prints reused: and returns at once. Earlier analyses with other
options stay available; switching back to their options reuses them.
Situation |
Result |
|---|---|
Same run files and options |
|
Different options read by a task that can run |
New analysis directory |
Different options of a skipped task |
|
A run file was rewritten |
New analysis directory |
An output file was edited or deleted |
New analysis directory |
|
New analysis directory |
Hashes of large HDF5 files are cached in analysis/.input-hashes.json by
inode, size and modification time, so repeated checks do not reread them.
Tasks and their inputs#
Task |
Needs |
Writes |
|---|---|---|
|
DIAGPT handoff, HEFFSO states |
|
|
Shared HDF5, handoff, HEFFSO properties and logs |
|
|
HEFFSO properties with magnetic data |
|
Inputs are located through the run.json artifact roles. A task whose inputs
are absent is skipped; a failing task is recorded as failed with its
message and does not stop the others. The command fails only when no task
produced output.
Options#
Option |
Default |
Meaning |
|---|---|---|
|
recorded |
Scalar parent stage; default is the stage HEFFSO used. |
|
1e-7 |
Largest accepted spin residual of scalar blocks. |
|
0.5 |
Parent weight that assigns a state to a group. |
|
0 |
Required lead of that parent over the next one. |
|
1e-9 |
Width of one scalar energy block. |
|
250000 |
Bound on the spin-completed determinant basis. |
|
20 |
Strongest transitions listed in the summary. |
|
0.10, 0.05 |
Orbital-label thresholds. |
|
off |
Recompute even when an identical analysis exists. |
|
off |
Only report whether a matching analysis exists. |
|
off |
Print one JSON line: status, path, tasks, message. |
Exit codes: 0 for a created, reused or up-to-date analysis; 3 when --check
finds none; 4 when another analysis of the same run is running; 1 on failure.
Analysis record#
Each analysis directory holds analysis.json (schema mppt_analysis_v1):
Field |
Contents |
|---|---|
|
Identity used for reuse |
|
Option names that entered the key |
|
Role, run-relative path, SHA256, size and modification time |
|
Every numerical option |
|
Versions of pyscf2mppt, NumPy, SciPy and h5py |
|
|
|
Role, path, schema and SHA256 of every file |
Output roles: analysis_parents, analysis_state_composition,
analysis_parent_table, analysis_terms, analysis_state_properties,
analysis_orbital_character, analysis_dominant_configurations,
analysis_summary_markdown and analysis_magnetic_{levels,doublets,field_levels,response}.
Report During The Calculation#
Enable HEFFSO properties and request the report:
mppt:
prefix: Ce
heffso:
enabled: true
properties: true
pyscf2mppt input.yaml --output-dir runs/ce --heffso-report
The four report files are written to reports/heffso/ and recorded in
run.json under the analysis_* roles. --heffso-report cannot be combined
with --stop-after. Parent and magnetic tables come from pyscf2mppt analyze.
HEFFSO State-Property Report#
heffso/
├── Ce_state_properties.csv — energies, angular values, strengths
├── Ce_orbital_character.csv — projector weights and assignments
├── Ce_dominant_configurations.csv — weights and occupations
└── Ce_properties_summary.md — bounded summary and diagnostics
The report checks dimensions, determinant identities, orbital maps, energies and property consistency before writing. Line strength is the Cartesian dipole matrix-element norm; oscillator strength also includes the transition energy. Broadened and thermal spectra are drawn by the viewer from the recorded dipole matrix.
Orbital assignments are assigned, mixed or unassigned; raw weights are
retained. Labels describe projector overlap, not certified atomic terms.
Magnetic Tables#
magnetic/ holds Ce_levels.csv, Ce_doublets.csv, Ce_field_levels.csv
and Ce_magnetic_response.csv: native g values, field levels, magnetization
and susceptibility. They use the magnetic-moment operator at zeroth order in
the MPPT perturbation, projected into retained states; the analysis does not
change that approximation or the field/temperature grid. See
Magnetic Properties for formulas and applicability.
Parent Composition And Term Tables#
Parent analysis projects every spin-orbit state on the spin-pure scalar states it came from. It accepts any matched scalar/SOC pair and has no molecule-specific dimensions or paths.
Both files must contain the full mppt_eigenstates_v1 payload. Properties and
text logs are not required. The default stage is the scalar stage used by SOC;
--stage h1 selects CASCI/selected-CI parents and --stage h2 selects MPPT2.
Files and probability semantics#
File |
Contents |
|---|---|
|
Versioned |
|
Every SOC state, parent percentage, uncovered percentage and exact spin-sector percentage. |
|
Scalar parent catalog, S, rank/capacity and source roots. |
|
Groups, component IDs, mean energies, raw widths and parent percentages. |
JSON stores fractional probabilities; CSV uses percentages. Parent weights are sums of squared overlaps over all Ms components. They are not renormalized when parents are missing. Spin weights come from exact finite-Fock S² projectors, including spin partners outside the retained SOC states.
Each parent represents one scalar energy/spin subspace. Degenerate roots with
the same S remain one parent with rank multiplicity × (2S+1), so labels do
not change when an eigensolver rotates degenerate vectors.
scalar_state_ids and scalar_weights record the source-block decomposition.
absent_soc_basis_weight measures missing parent projector norm in the SOC
determinant basis. uncovered_weight measures each SOC state’s probability
outside the retained parents. Neither is silently discarded.
Grouping and term names#
Default grouping maximizes total raw assigned-parent weight subject to parent
rank capacities; uncovered probability competes as an unassigned option.
Groups are confident only when capacity is filled and every component exceeds
the minimum weight and dominates all alternatives. Other statuses are mixed,
incomplete, unobserved or unassigned. The status describes the grouping,
not an atomic LSJ certificate.
Spin is determined from a checked spin eigenproblem. Atomic LSJ or molecular
symmetry labels require an explicit ParentLabel(text, reference) passed to the
Python API; angular expectation values or an energy pattern alone do not
establish them.
Admission and resource limits#
Scalar inputs must use a single Ms determinant sector. Spin is resolved only
within energy blocks of full width at most --degeneracy-hartree. An
incomplete or spin-broken scalar block is rejected with a failed task rather
than given a false pure-spin label.
Some selected-CI spaces leave scalar roots spin-contaminated at the 1e-5 level;
the default --spin-tolerance 1e-7 then rejects them. A larger tolerance, such
as 1e-4, accepts that contamination explicitly and is recorded in
analysis.json; it is not a substitute for a spin-complete model space.
Vectors are loaded in memory; no dense determinant-pair Hamiltonian or spin
matrix is built. --max-determinants bounds spin completion, not total RAM.
The reader validates convergence, native catalog hashes and source agreement,
and rejects files changed while loading.
Python API#
from pyscf2mppt.analysis import read_heffso_properties
from pyscf2mppt.analysis.record import AnalysisOptions
from pyscf2mppt.analysis.runner import analyze_run
result = analyze_run("runs/ce", AnalysisOptions(spin_tolerance=1e-4))
print(result.directory, result.reused)
properties = read_heffso_properties("runs/ce/data/Ce_heffso_properties.h5")
print(properties.oscillator_strength)
For an external data producer, call
pyscf2mppt.analysis.parents.analysis.analyze_parents with two
CanonicalStates. Coefficients have shape (determinants, roots);
occupations are integer bitsets in ascending alpha-then-beta order. The
numerical API imports neither PySCF nor a plotting library.
Migration From Caspy#
Caspy was retired; its analysis moved into pyscf2mppt.
Caspy |
pyscf2mppt |
|---|---|
|
|
|
|
|
|
|
MPPT viewer level diagrams |
|
|
PNG plots and |
MPPT viewer charts |
|
|
Runs recorded with Caspy keep their caspy_* manifest roles; they remain
readable and archivable.
Interpretation And Limits#
The report does not assign atomic term symbols or certify multiplets.
An angular-commutator status
OPENcan reflect an incomplete retained state space; inspect the stored residuals and state span.Keep the original HDF5 files and logs with exported tables.