neuralqx.vqs.mc.mc_state package

class MCState(sampler, model=None, *, n_samples=None, n_samples_per_rank=None, n_discard_per_chain=None, chunk_size=None, variables=None, init_fun=None, apply_fun=None, seed=None, sampler_seed=None, mutable=False, training_kwargs={}, is_group_averaged=False)

Bases: VariationalState

Variational State for a Variational Neural Quantum State.

The state is sampled according to the provided sampler.

expect(O)

Estimates the quantum expectation value for a given operator \(O\) or generic observable. In the case of a pure state \(\psi\) and an operator, this is \(\langle O\rangle= \langle \Psi|O|\Psi\rangle/\langle\Psi|\Psi\rangle\) otherwise for a mixed state \(\rho\), this is \(\langle O\rangle= \textrm{Tr}[\rho \hat{O}]/\textrm{Tr}[\rho]\).

Parameters:

O (Union[AbstractOperator, Sequence[AbstractOperator]]) – the operator or observable for which to compute the expectation value.

Return type:

Stats

Returns:

An estimation of the quantum expectation value \(\langle O\rangle\).

class MultiMCState(states)

Bases: object

Container for multiple MCState objects 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 (Sequence[MCState]) – List of Monte Carlo variational states to manage.

Raises:

ValueError – If states is empty or if any pair of states has a different Hilbert space.

expect(O)

Compute expectation values of an operator/observable on all states.

This is a convenience wrapper around calling state.expect(O) on each contained state.

Parameters:

O – Operator or observable to evaluate.

Return type:

list[Stats]

Returns:

List of statistics objects, one per state, as returned by each state’s expect.

Submodules