MatrixOperator¶

class
MatrixOperator
(matrix, basis=None, z2_symmetries=None, atol=1e12, name=None)[source]¶ Bases:
qiskit.aqua.operators.legacy.base_operator.LegacyBaseOperator
Operators relevant for quantum applications
Note
For grouped paulis representation, all operations will always convert it to paulis and then convert it back. (It might be a performance issue.)
 Parameters
matrix (numpy.ndarray or scipy.sparse.csr_matrix) – a 2D sparse matrix represents operator (using CSR format internally)
basis (list[tuple(object, [int])], optional) – the grouping basis, each element is a tuple composed of the basis and the indices to paulis which are belonged to that group. e.g., if tpb basis is used, the object will be a pauli. by default, the group is equal to nongrouping, each pauli is its own basis.
z2_symmetries (Z2Symmetries) – represent the Z2 symmetries
atol (float) – atol
name (str) – name
Methods
Eliminate the real and imagine part of coeff in each pauli by threshold.
Construct the circuits for evaluation.
Get a copy of self.
Use the executed result with operator to get the evaluated value.
 param quantum_state
quantum state
Carry out the eoh evolution for the operator under supplied specifications.
Check Operator is empty or not.
 returns
a formatted operator.
to op flow
Attributes

atol
¶ return atol

basis
¶ returns basis

dense_matrix
¶ Getter of matrix in dense matrix form.

dia_matrix
¶ diagonal matrix

matrix
¶ Getter of matrix.

name
¶ returns name

num_qubits
¶ number of qubits required for the operator.
 Returns
number of qubits
 Return type
int

z2_symmetries
¶ returns z2 symmetries