qml.capture.create_operator_primitive¶
- create_operator_primitive(operator_type)[source]¶
Create a primitive corresponding to an operator type.
Called when defining any
Operator
subclass, and is used to set theOperator._primitive
class property.- Parameters
operator_type (type) – a subclass of qml.operation.Operator
- Returns
A new jax primitive with the same name as the operator subclass.
None
is returned if jax is not available.- Return type
Optional[jax.core.Primitive]
code/api/pennylane.capture.create_operator_primitive
Download Python script
Download Notebook
View on GitHub