Dear All, I have a Hamaltonian (BHZ hamiltonian) and i'm trying to introduce a magnetic field. I believe I have to use the Peierls phase, however i'm not sure how to implement this after I have finalized the BHZ hamiltonian. Any assistance is appreciated. I will paste the code i have to generate my hamiltonian. You can find more information about the BHZ hamiltonian here: arxiv:0801.0901 https://arxiv.org/abs/0801.0901 """ import kwant import numpy as np import scipy.linalg as la import scipy.sparse.linalg as sla import sympy import matplotlib.pyplot as plt from ipywidgets import interact Gamma_so = [[0, 0, 0, -1], [0, 0, +1, 0], [0, +1, 0, 0], [-1, 0, 0, 0]] hamiltonian = """ + M * kron(sigma_0, sigma_z) - B * (k_x**2 + k_y**2) * kron(sigma_0, sigma_z) - D * (k_x**2 + k_y**2) * kron(sigma_0, sigma_0) + A * k_x * kron(sigma_z, sigma_x) - A * k_y * kron(sigma_0, sigma_y) + Delta * Gamma_so """ params_bhz=dict(A=364.5, B=-686, D=-512, M=-10, Delta=1.6) hamiltonian = kwant.continuum.sympify(hamiltonian, locals=dict(Gamma_so=Gamma_so)) hamiltonian grid_spacing = 5 template = kwant.continuum.discretize(hamiltonian, grid_spacing=grid_spacing) syst = kwant.wraparound.wraparound(template) syst = syst.finalized() """ Best, Alex