qml.capture.primitives.AbstractMeasurement¶
- class AbstractMeasurement(abstract_eval, n_wires=None, has_eigvals=False)¶
Bases:
AbstractValueAn abstract measurement.
- Parameters:
abstract_eval (Callable) – See
_abstract_eval(). A function ofn_wires,has_eigvals,num_device_wiresandshotsthat 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.
Attributes
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.
Methods
abstract_eval(num_device_wires, shots)Calculate the shape and dtype for an evaluation with specified number of device wires and shots.
join(other)str_short([short_dtypes])update(**kwargs)update_weak_type(weak_type)- 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)¶
- normalize()¶
- str_short(short_dtypes=False)¶
- strip_weak_type()¶
- to_tangent_aval()¶
- update(**kwargs)¶
- update_weak_type(weak_type)¶