I need to calculate the negativity of a density matrix; in doing so on Qiskit I stuck on the problem of computing the partial transpose for a problem of compatibility.
Basically I extract my density matrix from a circuit via the Aer simulator in the following way:
circuit.append(SaveDensityMatrix(size, label = f'pho_%.1f' % (label)), [i for i in qubits])
aer_sim = Aer.get_backend('aer_simulator')
t_qc = transpile(circuit, aer_sim)
qobj = assemble(t_qc)
results = aer_sim.run(qobj, shots = 1).result()
counts = results.get_counts()
density_matrix = results.data()['pho_%.1f' % (i)]
the object resulting from this has the type :
qiskit_aer.backends.compatibility.DensityMatrix
How can I use the method partial_transpose
described here as qiskit.quantum_info.DensityMatrix.partial_transpose
?
https://qiskit.org/documentation/stubs/qiskit.quantum_info.DensityMatrix.partial_transpose.html