Skip to content

Commit

Permalink
make input consistent with CPC paper data
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakoff committed Dec 9, 2017
1 parent b010087 commit 6160d0a
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
72 changes: 72 additions & 0 deletions input/cobalt-adatom/generate_cobalt_adatom_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env python

import h5py
import numpy as np

# We use pytriqs package for coulomb matrix calculation
import pytriqs.operators.util as U_matrix


# Coulomb matrix
U = np.real(U_matrix.U_matrix(2, U_int=6.6, J_hund=0.9, basis='cubic'))
# Chemical potential
xmu = 44.44

# Impurity energies
Eps0 = np.array([[-0.70,-0.70], [-0.8,-0.8], [-0.50,-0.50], [-0.8,-0.8], [-0.70,-0.70] ])
# Hybridization between impurity and bath
Vk = [ np.array([ [0.56434,0.56434],[0.68392,0.68392],[0.29519,0.29519]]),
np.array([ [0.81892,0.81892],[0.99136,0.99136]]),
np.array([ [0.77347,0.77347],[0.79785,0.79785]]),
np.array([ [0.81892,0.81892],[0.99136,0.99136]]),
np.array([ [0.56434,0.56434],[0.68392,0.68392],[0.29519,0.29519]]) ]
# Bath energies
Epsk = [ np.array([ [-2.37325, -2.37325],[-0.87328,-0.87328], [2.01265,2.01265]]),
np.array([ [-3.15496,-3.15496],[-1.69066,-1.69066] ]),
np.array([ [-5.59842,-5.59842],[-2.95325,-2.95325]]),
np.array([ [-3.15496,-3.15496],[-1.69066,-1.69066]]),
np.array([ [-2.37325, -2.37325],[-0.87328,-0.87328], [2.01265,2.01265]] ) ]

# Total number of fermionic orbitals
Ns = 17
# Number of impurity orbitals
ml = 5

# Interorbital hoppings
t0 = [ np.array([[0, 0]]*ml),
np.array([[0, 0]]*ml),
np.array([[0, 0]]*ml),
np.array([[0, 0]]*ml),
np.array([[0, 0]]*ml) ]

# (n_up, n_down) symmerty sectors
sectors = np.array([[12,15],[15,12],[14,13],[13,14],[13,15],[14,14],[15,13],])

# open data file
data = h5py.File("input.h5", "w");
# Inverse temperature
#beta = data.create_dataset("BETA", shape=(), dtype='f', data=10.0)

hop_g = data.create_group("sectors")
hop_g.create_dataset("values", data=sectors)

bath = data.create_group("Bath")

for i in range(ml):
if(Epsk[i].shape != Vk[i].shape):
raise "Incorrect shape for Hybridisation and Epsk"
Epsk_g = bath.create_group("Epsk_" + str(i))
Epsk_g.create_dataset("values", shape=(len(Epsk[i]),2,), data=Epsk[i], dtype=np.float)
Vk_g = bath.create_group("Vk_" + str(i))
Vk_g.create_dataset("values", data=np.array(Vk[i]), dtype=np.float)
t0_g = data.create_group("t0_" + str(i))
t0_g.create_dataset("values", data=np.array(t0[i]), dtype=np.float)

hop_g = data.create_group("Eps0")
hop_g.create_dataset("values", data=Eps0)

int_g = data.create_group("interaction")
int_ds = int_g.create_dataset("values", shape=(ml,ml,ml,ml,), data=U)

int_ds = data.create_dataset("mu", shape=(), data=xmu)

Binary file added input/cobalt-adatom/input.h5
Binary file not shown.
58 changes: 58 additions & 0 deletions input/hubbard-16site/generate_16site_plaquette_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env python

import h5py
import numpy as np

U = np.array([6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0])
xmu = np.array([0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54])

t = -1.0;
tp = 0.3;

sectors = np.array([[6,6]])


Nrows = 4;
Ncols = 4;

tm = np.zeros((Nrows*Ncols, Nrows*Ncols));

for row in range(0, Nrows):
for col in range(0, Ncols):
i = row * Ncols + col;
# Horizontal hopping with period.
j = row * Ncols + (col + 1)%Ncols;
tm[i, j] = -t;
tm[j, i] = -t;
# Vertical hopping with period.
j = ((row + 1)%Nrows) * Ncols + col;
tm[i, j] = -t;
tm[j, i] = -t;
# Diagonal (\) hopping with period.
j = ((row + 1)%Nrows) * Ncols + (col + 1)%Ncols;
tm[i, j] = -tp;
tm[j, i] = -tp;
# Diagonal (/) hopping with period.
j = ((row + 1)%Nrows) * Ncols + (col - 1)%Ncols;
tm[i, j] = -tp;
tm[j, i] = -tp;

print "bandwidth: %f" % (np.amax(np.linalg.eig(tm)[0]) - np.amin(np.linalg.eig(tm)[0]));


Ns = len(U)

data = h5py.File("input.h5", "w");

hop_g = data.create_group("sectors")
hop_g.create_dataset("values", data=sectors)


hop_g = data.create_group("hopping")
hop_g.create_dataset("values", data=tm)

int_g = data.create_group("interaction")
int_ds = int_g.create_dataset("values", shape=(Ns,), data=U)

int_g = data.create_group("chemical_potential")
int_ds = int_g.create_dataset("values", shape=(Ns,), data=xmu)

0 comments on commit 6160d0a

Please sign in to comment.