Skip to content

Commit

Permalink
second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MoorishQubit committed Nov 6, 2023
1 parent b659fab commit c6cdae6
Show file tree
Hide file tree
Showing 30 changed files with 36 additions and 20 deletions.
File renamed without changes.
Binary file added data/fig1/fig1b_L=4.npz
Binary file not shown.
Binary file added data/fig1/fig1b_L=6.npz
Binary file not shown.
Binary file added data/fig1/fig1b_L=8.npz
Binary file not shown.
Binary file removed data/fig1b_L=4.npz
Binary file not shown.
Binary file removed data/fig1b_L=6.npz
Binary file not shown.
Binary file removed data/fig1b_L=8.npz
Binary file not shown.
Binary file added data/fig2/fig2c.npz
Binary file not shown.
Binary file added data/fig5/fig5a_L=10.npz
Binary file not shown.
Binary file added data/fig5/fig5a_L=4.npz
Binary file not shown.
Binary file added data/fig5/fig5a_L=6.npz
Binary file not shown.
Binary file added data/fig5/fig5a_L=8.npz
Binary file not shown.
Binary file added data/fig5/fig5b_L=10.npz
Binary file not shown.
Binary file added data/fig5/fig5b_L=6.npz
Binary file not shown.
Binary file added data/fig5/fig5c_U=0.npz
Binary file not shown.
Binary file added data/fig5/fig5c_U=10.npz
Binary file not shown.
Binary file added data/fig5/fig5c_U=2.npz
Binary file not shown.
Binary file added data/fig5/fig5c_U=4.npz
Binary file not shown.
Binary file added data/fig5/fig5d_U=0.npz
Binary file not shown.
Binary file added data/fig5/fig5d_U=10.npz
Binary file not shown.
Binary file added data/fig5/fig5d_U=2.npz
Binary file not shown.
Binary file added data/fig5/fig5d_U=6.npz
Binary file not shown.
Binary file modified figures/fig1b.pdf
Binary file not shown.
Binary file added figures/fig2c.pdf
Binary file not shown.
Binary file added src/__pycache__/concurrence.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/hamiltonian.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/teleportation.cpython-39.pyc
Binary file not shown.
9 changes: 6 additions & 3 deletions src/hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def fermi_hubbard(L:int, J:float, U:float, mu:float, w:float):
N_down = L//2 # number of fermions with spin down
basis = spinful_fermion_basis_1d(L,Nf=(N_up,N_down))

hop_right=[[+J*(1+w*(-1)**(i+1)),i,(i+1)] for i in range(L-1)]
hop_right=[[J*(1+w*(-1)**(i+1)),i,(i+1)] for i in range(L-1)]
hop_left= [[-(J*(1+w*(-1)**(i+1))),i,(i+1)] for i in range(L-1)]
pot=[[-mu,i] for i in range(L-1)]
interact=[[U,i,i] for i in range(L)]
Expand All @@ -29,10 +29,13 @@ def fermi_hubbard(L:int, J:float, U:float, mu:float, w:float):
no_checks = dict(check_pcon=False,check_symm=False,check_herm=False)
H=hamiltonian(static,dynamic,basis=basis,**no_checks) #dtype=np.float64,
E,V=H.eigsh(k=1,which='SA',maxiter=1E10)
rdm=basis.partial_trace(V,sub_sys_A=([0,L-1],[0,L-1]),return_rdm="A")#,enforce_pure=False,sparse=False,subsys_ordering=True)
rdm2= rdm[[15,13,7,5,14,12,6,4,11,9,3,1,10,8,2,0]]
rdm1=Qobj(np.abs(basis.partial_trace(V,sub_sys_A=([0,L-1],[0,L-1]),return_rdm="A",enforce_pure=False,sparse=False,subsys_ordering=True)))
rdm2= rdm1[[15,13,7,5,14,12,6,4,11,9,3,1,10,8,2,0]]
rdm3= Qobj(rdm2[:,[15,13,7,5,14,12,6,4,11,9,3,1,10,8,2,0]])
rdm3.dims=[[4,4],[4,4]]
#return entropy_vn(rdm1,2) #-np.matrix.trace(rdm*la.logm(rdm)/la.logm(np.matrix([[2]])))
#return basis.partial_trace(V,sub_sys_A=([0,1],[0,1]),return_rdm="A")
#return basis.ent_entropy(V,sub_sys_A=([0],[0]),return_rdm="A")['Sent_A']
return rdm3


Expand Down
44 changes: 29 additions & 15 deletions src/plots.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from hamiltonian import *
from teleportation import *
from concurrence import *
from multiprocessing import Pool
pool = Pool(processes = 20)
import multiprocessing
from functools import partial
import matplotlib.pyplot as plt
plt.rcParams.update({
Expand All @@ -13,16 +12,31 @@
plt.rcParams['mathtext.fontset'] = 'stix'
plt.tick_params(axis='both', which='major', labelsize=20)

u=np.linspace(0.0,20,50)
L=6
params_list = [(L,1.0,0.0,0.0,y) for y in u]
with Pool(processes=20) as pool:
b=pool.map(teleportation,params_list)
np.savez("/home/zakaria/QT_Fermi-Hubbard/data/fig1b_L=%s"%L,b)
plt.plot(u,b,label=r'$L=%s$'%L)
plt.ylabel(r'$\mathcal{F}(1,L)$',fontsize=20)
plt.xlabel(r'$U$',fontsize=20)
plt.legend(fontsize=20)
plt.tick_params(axis='both', which='major', labelsize=20)
plt.tight_layout()
plt.savefig('/home/zakaria/QT_Fermi-Hubbard/figures/fig1b.pdf')
b=[]
if __name__ == '__main__':
pool = multiprocessing.Pool(20)
J=1.0
mu=0.0
u=np.linspace(0,20,100)
for x in [8,10]:
func = partial(teleportation,x,J,mu,0)
b=pool.map(func,u)
np.savez("/home/zakaria/QT_Fermi-Hubbard/data/fig1b_L=%s"%x,b)
plt.plot(u,b,label=r'$L=%s$'%x)
plt.ylabel(r'$\mathcal{F}(1,L)$',fontsize=20)
plt.xlabel(r'$U$',fontsize=20)
plt.legend(fontsize=20)
plt.tick_params(axis='both', which='major', labelsize=18)
plt.tight_layout()
plt.savefig('figures/fig1b.pdf')

# data=np.load("/home/zakaria/QT_Fermi-Hubbard/data/fig2c.npz")['arr_0']
# w=np.linspace(0,0.99,50)
# plt.plot(w,data)
# plt.ylabel(r'$P_i$',fontsize=20)
# plt.xlabel(r'$\delta$',fontsize=20)
# plt.tick_params(axis='both', which='major', labelsize=15)
# #plt.legend(fontsize=15)
# plt.tight_layout()
# plt.savefig('figures/fig2c.pdf')
# plt.show()
3 changes: 1 addition & 2 deletions src/teleportation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ def u(n,m):
op=sum(np.exp(2*np.pi*1j*k*n/d)*(fock(d,k)*fock(d,(k+m)%d).dag()) for k in range(d))
return op

def teleportation(args):
L,J,mu,w,U=args
def teleportation(L,J,mu,w,U):
d=4
psi=sum(tensor(fock(d,r),fock(d,r)) for r in range(0,d))/np.sqrt(d) # maximaly entangled state \psi^+
r_in=ket2dm(sum(fock(d,r) for r in range(d)).unit()) # the state to teleporte (density matrix of 1 ququart)
Expand Down

0 comments on commit c6cdae6

Please sign in to comment.