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
.- 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