- abstract OperatorBase.to_legacy_op(massive=False)¶
Attempt to return the Legacy Operator representation of the Operator. If self is a
PauliOps, will attempt to convert to
WeightedPauliOperator, and otherwise will simply convert to
MatrixOpand then to
MatrixOperator. The Legacy Operators cannot represent
ListOps(meaning not one of the
ListOpsubclasses), so an error will be thrown if this method is called on such an Operator. Also, Legacy Operators cannot represent unbound Parameter coeffs, so an error will be thrown if any are present in self.
Warn if more than 16 qubits to force having to set
massive=Trueif such a large vector is desired.
- Return type
LegacyBaseOperatorrepresenting this Operator.
TypeError -- self is an Operator which cannot be represented by a
LegacyBaseOperator, such as
StateFn, proper (non-subclass)
ListOp, or an Operator with an unbound coeff Parameter.