""" =============== Band projection =============== """ # sphinx_gallery_thumbnail_number = 2 import numpy as np import matplotlib.pyplot as plt from fplore import FPLORun from fplore.plot import project, plot_bz from fplore.util import sample_e, linspace_ng run = FPLORun("../example_data/fermi") point_1 = np.array((0.5, 0, 0)) point_2 = np.array((0.5, 0.5, 0)) point_3 = np.array((0, 0, 0.5)) level_indices = run.band.bands_within(-0.25, 0.25) path = linspace_ng(point_1, point_2, point_3, num=(50, 50)) path = run.fplo_to_k(path) axes, idx_grid = run.band.reshape_gridded_data() bands_to_sample = run.band.data['e'][..., level_indices] grid_data = bands_to_sample[idx_grid] bands_along_path = sample_e(axes, grid_data, path, order=2) # bands_along_path = run.band.interpolator(path)
""" ================= ARPES k-space cut ================= """ import numpy as np from fplore import FPLORun from fplore.util import k_arpes, rot_v1_v2, sample_e from fplore.plot import plot_bz_proj import matplotlib.pyplot as plt from matplotlib import rc import matplotlib.gridspec as gridspec run = FPLORun("../example_data/Ag") surface_normal = [1, 1, 1] # todo conventional to primitive thetacenter = 0 thetawidth = 20 theta = np.linspace(np.deg2rad(thetacenter-thetawidth/2), np.deg2rad(thetacenter+thetawidth/2), 200) theta2 = np.array([np.deg2rad(0)]) v0 = 8 workfunc_analyzer = 3.8 e_photon = 674.4 R = rot_v1_v2(surface_normal, [0, 0, 1]) phi = np.deg2rad(15) c, s = np.cos(phi), np.sin(phi) R = np.dot(np.array(((c, -s, 0), (s, c, 0), (0, 0, 1))), R)
""" ============== Brillouin zone ============== """ import matplotlib.pyplot as plt from matplotlib import rc from fplore import FPLORun from fplore.plot import plot_bz rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']}) rc('text', usetex=True) run = FPLORun("../example_data/fermi") fig = plt.figure() ax = fig.add_subplot(111, projection='3d') plot_bz(run, ax, k_points=True, use_symmetry=True) plt.show()
""" ================== Standard band plot ================== """ from fplore import FPLORun import matplotlib.pyplot as plt run = FPLORun("../example_data/graphene_slab") fig = plt.figure() points = run["+points"].data iks, labels = zip(*points) labels = [label.replace('$~G', r'$\Gamma$') for label in labels] band_data = run["+band"].data plt.axhline(0, alpha=0.2, color='k', lw=2) plt.plot(band_data['ik'], band_data['e'], color='k', lw=0.5) plt.xticks(iks, labels) plt.ylabel(r"$(E - E_\mathrm{F})/\mathrm{eV}$") plt.ylim([-20, 20]) plt.show()
""" ======================= Projected Fermi surface ======================= """ from fplore import FPLORun from fplore.plot import plot_bz_proj from fplore.util import cartesian_product import matplotlib.pyplot as plt import numpy as np #run = FPLORun("../example_data/fermisurf") #yrs TODO fix fermisurf run run = FPLORun("../example_data/yrs") #yrs ## limit to bands close to fermi level to reduce memory usage #bands = run.band.bands_at_energy(e=0., tol=5*0.04) #selected_energy_data = run.band.data['e'][..., bands] ip = run.band.interpolator axes = [np.linspace(-1, 1, 100)] * 3 k_sample = cartesian_product(*axes) data = ip(run.backfold_k(k_sample)) data = data.reshape(tuple(map(len, axes)) + (-1, )) # axis to project along, 0: x, 1: y, 2: z axis_to_project = 2 visible_axes = [0, 1, 2]
""" =============== Fermi surface =============== """ from mayavi import mlab from fplore import FPLORun run = FPLORun("../example_data/yrs") level_indices = run.band.bands_at_energy() energy_data = run.band.data['e'][..., level_indices] axes, grid_idx = run.band.reshape_gridded_data() data = energy_data[grid_idx] # reshape to grid mlab.figure() for i, level_idx in enumerate(level_indices): mlab.contour3d(data[..., i], contours=[0], opacity=0.4) mlab.show()