qml.capture.create_measurement_obs_primitive¶
- create_measurement_obs_primitive(measurement_type, name)[source]¶
Create a primitive corresponding to the input type where the abstract inputs are an operator.
Called by default when defining any class inheriting from
MeasurementProcess
, and is used to set theMeasurementProcesss._obs_primitive
property.- Parameters
measurement_type (type) – a subclass of
MeasurementProcess
name (str) – the preferred string name for the class. For example,
"expval"
."_obs"
is appended to this name for the name of the primitive.
- Returns
A new jax primitive.
None
is returned if jax is not available.- Return type
Optional[jax.core.Primitive]
code/api/pennylane.capture.create_measurement_obs_primitive
Download Python script
Download Notebook
View on GitHub