0
$\begingroup$

i have a pqc:

rot = QuantumCircuit(1)
params = ParameterVector('r', 1)
rot.h(0)
rot.ry(params[0], 0)

# entanglement block:
ent = QuantumCircuit(2)
ent.cz( 0, 1)
qc_nlocal = NLocal(num_qubits=10, rotation_blocks=rot,
                   entanglement_blocks=ent, entanglement='linear',
                   skip_final_rotation_layer=True, insert_barriers=True)

qc = QuantumCircuit(10)
qc.cz( 9, 0)
qc_nlocal.add_layer(other=qc)

and then link with the other circult(26bit),Corresponding to the first ten q

def pqc_with_SDES(theta):
    pqc = qc_nlocal.bind_parameters(dict(zip(qc_nlocal.parameters, theta))).decompose()
    pqc.barrier()
    p = '00101000'
    qc = SDES_circult(p)
    qc.compose(pqc, qubits=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], inplace=True, front=True)
    return qc

next,i get the density_matrix

qc = pqc_with_SDES(theta)
qc.save_density_matrix(qubits=[10, 11, 12, 13, 14, 15, 16, 17])
simulator = AerSimulator()
qc = transpile(qc, backend=simulator)
job = simulator.run(qc)
state = job.result().data()['density_matrix']

but,the Density matrix is not a pure state,it's a diagonal matrix, so i can't get the state vector from it,can i have other way to solve it?

$\endgroup$

1 Answer 1

1
$\begingroup$

A diagonal density matrix is either pure and has a single diagonal element, or is mixed. In your case, you said that it was mixed. Consider for instance the following density matrix: $$\rho=\begin{pmatrix}\frac14&0\\0&\frac34\end{pmatrix}$$ There is no statevector $|\psi\rangle$ such that $\rho=|\psi\rangle\!\langle\psi|$. Suppose I flip 2 (classical) coins, and if I get heads on both, I send you the $|0\rangle$. Otherwise, I send you the $|1\rangle$ state. The state you get at the end is described by the density matrix written above.

More generally, if a density matrix isn't pure, there is no way to get a statevector out of it. What you can do however, is to find statevectors to which you assign probabilities.

In your case, the statevectors are the basis states and the probabilities are the diagonal elements. For instance, if you have the following density matrix: $$\begin{pmatrix}\frac12&0&0&0\\0&\frac13&0&0\\0&0&\frac17&0\\0&0&0&\frac{1}{42}\end{pmatrix}$$ It can be described as a quantum state that is either in the state $|00\rangle$ with probability $\frac12$, in the state $|01\rangle$ with probability $\frac13$, in the state $|10\rangle$ with probability $\frac17$ or in the state $|11\rangle$ with probability $\frac{1}{42}$ (note that the probabilities sum to $1$).

This question might also interest you, as it explains the difference between pure states in superposition and mixed states.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.