The app is available on Streamlit (activate the app if required): Click here to access
To run locally, follow these steps:
- install libraries via "pip install -r requirements.txt" or "conda install --file requirements.txt"
- streamlit run app.py
Hofstadter's butterfly for 2D finite lattices
Peierls substitutions is taken into account via phase factor:
class HB_lattice contains the following methods:
- create_lattice(type, num_cells, bond_len) creates and plots the lattice with given properties
- type (str): symmetry of lattice (triangular, square, honeycomb)
- num_cells (int): number of cells
- bond_len (float): bond length (in nm)
- create_custom_lattice(file_path) creates the lattice using file_path csv or txt file. File should contain two (x, y) columns (in nm) with sites coordinates.
- plot_hofstadter(b_max, b_steps, g_factor, ham_type, **params) calculate and plot eigenvalues varying magnetic field.
- b_max (float): maximum magnetic field (in Tesla).
- b_steps (int): Number of points in the magnetic field range (0, b_max)
- g_factor (float): g-factor used for Zeeman splitting
- ham_type (str): type of Hamiltonian construction method to use. There are two ways: "hopping" and "interpolation" with the following parameters
- t (list): array of hoppings for different neighbor distances (in eV).
- t_so (list): array of spin–orbit coupling hoppings for different neighbor distances (in eV).
- a_param and b_param (float): parameter of interpolation (in eV) t_ij = a_param * exp ( - r_ij / b_param), r_ij - distance between sites
- plot_dos(b_value, e_min, e_max, e_step, smear) plot densities of states
- b_value (list): magnetic field values to choose eigenvalue sets
- e_min (float), e_max (float), e_step (int) energy range np.linspace(e_min, e_max, e_step) to plot DOS
- smear (float): numerial smearing
- plot_map(b_value, num_eigvecs, mapRes, smear) plots a spatial map of the eigenstate probability density.
- b_value (float): magnetic field values to choose eigenvector sets
- num_eigvecs (list): indices of eigenstates to include in the map.
- mapRes (int): resolution of the map grid.
- smear (float): smearing parameter for the Gaussian function (default 10 nm).
- Square, triangular and honeycomb lattices [1]. Parameters: t = 0.01 eV; num_cells = 1, 15; bond_len = 10 nm;