I want to prepare some mixed states regarding a project that I am doing, however, I am not sure how to do that using IBM Q. Experience circuit composer. Basically, I am looking to prepare maximally mixed and non-maximally mixed quantum states. I have attached the circuit which I could come up with.
A mixed state is described by a density matrix consisting of a sum of projection operators corresponding to the possible states of the system, weighted by the classical probabilities of being in each state. The register of qubits in a quantum computer is always a state vector. A density matrix can be constructed by taking a large number of shots of a system and averaging together. Unfortunately, the measurements are only in the computational basis, so reconstructing the full density matrix requires additional work to get all of the components of the density matrix. This is known as tomography and usually scales exponentially with the number of qubits, and is thus computationally very expensive. This can however be done on simulators for reasonable sized circuits.
An example (only works on master branch at the moment):
from qiskit import * from qiskit.quantum_info.states.utils import partial_trace qc = QuantumCircuit(2, 2) qc.h(0) qc.cx(0, 1) sim = Aer.get_backend('statevector_simulator') res = execute(qc, sim, shots=1).result() state_vec = res.get_statevector() # Remove qubit zero partial_trace(state_vec, )