コード例 #1
0
vor_m = Voronoi(rec_moire_lattice)
sorted_vertices = np.array(
    sorted(vor_m.vertices, key=lambda x: np.abs(x.view(complex))))
k_point = sorted_vertices[0]

# Calculate the wavefunction
hamiltonian = bandcalc.calc_hamiltonian(rec_moire_lattice, potential_matrix, m)

wavefunction = bandcalc.calc_wave_function_on_grid(k_point, rec_moire_lattice,
                                                   grid, hamiltonian,
                                                   energy_level)

# Energies for reference
energies, prefix = bandcalc.get_unit_prefix(
    np.sort(
        np.linalg.eigvals(
            bandcalc.calc_hamiltonian(rec_moire_lattice, potential_matrix,
                                      m)(k_point))))
energy_slice = energies[energy_level -
                        5 if energy_level - 5 > -1 else None:energy_level +
                        5 if energy_level + 5 < len(energies) else None]
energy = np.real(energies[energy_level])

#np.save("wavefunction_moire_{}deg_energy_level_{}_shells_8.npy".format(angle, energy_level), wavefunction)

# Plot the results
fig, axs = plt.subplots(nrows=1, ncols=2, figsize=(11, 5))

bandcalc.plot_lattice(axs[0], rec_moire_lattice, "ko")
axs[0].text(0.05,
            0.95,
コード例 #2
0
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$"]
path = bandcalc.generate_k_path(points, N)

## Calculate bandstructure
bandstructure, prefix = bandcalc.get_unit_prefix(
    bandcalc.calc_bandstructure(path, hamiltonian))

sorted_bandstructure = np.sort(bandstructure)

fig, ax = plt.subplots(nrows=7, ncols=2, figsize=(7, 20))
for i in range(7):
    ## Calculate the wannier function
    R = 1 / 3 * (moire_lattice[5] + moire_lattice[3] +
                 moire_lattice[6]).astype(np.float32)
    r = 5 * bandcalc.generate_monkhorst_pack_set(m, 80)

    wannier_function = bandcalc.calc_wannier_function_gpu(hamiltonian,
                                                          k_points,
                                                          rec_moire_lattice,
                                                          r,
                                                          R,
コード例 #3
0
    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]])
path = bandcalc.generate_k_path(points, N)
k_names = [r"$\gamma$", r"$\kappa'$", r"$\kappa''$", r"$\kappa$"]

## Calculate the band structure
# The bandstructure is slightly different from the bandstructure in the
# original paper, but that is most likely just a small difference in
# some parameters, like the lattice constants
hamiltonian = bandcalc.calc_hamiltonian(rec_moire_lattice, potential_matrix,
                                        mass)
k_points = bandcalc.generate_k_path(points, N)
bandstructure, prefix = bandcalc.get_unit_prefix(
    bandcalc.calc_bandstructure(k_points, hamiltonian))

## Fit the Hubbard (Tight Binding) Hamiltonian
# Construct function
number_nearest_neighbours = 2
triangulation = Delaunay(moire_lattice)
zero_vec_ind = bandcalc.find_vector_index(moire_lattice, [0, 0])
nn = np.vstack([
    moire_lattice[bandcalc.find_k_order_delaunay_neighbours(
        zero_vec_ind,
        triangulation,
        k,
        only_k_shell=True,
        include_point_index=False)]
    for k in range(1, number_nearest_neighbours + 1)
])