Operator
- class Operator(operator)
Represent an operator.
Initialize an instance of the
Operator
class.- Parameters:
operator (
ndarray
|Array
|str
) –Must be
ndarray|Array
: The operator as a matrix itself.str
: Pauli bitstring (sequence of'I'
,'X'
,'Y'
,'Z'
).
Methods
expectation_value
(state)Return the expectation value of the operator with respect to the state.
Attributes
Matrix representation of the operator.
Name of the operator.