from qiskit import QuantumCircuit
from qiskit.quantum_info import Operator
 
qc = QuantumCircuit(2)
qc.id(0)
qc.x(1)
op_XI = Operator(qc)
print(op_XI.data)

from qiskit.quantum_info import Operator

op_XI = Operator([[0, 0, 1, 0],
                  [0, 0, 0, 1],
                  [1, 0, 0, 0],
                  [0, 1, 0, 0]])
print(op_XI.data)

from qiskit.quantum_info import Operator, Pauli
 
op_XI = Operator(Pauli('XI'))
print(op_XI.data)

from qiskit.quantum_info import Operator
from qiskit.circuit.library.standard_gates \
                            import CPhaseGate
import numpy as np

op_CP = Operator(CPhaseGate(np.pi / 4))
print(op_CP.data)

from qiskit.quantum_info import Pauli

pauli_piXZ = Pauli('-XZ')
print(pauli_piXZ.to_matrix())

from qiskit import QuantumCircuit
from qiskit.quantum_info import Pauli

qc = QuantumCircuit(2)
qc.z(0)
qc.x(1)

pauli_XZ = Pauli(qc)
print(pauli_XZ.equiv(Pauli('-XZ')))