Exemple #1
0
# Real space lattice vectors
a = bandcalc.generate_reciprocal_lattice_basis(b)

# Reciprocal moire lattice vectors
rec_m = b - bandcalc.rotate_lattice(b, angle)

# Real space moire lattice vectors
m = bandcalc.generate_reciprocal_lattice_basis(rec_m)

# Moire potential coefficients
V = 12.4 * 1e-3 * np.exp(1j * 81.5 * np.pi / 180)  # in eV
Vj = np.array([V if i % 2 else np.conjugate(V) for i in range(1, 7)])

# Reciprocal moire lattice vectors
G = bandcalc.generate_twisted_lattice_by_shell(b, b, angle, 1)
GT = G[0, 1:]
GB = G[1, 1:]
GM = GT - GB

# Sort the reciprocal moire vectors by angle to get the phase right
GM = np.array(sorted(GM, key=lambda x: np.angle(x.view(complex))))

# Generate a real space monkhorst pack lattice
mp_moire = bandcalc.generate_monkhorst_pack_raw(m, 100)

moire_potential_pointwise = bandcalc.calc_moire_potential(mp_moire, GM, Vj)

results = {"CPU": [], "GPU": []}

########################
Exemple #2
0
potential_minima = {}

for angle in np.linspace(1, 3, num=10):
    print(f"{angle}°")
    # Reciprocal moire basis vectors
    rec_m = b1-bc.rotate_lattice(b2, angle)

    # Complete reciprocal moire lattice
    rec_moire_lattice = bc.generate_lattice_by_shell(rec_m, shells)

    # Real space moire basis vectors
    m = bc.generate_reciprocal_lattice_basis(rec_m)
    m_len = np.abs(m[0].view(complex)[0])

    # Calculate first shell reciprocal moire vectors
    G = bc.generate_twisted_lattice_by_shell(b1, b2, angle, 1)
    GT = G[0]
    GB = G[1]
    GM = GT-GB
    GM = np.array(sorted(GM, key=lambda x: np.abs(x.view(complex))))[1:]
    GM = np.array(sorted(GM, key=lambda x: np.angle(x.view(complex))))

    # Moire potential coefficients
    Vj = np.array([V if i%2 else np.conjugate(V) for i in range(1, 7)])
    potential_matrix = bc.calc_potential_matrix_from_coeffs(rec_moire_lattice, Vj)

    ## Calculate eigenstates for every k point in the MBZ
    k_points = bc.generate_monkhorst_pack_set(rec_m, 30).astype(np.float32)
    hamiltonian = bc.calc_hamiltonian(rec_moire_lattice, potential_matrix, mass)

    # Wannier functions should be centered around potential minima