I want to calculate the 2nd Renyi entropy using the density matrix in Qiskit. To do this, I need to calculate the $Tr(\rho^2)$ for subsystem. The complete system consists of 12 qubits from which I want to choose a subsystem from two specific ones (for example, #3 and #5). I thought to use qiskit.quantum_info.Statevector
but if there are other methods I will be glad to hear from you.
Here is my quantum state:
num_qubits = 12
measureZZ = QuantumCircuit(num_qubits,num_qubits)
measureZZ.h(0)
measureZZ.h(1)
measureZZ.h(5)
measureZZ.h(6)
measureZZ.cx(0, 2)
measureZZ.cx(1, 3)
measureZZ.cx(5, 7)
measureZZ.cx(6, 8)
measureZZ.cx(0, 3)
measureZZ.cx(1, 4)
measureZZ.cx(5, 8)
measureZZ.cx(6, 9)
measureZZ.cx(2, 5)
measureZZ.cx(4, 6)
measureZZ.cx(7, 10)
measureZZ.cx(9, 11)