hybridlane.devices.default_hybrid.sampled

Functions

measure_with_shots(measurements, state, shots, ...[, ...])

measure_with_diagonalizing_gates(mp, state, shots, ...)

measure_hamiltonian(mp, state, shots, is_state_batched)

sample_state(state, shots, is_state_batched[, wires, ...])

Sample basis states from the given state

Module Contents

hybridlane.devices.default_hybrid.sampled.measure_with_shots(measurements, state, shots, is_state_batched, rng=None, prng_key=None, wire_map=None, mid_measurements=None)[source]
Parameters:
  • measurements (Sequence[SampleMeasurement])

  • state (pennylane.typing.TensorLike)

  • shots (Shots)

  • is_state_batched (bool)

  • rng (Any | None)

  • prng_key (Array | None)

  • wire_map (dict | None)

  • mid_measurements (dict | None)

Return type:

list[pennylane.typing.TensorLike]

hybridlane.devices.default_hybrid.sampled.measure_with_diagonalizing_gates(mp, state, shots, is_state_batched, rng=None, prng_key=None, wire_map=None)[source]
Parameters:
  • mp (SampleMeasurement)

  • state (pennylane.typing.TensorLike)

  • shots (Shots)

  • is_state_batched (bool)

  • rng (Any | None)

  • prng_key (Array | None)

  • wire_map (dict | None)

Return type:

list[pennylane.typing.TensorLike]

hybridlane.devices.default_hybrid.sampled.measure_hamiltonian(mp, state, shots, is_state_batched, rng=None, prng_key=None, wire_map=None)[source]
Parameters:
  • mp (ExpectationMP)

  • state (pennylane.typing.TensorLike)

  • shots (Shots)

  • is_state_batched (bool)

  • rng (Any | None)

  • prng_key (Array | None)

  • wire_map (dict | None)

Return type:

list[pennylane.typing.TensorLike]

hybridlane.devices.default_hybrid.sampled.sample_state(state, shots, is_state_batched, wires=None, rng=None, prng_key=None)[source]

Sample basis states from the given state

This returns an array of shape (B, shots, num_wires) if the state is batched, or (shots, num_wires) if the state is not batched.

Parameters:
  • state (pennylane.typing.TensorLike)

  • shots (Shots)

  • is_state_batched (bool)

  • wires (Wires | None)

  • rng (Any | None)

  • prng_key (Array | None)

Return type:

pennylane.typing.TensorLike