qml.operation.disable_new_opmath¶
-
disable_new_opmath
()[source]¶ Change dunder methods to return Hamiltonians and Tensors instead of arithmetic operators
Example
>>> qml.operation.active_new_opmath() True >>> type(qml.PauliX(0) @ qml.PauliZ(1)) <class 'pennylane.ops.op_math.prod.Prod'> >>> qml.operation.disable_new_opmath() >>> type(qml.PauliX(0) @ qml.PauliZ(1)) <class 'pennylane.operation.Tensor'>
code/api/pennylane.operation.disable_new_opmath
Download Python script
Download Notebook
View on GitHub