Example #1
0
rec_moire_lattice = bandcalc.generate_lattice_by_shell(rec_m, shells)

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

# Real space moire lattice vectors
moire_lattice = bandcalc.generate_lattice_by_shell(m, shells)

if potential == "MoS2":
    # Moire potential coefficients
    V = 6.6 * 1e-3 * np.exp(-1j * 94 * np.pi / 180)  # in eV
    Vj = np.array([V if i % 2 else np.conjugate(V) for i in range(1, 7)])
    potential_matrix = bandcalc.calc_potential_matrix_from_coeffs(
        rec_moire_lattice, Vj)
elif potential == "off":
    potential_matrix = bandcalc.calc_potential_matrix(rec_moire_lattice)

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

## Calculate MBZ and choose some K-points for the k-path
vor_m = Voronoi(rec_moire_lattice)
sorted_vertices = np.array(
    sorted(vor_m.vertices, key=lambda x: np.abs(x.view(complex))))[:6]
sorted_vertices = np.array(
    sorted(sorted_vertices, key=lambda x: np.angle(x.view(complex))))
points = np.array([[0, 0], sorted_vertices[0], sorted_vertices[1],
                   sorted_vertices[3]])
k_names = [r"$\gamma$", r"$\kappa'$", r"$\kappa''$", r"$\kappa$"]
Example #2
0
b2 = np.array([0, 2*np.pi/a, 0])
b3 = np.array([0, 0, 2*np.pi/a])
b = np.vstack([b1, b2, b3])
lattice = bandcalc.generate_lattice_by_shell(b, 2)

# k path
points = np.array([[0, 0, 0],    # Gamma
    [0, np.pi/a, 0],             # X
    [np.pi/a, np.pi/a, 0],       # M
    [0, 0, 0],                   # Gamma
    [np.pi/a, np.pi/a, np.pi/a]]) # R
k_names = [r"$\Gamma$", r"X", r"M", r"$\Gamma$", r"R"]
path = bandcalc.generate_k_path(points, N)

# Calculate band structure
potential_matrix = bandcalc.calc_potential_matrix(lattice)
hamiltonian = bandcalc.calc_hamiltonian(lattice, potential_matrix, m)
bandstructure, prefix = bandcalc.get_unit_prefix(
        bandcalc.calc_bandstructure(path, hamiltonian))

# Plots
fig = plt.figure(figsize=(11,5))
ax0 = fig.add_subplot(121, projection="3d")
ax1 = fig.add_subplot(122)
bandcalc.plot_lattice_3d(ax0, lattice, "ko")
bandcalc.plot_k_path_3d(ax0, path, "r")
bandcalc.plot_bandstructure(ax1, bandstructure, k_names, "k")

ax1.set_ylabel(r"$E - \hbar\Omega_0$ in {}eV".format(prefix))
ax1.set_ylim([0, 4])