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?