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:
VariationalStateVariational 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:
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 (
Sequence[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.
- 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¶
- neuralqx.vqs.mc.mc_state.expect module
- neuralqx.vqs.mc.mc_state.expect_chunked module
- neuralqx.vqs.mc.mc_state.expect_forces module
- neuralqx.vqs.mc.mc_state.expect_forces_chunked module
- neuralqx.vqs.mc.mc_state.expect_grad module
- neuralqx.vqs.mc.mc_state.expect_grad_chunked module
- neuralqx.vqs.mc.mc_state.multi_state module
- neuralqx.vqs.mc.mc_state.state module
- neuralqx.vqs.mc.mc_state.utils module