qml.devices.qutrit_mixed.sample_state

sample_state(state, shots, is_state_batched=False, wires=None, rng=None, prng_key=None, readout_errors=None)[source]

Returns a series of computational basis samples of a state.

Parameters
  • state (array[complex]) – A state vector to be sampled

  • shots (int) – The number of samples to take

  • is_state_batched (bool) – whether the state is batched or not

  • wires (Sequence[int]) – The wires to sample

  • rng (Union[None, int, array_like[int], SeedSequence, BitGenerator, Generator]) – A seed-like parameter matching that of seed for numpy.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.

  • readout_errors (List[Callable]) – List of channels to apply to each wire being measured

  • errors. (to simulate readout) –

Returns

Sample values of the shape (shots, num_wires)

Return type

ndarray[int]

Contents

Using PennyLane

Release news

Development

API

Internals