Hi all,
I want to know what is the best way to code the following in Qutip.
Step 1: Take a joint density matrix of 4 subsystems, say rho_{abcd} with dimensions N_a, N_b, N_c, and N_d, respectively.
For simplicity, lets take the following example:
import numpy as np
from qutip import *
Na, Nb, Nc, Nd = 10, 11, 12, 13
rho_a = coherent_dm(Na, np.sqrt(0.5))
rho_b = thermal_dm(Nb, 0.5, 'analytic')
rho_c = coherent_dm(Nc, np.sqrt(1.0))
rho_d = thermal_dm(Nd, 1.0, 'analytic')
rho_abcd = tensor(rho_a, rho_b, rho_c, rho_d)
Step 2: Perform the following operation <0_c; 0_d| \rho_{abcd} |0_c; 0_d>.
Here |0_c; 0_d> = |0_c> |0_d>, that is the tensor product of the vacua corresponding to subsystems c and d.
This operation projects the state to the vacua for subsystems c and d (if I understood correctly).
This should give a bipartite (unnormalized) state for the 'ab' subsystem of dimension [[Na, Nb],[Na, Nb]] and shape [Na*Nb, Na*Nb], in qutip notation.
I am unable to neatly write down the code for step 2 in qutip.
Thanks in advance,
Pradip