qml.operation.convert_to_legacy_H¶
- convert_to_legacy_H(op)[source]¶
Converts arithmetic operators into a legacy
Hamiltonian
instance. Objects of any other type are returned directly.Arithmetic operators include
Prod
,Sum
andSProd
.Warning
Using legacy operator arithmetic is deprecated, and will be removed in PennyLane v0.40. For further details, see Updated Operators.
- Parameters
op (Operator) – The operator instance to convert.
- Returns
The operator as a
Hamiltonian
instance- Return type
code/api/pennylane.operation.convert_to_legacy_H
Download Python script
Download Notebook
View on GitHub