netket_foundation.vqs.samples_with_probability

netket_foundation.vqs.samples_with_probability#

netket_foundation.vqs.samples_with_probability(state)[source]#

Return the reference SamplesWithProb of state.

The samples and log-density log p_ref = machine_pow * log|psi_ref| are returned as (sharded) JAX arrays — they are not gathered to a single process. The sampling power is read from the state and folded into log_probs, so the bundle is self-contained (the IS weights only need the density values).

When the state samples a joint physical ParameterSpace space (a FoundationalQuantumState), the stored .samples carry the per-replica parameter columns. The log-density is evaluated on those joint samples (so each row uses its own replica parameters), but only the physical columns are kept in the bundle — that is what the physical target model in an ISState consumes. For a plain MCState the samples are already physical and are used as-is.

Return type:

SamplesWithProb