qml.devices.qubit.measure_with_samples¶
- measure_with_samples(measurements, state, shots, is_state_batched=False, rng=None, prng_key=None, mid_measurements=None)[source]¶
Returns the samples of the measurement process performed on the given state. This function assumes that the user-defined wire labels in the measurement process have already been mapped to integer wires used in the device.
- Parameters
measurements (List[Union[SampleMeasurement, ClassicalShadowMP, ShadowExpvalMP]]) – The sample measurements to perform
state (np.ndarray[complex]) – The state vector to sample from
shots (Shots) – The number of samples to take
is_state_batched (bool) – whether the state is batched or not
rng (Union[None, int, array_like[int], SeedSequence, BitGenerator, Generator]) – A seed-like parameter matching that of
seed
fornumpy.random.default_rng
. If no value is provided, a default RNG will be used.prng_key (Optional[jax.random.PRNGKey]) – An optional
jax.random.PRNGKey
. This is the key to the JAX pseudo random number generator. Only for simulation using JAX.mid_measurements (None, dict) – Dictionary of mid-circuit measurements
- Returns
Sample measurement results
- Return type
List[TensorLike[Any]]