from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)

statevector = Statevector(qc)
print(statevector.data)

import numpy as np
from qiskit.quantum_info import Statevector

statevector = Statevector([1, 0, 0, 1] / np.sqrt(2))
print(statevector.data)

from qiskit.quantum_info import Statevector

statevector = Statevector.from_label('01-')
print(statevector.data)

from qiskit.quantum_info import Statevector

statevector = Statevector.from_label('+-')
print(statevector.data)

statevector.draw("qsphere")

print(statevector.probabilities())

print(statevector.sample_counts(1000))

from qiskit import QuantumCircuit
from qiskit.quantum_info import DensityMatrix

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.z(1)

dens_mat = DensityMatrix(qc)
print(dens_mat.data)

from qiskit.quantum_info import DensityMatrix, \
                                          Operator

dens_mat = 0.5*DensityMatrix.from_label('11') + \
      0.5*DensityMatrix.from_label('+0')
print(dens_mat.data)

tt_op = Operator.from_label('TT')
dens_mat = dens_mat.evolve(tt_op)
dens_mat.draw('city')

print(dens_mat.probabilities())

print(dens_mat.sample_counts(1000))