Пример #1
0
Created on Sat Mar 10 22:49:48 2018

@author: amit
"""

import basisgeneration as bg
import progbar as pb
import numpy as np
import matplotlib.pyplot as plt

N = 6
n = 3
# spin = (0.5 * n) % 1
spin = 0.5 * n

uobasis = bg.createbasis(N, n, spin)

#i = 0
#for state in uobasis:
#    print(i, '\t', state.getstate())
#    i += 1
#
#print("*" * 80)

basis = []

i = 0
for n_l in range(n + 1)[::-1]:
    j = 0
    spins = 0.5 * np.array(list(range(-n_l, n_l + 1)))
    for Sz_l in spins:
Пример #2
0
    return omega + I * eta


def G(H, omega):
    return np.linalg.inv(
        z(omega) * np.eye(np.shape(H)[0], dtype=np.complex) - H)


def tmm(A, B, C):
    return np.dot(A, np.dot(B, C))


# Generate required sectors
sectorlist = []

basis = bg.createbasis(N, n, S_z)

for l_n in range(0, n + 1):
    l_Sz = 0.5 * l_n
    sector = bg.createsubbasis(basis, l_n, l_Sz)
    sectorlist.append(sector)

# for sector in sectorlist:
#     for s in sector:
#         print(s.getstate(), '\t', getunn(s))
#     print('*'*50)

b1 = sectorlist[1]

H_list = []
Пример #3
0
import basisgeneration as bg
import progbar as pb

from math import factorial

os.system('clear')

N = 4
n = 2
Sz = 1

U = 0
t = 1
tprime = t

b = bg.createbasis(N, n, Sz)

i = 0
for state in b:
    print(i, state.getstate())
    i += 1


def mel(state1, state2):

    # calculate the hopping to right
    term = 0
    for sigma in [-1, 1]:
        for i in range(N):
            for j in range(N):
                if (i != j and abs(i - j) == 1):