def long_time_entropy(phi2, t): #create MPs def A_up(theta, phi): return np.array([[0, 1j * np.exp(-1j * phi)], [0, 0]]) def A_down(theta, phi): return np.array([[np.cos(theta), 0], [np.sin(theta), 0]]) theta1 = 0.9 theta2 = 2.985 phi1 = 0.188 # phi2 = 1.3 A_ups = dict() A_downs = dict() A_ups[0] = A_up(theta1, phi1) A_ups[1] = A_up(theta2, phi2) A_downs[0] = A_down(theta1, phi1) A_downs[1] = A_down(theta2, phi2) tensors = dict() K = 2 for n in range(0, K): tensors[n] = np.zeros( (2, np.size(A_ups[0], axis=0), np.size(A_ups[0], axis=1)), dtype=complex) tensors[0][0] = A_downs[0] tensors[0][1] = A_ups[0] tensors[1][0] = A_downs[1] tensors[1][1] = A_ups[1] from MPS import periodic_MPS psi = periodic_MPS(N) for n in range(0, N, 1): psi.set_entry(n, tensors[int(n % 2)], "both") #convert MPS -> wf array wf = np.zeros(system.dim, dtype=complex) for n in range(0, np.size(system.basis_refs, axis=0)): bits = system.basis[n] coef = psi.node[0].tensor[bits[0]] for m in range(1, np.size(bits, axis=0)): coef = np.dot(coef, psi.node[m].tensor[bits[m]]) coef = np.trace(coef) wf[n] = coef psi_energy = np.dot(np.conj(np.transpose(u)), wf) evolved_state = time_evolve_state(psi_energy, e, t) evolved_state_comp = np.dot(np.conj(np.transpose(u)), evolved_state) S = ent.eval(evolved_state_comp) print(phi2, S) return S
def mps_uc3_angles2wf(thetas, system): def A_up(theta, phi): return np.array([[0, 1j * np.exp(-1j * phi)], [0, 0]]) def A_down(theta, phi): return np.array([[np.cos(theta), 0], [np.sin(theta), 0]]) #create MPs theta3 = thetas[2] theta2 = thetas[1] theta1 = thetas[0] A_ups = dict() A_downs = dict() A_ups[0] = A_up(theta1, 0) A_ups[1] = A_up(theta2, 0) A_ups[2] = A_up(theta3, 0) A_downs[0] = A_down(theta1, 0) A_downs[1] = A_down(theta2, 0) A_downs[2] = A_down(theta3, 0) tensors = dict() K = 3 for n in range(0, K): tensors[n] = np.zeros( (2, np.size(A_ups[0], axis=0), np.size(A_ups[0], axis=1)), dtype=complex) tensors[0][0] = A_downs[0] tensors[0][1] = A_ups[0] tensors[1][0] = A_downs[1] tensors[1][1] = A_ups[1] tensors[2][0] = A_downs[2] tensors[2][1] = A_ups[2] from MPS import periodic_MPS psi = periodic_MPS(system.N) for n in range(0, system.N, 1): psi.set_entry(n, tensors[int(n % 3)], "both") wf = np.zeros(system.dim, dtype=complex) for n in range(0, np.size(system.basis_refs, axis=0)): bits = system.basis[n] coef = psi.node[0].tensor[bits[0]] for m in range(1, np.size(bits, axis=0)): coef = np.dot(coef, psi.node[m].tensor[bits[m]]) coef = np.trace(coef) wf[n] = coef return wf
def TT_wf(theta1, phi1, theta2, phi2): def A_up(theta, phi): return np.array([[0, 1j * np.exp(-1j * phi)], [0, 0]]) def A_down(theta, phi): return np.array([[np.cos(theta), 0], [np.sin(theta), 0]]) A_ups = dict() A_downs = dict() A_ups[0] = A_up(theta1, phi1) A_ups[1] = A_up(theta2, phi2) A_downs[0] = A_down(theta1, phi1) A_downs[1] = A_down(theta2, phi2) tensors = dict() K = 2 for n in range(0, K): tensors[n] = np.zeros( (2, np.size(A_ups[0], axis=0), np.size(A_ups[0], axis=1)), dtype=complex) tensors[0][0] = A_downs[0] tensors[0][1] = A_ups[0] tensors[1][0] = A_downs[1] tensors[1][1] = A_ups[1] # tensors[2][0] = A_downs[2] # tensors[2][1] = A_ups[2] from MPS import periodic_MPS psi = periodic_MPS(N) for n in range(0, N, 1): psi.set_entry(n, tensors[int(n % 2)], "both") #convert MPS -> wf array wf = np.zeros(system.dim, dtype=complex) for n in range(0, np.size(system.basis_refs, axis=0)): bits = system.basis[n] coef = psi.node[0].tensor[bits[0]] for m in range(1, np.size(bits, axis=0)): coef = np.dot(coef, psi.node[m].tensor[bits[m]]) coef = np.trace(coef) wf[n] = coef return wf
tensors = dict() K = 3 for n in range(0,K): tensors[n] = np.zeros((2,np.size(A_ups[0],axis=0),np.size(A_ups[0],axis=1)),dtype=complex) tensors[0][0] = A_downs[0] tensors[0][1] = A_ups[0] tensors[1][0] = A_downs[1] tensors[1][1] = A_ups[1] tensors[2][0] = A_downs[2] tensors[2][1] = A_ups[2] from MPS import periodic_MPS psi = periodic_MPS(N) for n in range(0,N,1): psi.set_entry(n,tensors[int(n%3)],"both") #convert MPS -> wf array system = unlocking_System([0],"periodic",d,N) system.gen_basis() wf = np.zeros(system.dim,dtype=complex) for n in range(0,np.size(system.basis_refs,axis=0)): bits = system.basis[n] coef = psi.node[0].tensor[bits[0]] for m in range(1,np.size(bits,axis=0)): coef = np.dot(coef,psi.node[m].tensor[bits[m]]) coef = np.trace(coef) wf[n] = coef np.save("z3,entangled_MPS_coef,"+str(system.N),wf)