qml.capture.primitives.AbstractMeasurement

class AbstractMeasurement(abstract_eval, n_wires=None, has_eigvals=False)

Bases: jax._src.core.AbstractValue

An abstract measurement.

Parameters
  • abstract_eval (Callable) – See _abstract_eval(). A function of n_wires, has_eigvals, num_device_wires and shots that returns a shape and numeric type.

  • n_wires=None (Optional[int]) – the number of wires

  • has_eigvals=False (bool) – Whether or not the measurement contains eigenvalues in a wires+eigvals diagonal representation.

n_wires

The number of wires for a wire based measurement.

n_wires

The number of wires for a wire based measurement.

Options are: * None: The measurement is observable based or single mcm based * 0: The measurement is broadcasted across all available devices wires * int>0: A wire or mcm based measurement with specified wires or mid circuit measurements.

abstract_eval(num_device_wires, shots)

Calculate the shape and dtype for an evaluation with specified number of device wires and shots.

at_least_vspace()

join(other)

str_short([short_dtypes])

strip_named_shape()

strip_weak_type()

update(**kwargs)

abstract_eval(num_device_wires, shots)

Calculate the shape and dtype for an evaluation with specified number of device wires and shots.

at_least_vspace()
join(other)
str_short(short_dtypes=False)
strip_named_shape()
strip_weak_type()
update(**kwargs)