Operator¶
-
class
Operator
(data, input_dims=None, output_dims=None)[source]¶ Bases:
qiskit.quantum_info.operators.linear_op.LinearOp
Matrix operator class
This represents a matrix operator \(M\) that will
evolve()
aStatevector
\(|\psi\rangle\) by matrix-vector multiplication\[|\psi\rangle \mapsto M|\psi\rangle,\]and will
evolve()
aDensityMatrix
\(\rho\) by left and right multiplication\[\rho \mapsto M \rho M^\dagger.\]Initialize an operator object.
- Parameters
(QuantumCircuit or (data) – Instruction or BaseOperator or matrix): data to initialize operator.
input_dims (tuple) – the input subsystem dimensions. [Default: None]
output_dims (tuple) – the output subsystem dimensions. [Default: None]
- Raises
QiskitError – if input data cannot be initialized as an operator.
- Additional Information:
If the input or output dimensions are None, they will be automatically determined from the input data. If the input data is a Numpy array of shape (2**N, 2**N) qubit systems will be used. If the input operator is not an N-qubit operator, it will assign a single subsystem with dimension specified by the shape of the input.
Methods
Return the adjoint of the Operator.
Return the operator composition with another Operator.
Return the conjugate of the Operator.
Make a deep copy of current operator.
Return the right multiplied operator self * other.
Return True if operators are equivalent up to global phase.
Return the reverse-order tensor product with another Operator.
Return a tensor product of single-qubit operators.
Return tuple of input dimension for specified subsystems.
Return True if operator is a unitary matrix.
Return tuple of output dimension for specified subsystems.
Return the matrix power of the operator.
Return a shallow copy with reshaped input and output subsystem dimensions.
Return an Operator with reversed subsystem ordering.
Return the tensor product with another Operator.
Convert to a UnitaryGate instruction.
Convert operator to matrix operator class
Return the transpose of the Operator.
Attributes
-
atol
= 1e-08¶
-
data
¶ Return data.
-
dim
¶ Return tuple (input_shape, output_shape).
-
num_qubits
¶ Return the number of qubits if a N-qubit operator or None otherwise.
-
qargs
¶ Return the qargs for the operator.
-
rtol
= 1e-05¶
-
settings
¶ Return operator settings.