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

reused, nothing computed

Different options read by a task that can run

New analysis directory

Different options of a skipped task

reused

A run file was rewritten

New analysis directory

An output file was edited or deleted

New analysis directory

--force

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

parents

DIAGPT handoff, HEFFSO states

parents/

heffso_report

Shared HDF5, handoff, HEFFSO properties and logs

heffso/

magnetic

HEFFSO properties with magnetic data

magnetic/

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

--stage h1|h2

recorded

Scalar parent stage; default is the stage HEFFSO used.

--spin-tolerance

1e-7

Largest accepted spin residual of scalar blocks.

--minimum-weight

0.5

Parent weight that assigns a state to a group.

--minimum-margin

0

Required lead of that parent over the next one.

--degeneracy-hartree

1e-9

Width of one scalar energy block.

--max-determinants

250000

Bound on the spin-completed determinant basis.

--top

20

Strongest transitions listed in the summary.

--label-minimum-weight, --label-minimum-margin

0.10, 0.05

Orbital-label thresholds.

--force

off

Recompute even when an identical analysis exists.

--check

off

Only report whether a matching analysis exists.

--json

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

key

Identity used for reuse

key_options

Option names that entered the key

inputs

Role, run-relative path, SHA256, size and modification time

options

Every numerical option

software

Versions of pyscf2mppt, NumPy, SciPy and h5py

tasks

complete, skipped or failed, with messages

outputs

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

parent_analysis.json

Versioned mppt_parent_analysis_v1 result.

state_composition.csv

Every SOC state, parent percentage, uncovered percentage and exact spin-sector percentage.

parents.csv

Scalar parent catalog, S, rank/capacity and source roots.

terms.csv

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

caspy-parents --handoff … --soc …

pyscf2mppt analyze RUN_DIR

caspy-heffso-report --run-dir … --prefix …

pyscf2mppt analyze RUN_DIR

caspy-heffso-report … --magnetic

pyscf2mppt analyze RUN_DIR

analyze_mppt heffso.log

MPPT viewer level diagrams

from caspy import read_heffso_properties

from pyscf2mppt.analysis import read_heffso_properties

PNG plots and --spectrum-* options

MPPT viewer charts

caspy_parent_analysis_v1

mppt_parent_analysis_v1, same fields

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 OPEN can reflect an incomplete retained state space; inspect the stored residuals and state span.

  • Keep the original HDF5 files and logs with exported tables.