neuralqx.experimental.vqs.mc.mc_state package¶
- class MultiMCState(states)¶
Bases:
objectContainer for multiple
MCStateobjects with overlap diagnostics.This class groups several independently sampled variational Monte Carlo states that share the same Hilbert space, and provides tools to compute pairwise overlap measures such as the fidelity matrix and derived quantities (overlap magnitude and orthogonality).
All contained states must act on the same Hilbert space, a mismatch raises
ValueError.Parameters are managed per-state, no parameters are shared unless you explicitly tie them outside of this container.
- Parameters:
states (
list[MCState]) – List of Monte Carlo variational states to manage.- Raises:
ValueError – If
statesis empty or if any pair of states has a different Hilbert space.
- class STMultiMCState(states, *, canonical_state=0, sync_model_state=False)¶
Bases:
objectA Container for multiple head-specific
MCStateobjects that share one parameter pytree.This class is intentionally small and driver-oriented. It assumes you already created one
MCStateper head (typically fromSTMHHeadViewmodels) with identical parameter tree structure, and then synchronizes their parameters so they act as different views of the same ST-MH model.The current
MultiMCStatereturns a list of parameter pytrees (one per state), which is exactly right for MT-MH (independent networks) but is not the ST-MH (shared trunk + heads in one joint parameter set) Ansatz. Here we expose a single parameter pytree to the base VMC driver so optimizer state and updates are computed only once.- Parameters:
states (
list[MCState]) – List of head-specificMCStateobjects. They must share the same Hilbert space and the same parameter-tree structure.canonical_state (
int) – Index of the state whose parameters are treated as the canonical source of truth.sync_model_state (
bool) – IfTrue,broadcast_from_canonical()also copiesmodel_statefrom the canonical state to all other states. Keep thisFalseunless you really need mutable model-state collections and understand the implications.