Introduction
In the field of solid-state physics, particularly in the branch of semiconductor physics, the theory of electronic band structures plays a central role. Semiconductor materials are inherently very complex systems due to the typically large number of atomic orbitals of their constituent atoms. A reduction to the essential degrees of freedom (namely, the electronic bands close to the Fermi level at charge neutrality) can be achieved by effective models, such as the perturbative method known as k ⋅ p k \cdot p k ⋅ p theory. The Kane model [1 ] , a k ⋅ p k \cdot p k ⋅ p theory that was originally proposed for describing the electronic band structure of indium antimonide (InSb), has since become an established model for the large category of binary semiconductor compounds with zincblende crystal structure, and in particular for narrow gap semiconductor compounds. The Kane model has been widely used in the semiconductor community, because the resulting band structures are well suited for predicting transport phenomena as well as optical (spectroscopic) properties. It is therefore not only a valuable asset upon analyzing data, but also a very powerful tool for designing device functionality.
The minimal number of the degrees of freedom in the Kane model is still too large to permit exact analytic solutions of the Schrödinger equation, that defines the band structure. The problem can be approached numerically, but setting up numerical simulations and extracting physical observables can be a tedious task, for example due to the quantity and complexity of the matrix elements in the Hamiltonian. These issues mandate a software solution where the tedious tasks are automated, i.e., an application which takes physical parameters like geometry and materials of a device as input, and which produces physical observables as its output.
Here, we present the Python application kdotpy as a means to deal with these challenges. The motivation for developing kdotpy has been the need to analyze the experimental results of the research group of L. W. Molenkamp in Würzburg. In many regards the situation that triggered the development of kdotpy was archetypical for an experimental group engaged in the study of sophisticated semiconductor heterostructures. The complexity of the collected data called for a description beyond simplified effective models. It was well understood that k ⋅ p k \cdot p k ⋅ p theory provided a suitable framework for a realistic description of the experimental findings and a Fortran program set up by Pfeuffer-Jeschke and Novik [2 , 3 ] was already used for band structure simulations for many years. However, the modelling used in this program proved to be inadequate for simulating edge channels and surface states. Moreover, it lacks an intuitive user interface, and the program structure and the programming style have proven to be major obstacles towards maintainability and towards future extension. In particular, the fact that the initial developers had moved on to other positions and a general lack of detail in the documentation of the code constitute major entrance thresholds for inclusion of novel functionalities.
In the kdotpy project, we attempt to steer clear of these problems by applying modern concepts regarding project design and development workflow. The development strategy is guided by the philosophy that kdotpy’s primary goal is to support current (experimental and theoretical) research, for which feedback from the community is an important aspect. While kdotpy has started out with the specific task of analyzing transport phenomena in Mn-doped HgTe quantum wells [4 , 5 , 6 ] , it has since been extended to tackle a much broader variety of problems [7 , 8 , 9 , 10 ] . As k ⋅ p k \cdot p k ⋅ p theory is much more widely applicable than the study of topological insulators or HgTe in particular, we have equipped kdotpy with the infrastructure for simulating any material whose band structure is described by the Kane model. This includes other II-VI materials as well as III-V semiconductors like GaAs and InSb. We expect that kdotpy will thus be beneficial for a broad community spanning various disciplines in semiconductor physics. We intend to create a diverse and international user base and encourage active discussion among users and developers, in the spirit of open science and open software development. The community driven nature facilitates sustainable maintenance and future project development.
In line with modern standards in scientific research, we strive towards transparency by publishing this project as open source software. We believe that the choice of Python as a widely known programming language facilitates inspection of our code and thus fits the ideas of open science. We aim for a high level of reproducibility and for compliance with the FAIR principles for research data [11 ] by providing rich metadata in the output files and by avoiding the use of proprietary file formats.
The purpose of this article is to provide a comprehensive overview of all important components of kdotpy together with relevant physical background. We emphasize that reading the complete manuscript is not required for being able to use the application: We encourage the reader to focus on the parts of personal interest and/or those needed to address a specific physical problem. The article is structured as follows: In Sec. 2, we provide an in-depth review of the physical concepts and theories. essential for understanding the implementation. In § 3 , we discuss all important components of the implementation, making the connection between the physics and the project’s source code. Installation instructions are provided in § 7 . We illustrate the usage of kdotpy with several detailed examples in § 8 . The Appendices contain technical details of the implementation as well as a comprehensive reference of configuration options, material parameters, command-line arguments, and several other aspects.
Physics background
The Kane model [1 ] implemented in kdotpy was originally proposed as a theory for the electronic band structure of InSb. It has proven to be a suitable model for a broad class of binary semiconductor compounds with a zincblende crystal structure, to which InSb also belongs. The Kane model defines an 8 × 8 8 \times8 8 × 8 Hamiltonian depending on the momentum coordinate k \mathbf{k} k . The basis of the Hilbert space is formed by two s s s orbitals and six p p p orbitals. These states are treated exactly at the Γ \Gamma Γ point (k = 0 \mathbf{k} = 0 k = 0 ), while couplings to other (so-called remote ) bands are treated perturbatively in the framework of k ⋅ p \mathbf{k} \cdot\mathbf{p} k ⋅ p theory.
Importantly, the Kane model takes into account spin-orbit interaction, which is essential for explaining the energetic positions of the electronic bands at the Γ \Gamma Γ point [1 ] . In compounds of heavy elements, spin-orbit coupling and other relativistic effects become strong enough to result in an inversion of the band ordering. The latter is the key ingredient for the formation of topological phases, which constitute a major research branch at the Department of Physics in Würzburg since the first experimental realizations of such materials in mercury telluride (HgTe) quantum wells [12 ] . k ⋅ p \mathbf{k} \cdot\mathbf{p} k ⋅ p theory is well suited towards accessing topological properties and accordingly this was a main focus upon setting up the kdotpy project.
The numerical approach also admits analysis of more complicated configurations than bulk materials. In particular, experiments are typically performed with devices with several layers of zincblende-type materials stacked on top of a substrate. The latter constellation is described by taking the bulk Hamiltonian and substituting the momentum coordinate k z k_z k z by its spatial representation − i ℏ ∂ z -\mathrm{i}\hbar\partial_z − i ℏ ∂ z , a derivative with respect to the spatial coordinate z z z . For simulating the band structure, the z z z coordinate is discretized to a finite set { z j } \{z_j\} { z j } , so that the Hilbert space dimension (and the size of the Hamiltonian matrix) becomes 8 n z 8n_z 8 n z . The different layers in the system are modelled by making the coefficients in the Kane model z z z -dependent. This approach goes back to Burt [13 , 14 ] and has since been used by many others, see, e.g., Refs. [2 , 3 , 15 ] . This discretization method distinguishes kdotpy from the aforementioned Fortran program [2 , 3 ] , which uses an expansion into Legendre polynomials in order to convert the Hamiltonian to matrix form. The present approach has the benefits that the modelling is more intuitive and that it can more reliably resolve essential features like edge channels [4 ] and surface states [7 ] .
The bulk Kane model and the reduction to lower dimensional geometries are discussed § 2.1 and § 2.2 , respectively. The remainder of Sec. 2 is dedicated to the effects of magnetic fields, bulk inversion asymmetry, and strain, as well as to topology.
kp theory and the Kane model in a nutshell
kp theory
The k ⋅ p \mathbf{k} \cdot\mathbf{p} k ⋅ p method aims at finding an effective model for the band structure near a high-symmetry point. The method is based on perturbation theory on the Bloch wave functions, where eigenenergies and eigenstates at k = 0 \mathbf{k} = 0 k = 0 are treated as exact and the contributions for k ≠ 0 \mathbf{k} \ne0 k = 0 as perturbation. The Schrödinger equation [ p ^ 2 / 2 m + V ( r ) ] ψ n , k ( r ) = E n ( k ) ψ n , k ( r ) [\hat{p}^{2}/2m + V(\mathbf{r})]\psi_{n,\mathbf{k}}(\mathbf{r}) = E_n(\mathbf{k})\psi_{n,\mathbf{k}}(\mathbf{r}) [ p ^ 2 /2 m + V ( r )] ψ n , k ( r ) = E n ( k ) ψ n , k ( r ) acting on the Bloch wave functions ψ n , k ( r ) = e i k ⋅ r u n , k ( r ) \psi_{n,\mathbf{k}}(\mathbf{r}) = e^{\mathrm{i}\mathbf{k}\cdot\mathbf{r}}u_{n,\mathbf{k}}(\mathbf{r}) ψ n , k ( r ) = e i k ⋅ r u n , k ( r ) can be written in terms of the Bloch functions u n , k ( r ) u_{n,\mathbf{k}}(\mathbf{r}) u n , k ( r ) as
[ ℏ 2 k 2 2 m + 2 ℏ k ⋅ p ^ 2 m + p ^ 2 2 m + V ( r ) ] u n , k ( r ) = E n ( k ) u n , k ( r ) , (1) \left[\frac{\hbar^{2}k^{2}}{2m}+\frac{2\hbar\mathbf{k}\cdot\hat{\mathbf{p}}}{2m}+\frac{\hat{\mathbf{p}}^{2}}{2m}+V(\mathbf{r})\right]u_{n,\mathbf{k}}(\mathbf{r})=E_n(\mathbf{k})u_{n,\mathbf{k}}(\mathbf{r}), \tag*{(1)} [ 2 m ℏ 2 k 2 + 2 m 2ℏ k ⋅ p ^ + 2 m p ^ 2 + V ( r ) ] u n , k ( r ) = E n ( k ) u n , k ( r ) , (1)
where p ^ = − i ℏ ∇ \hat{\mathbf{p}}=-\mathrm{i}\hbar\nabla p ^ = − i ℏ∇ is the momentum operator, k \mathbf{k} k is a vector of real values, and the index n n n labels the bands. The Hamiltonian H 0 = p ^ 2 / 2 m + V ( r ) H_0=\hat{\mathbf{p}}^{2}/2m+V(\mathbf{r}) H 0 = p ^ 2 /2 m + V ( r ) at k = 0 \mathbf{k}=0 k = 0 is treated as exact, whereas H k ′ = ℏ 2 k 2 / 2 m + ℏ k ⋅ p ^ / m H'_{\mathbf{k}}=\hbar^{2}k^{2}/2m+\hbar\mathbf{k}\cdot\hat{\mathbf{p}}/m H k ′ = ℏ 2 k 2 /2 m + ℏ k ⋅ p ^ / m is treated as perturbation. The second term in H k ′ H'_{\mathbf{k}} H k ′ is given k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p theory its name. The unperturbed eigenenergies E n ( 0 ) E_n(0) E n ( 0 ) and eigenfunctions ∣ u n , 0 ⟩ |u_{n,0}\rangle ∣ u n , 0 ⟩ , that solve H 0 ∣ u n , 0 ⟩ = E n ( 0 ) ∣ u n , 0 ⟩ H_0|u_{n,0}\rangle=E_n(0)|u_{n,0}\rangle H 0 ∣ u n , 0 ⟩ = E n ( 0 ) ∣ u n , 0 ⟩ , are assumed to be known. The first order perturbation to the energy is
E n ( 1 ) ( k ) = ⟨ u n , 0 ∣ H k ′ ∣ u n , 0 ⟩ = ℏ 2 k 2 2 m . (2) E_n^{(1)}(\mathbf{k})=\langle u_{n,0}|H'_{\mathbf{k}}|u_{n,0}\rangle=\frac{\hbar^{2}k^{2}}{2m}. \tag*{(2)} E n ( 1 ) ( k ) = ⟨ u n , 0 ∣ H k ′ ∣ u n , 0 ⟩ = 2 m ℏ 2 k 2 . (2)
An additional term proportional to ⟨ u n , 0 ∣ k ⋅ p ^ ∣ u n , 0 ⟩ \langle u_{n,0}|\mathbf{k}\cdot\hat{\mathbf{p}}|u_{n,0}\rangle ⟨ u n , 0 ∣ k ⋅ p ^ ∣ u n , 0 ⟩ vanishes if we assume that the dispersions attain a maximum or minimum at k = 0 \mathbf{k}=0 k = 0 . The first order perturbation to the eigenfunctions is
∣ u n , k ( 1 ) ⟩ = ℏ m ∑ n ′ : E n ′ ≠ E n k ⋅ P n ′ n E n ( 0 ) − E n ′ ( 0 ) ∣ u n ′ , 0 ⟩ , (3) |u_{n,\mathbf{k}}^{(1)}\rangle= \frac{\hbar}{m}\sum_{n':E_{n'}\ne E_n}\frac{\mathbf{k}\cdot\mathbf{P}_{n'n}}{E_n(0)-E_{n'}(0)}|u_{n',0}\rangle, \tag*{(3)} ∣ u n , k ( 1 ) ⟩ = m ℏ n ′ : E n ′ = E n ∑ E n ( 0 ) − E n ′ ( 0 ) k ⋅ P n ′ n ∣ u n ′ , 0 ⟩ , (3)
where P n ′ n ≡ ⟨ u n ′ , 0 ∣ p ^ ∣ u n , 0 ⟩ \mathbf{P}_{n'n}\equiv\langle u_{n',0}|\hat{\mathbf{p}}|u_{n,0}\rangle P n ′ n ≡ ⟨ u n ′ , 0 ∣ p ^ ∣ u n , 0 ⟩ and the sum runs over all bands n ′ n' n ′ for which E n ′ ( 0 ) ≠ E n ( 0 ) E_{n'}(0)\ne E_n(0) E n ′ ( 0 ) = E n ( 0 ) . From Eq. (3) , we obtain the second order perturbation of the energy as
E n ( 2 ) ( k ) = ⟨ u n , 0 ∣ H ′ ∣ u n , k ( 1 ) ⟩ = ℏ 2 m 2 ∑ n ′ : E n ′ ≠ E n ∣ k ⋅ P n ′ n ∣ 2 E n ( 0 ) − E n ′ ( 0 ) + O ( k 3 ) , (4) E_n^{(2)}(\mathbf{k})=\langle u_{n,0}|H'|u_{n,\mathbf{k}}^{(1)}\rangle=\frac{\hbar^2}{m^2}\sum_{n':E_{n'}\ne E_n}\frac{|\mathbf{k}\cdot\mathbf{P}_{n'n}|^2}{E_n(0)-E_{n'}(0)}+\mathcal{O}(k^3), \tag*{(4)} E n ( 2 ) ( k ) = ⟨ u n , 0 ∣ H ′ ∣ u n , k ( 1 ) ⟩ = m 2 ℏ 2 n ′ : E n ′ = E n ∑ E n ( 0 ) − E n ′ ( 0 ) ∣ k ⋅ P n ′ n ∣ 2 + O ( k 3 ) , (4)
noting that P n n ′ = P n ′ n ∗ \mathbf{P}_{nn'}=\mathbf{P}_{n'n}^{*} P n n ′ = P n ′ n ∗ and discarding terms of cubic order in momentum. This observation completes the perturbation theory up to lowest nontrivial order in momentum, as
E n ( k ) = E n ( 0 ) + ℏ 2 k 2 2 m + ℏ 2 m 2 ∑ n ′ : E n ′ ≠ E n ∣ k ⋅ P n ′ n ∣ 2 E n ( 0 ) − E n ′ ( 0 ) + O ( k 3 ) , (5) E_n(\mathbf{k})=E_n(0)+\frac{\hbar^2 k^2}{2m}+\frac{\hbar^2}{m^2}\sum_{n':E_{n'}\ne E_n}\frac{|\mathbf{k}\cdot\mathbf{P}_{n'n}|^2}{E_n(0)-E_{n'}(0)}+\mathcal{O}(k^3), \tag*{(5)} E n ( k ) = E n ( 0 ) + 2 m ℏ 2 k 2 + m 2 ℏ 2 n ′ : E n ′ = E n ∑ E n ( 0 ) − E n ′ ( 0 ) ∣ k ⋅ P n ′ n ∣ 2 + O ( k 3 ) , (5)
∣ u n , k ( 1 ) ⟩ = ℏ m ∑ n ′ : E n ′ ≠ E n k ⋅ P n ′ n E n ( 0 ) − E n ′ ( 0 ) ∣ u n , 0 ⟩ + O ( k 2 ) . (6) |u_{n,\mathbf{k}}^{(1)}\rangle=\frac{\hbar}{m}\sum_{n':E_{n'}\ne E_n}\frac{\mathbf{k}\cdot\mathbf{P}_{n'n}}{E_n(0)-E_{n'}(0)}|u_{n,0}\rangle+\mathcal{O}(k^2). \tag*{(6)} ∣ u n , k ( 1 ) ⟩ = m ℏ n ′ : E n ′ = E n ∑ E n ( 0 ) − E n ′ ( 0 ) k ⋅ P n ′ n ∣ u n , 0 ⟩ + O ( k 2 ) . (6)
Importantly, it is possible to consider only those bands n n n with energies E n ( 0 ) E_n(0) E n ( 0 ) sufficiently close to the charge neutrality point, or in other words, to reduce the number of degrees of freedom by choosing a restricted selection of the ∣ u n , 0 ⟩ |u_{n,0}\rangle ∣ u n , 0 ⟩ as basis. However, the perturbations involve a sum over all bands n ′ n' n ′ , also those outside of the basis. These bands are known as remote bands in the context of k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p theory.
The Kane model
In the seminal paper by [1 ] , k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p theory was used to calculate the band structure of InSb. As a matter of fact, Kane’s model applies to many more semiconductor materials with a zincblende lattice structure. The important extra ingredient in Kane’s analysis is spin-orbit coupling, one of the relativistic corrections that affect the atomic orbitals. The Hamiltonian H 0 H_0 H 0 (cf. Eq. (1)) is modified by adding the spin-orbit term [1 ]
H S O = ℏ 4 m 2 c 2 ( ∇ V × p ^ ) ⋅ σ (7) H_{\mathrm{SO}}=\frac{\hbar}{4m^2c^2}(\nabla V\times\hat{\mathbf{p}})\cdot\boldsymbol{\sigma} \tag*{(7)} H SO = 4 m 2 c 2 ℏ ( ∇ V × p ^ ) ⋅ σ (7)
where σ = ( σ x , σ y , σ z ) \boldsymbol{\sigma}=(\sigma_x,\sigma_y,\sigma_z) σ = ( σ x , σ y , σ z ) is the vector of Pauli matrices acting on the spin degree of freedom and V V V is the potential near the atomic core.
In InSb, the relevant atomic orbitals are the 5s orbitals of In and the 5p orbitals of Sb. Together with the spin degree of freedom (S = 1 2 S=\frac{1}{2} S = 2 1 ), this yields the eight component basis,
∣ S , ↑ ⟩ , − 1 2 ∣ X + i Y , ↓ ⟩ , ∣ Z , ↑ ⟩ , 1 2 ∣ X − i Y , ↓ ⟩ , ∣ S , ↓ ⟩ , + 1 2 ∣ X − i Y , ↑ ⟩ , ∣ Z , ↓ ⟩ , 1 2 ∣ X + i Y , ↑ ⟩ , (8) |S,\uparrow\rangle,\;-\frac{1}{\sqrt{2}}|X+iY,\downarrow\rangle,\;|Z,\uparrow\rangle,\;\frac{1}{\sqrt{2}}|X-iY,\downarrow\rangle,\;|S,\downarrow\rangle,\;+\frac{1}{\sqrt{2}}|X-iY,\uparrow\rangle,\;|Z,\downarrow\rangle,\;\frac{1}{\sqrt{2}}|X+iY,\uparrow\rangle, \tag*{(8)} ∣ S , ↑ ⟩ , − 2 1 ∣ X + iY , ↓ ⟩ , ∣ Z , ↑ ⟩ , 2 1 ∣ X − iY , ↓ ⟩ , ∣ S , ↓ ⟩ , + 2 1 ∣ X − iY , ↑ ⟩ , ∣ Z , ↓ ⟩ , 2 1 ∣ X + iY , ↑ ⟩ , (8)
where ∣ S ⟩ |S\rangle ∣ S ⟩ labels the s s s orbital and ∣ X ⟩ , ∣ Y ⟩ , ∣ Z ⟩ |X\rangle,|Y\rangle,|Z\rangle ∣ X ⟩ , ∣ Y ⟩ , ∣ Z ⟩ the p p p orbitals. In this basis, the Hamiltonian at k = 0 \mathbf{k}=0 k = 0 is represented by the diagonal matrix H 0 = diag ( E s , E p , E p , E p , E s , E p , E p , E p ) H_0=\operatorname{diag}(E_s,E_p,E_p,E_p,E_s,E_p,E_p,E_p) H 0 = diag ( E s , E p , E p , E p , E s , E p , E p , E p ) , and H S O H_{\mathrm{SO}} H SO can be written as
H S O = ( h S O 0 0 h S O ) with h S O = ( 0 0 0 0 0 − 1 3 Δ S O 2 3 Δ S O 0 0 2 3 Δ S O 0 0 0 0 0 1 3 Δ S O ) . (9) H_{\mathrm{SO}}=
\begin{pmatrix}
h_{\mathrm{SO}} & 0\\
0 & h_{\mathrm{SO}}
\end{pmatrix}
\quad\text{with}\quad
h_{\mathrm{SO}}=
\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & -\frac{1}{3}\Delta_{\mathrm{SO}} & \frac{\sqrt{2}}{3}\Delta_{\mathrm{SO}} & 0\\
0 & \frac{\sqrt{2}}{3}\Delta_{\mathrm{SO}} & 0 & 0\\
0 & 0 & 0 & \frac{1}{3}\Delta_{\mathrm{SO}}
\end{pmatrix}. \tag*{(9)} H SO = ( h SO 0 0 h SO ) with h SO = 0 0 0 0 0 − 3 1 Δ SO 3 2 Δ SO 0 0 3 2 Δ SO 0 0 0 0 0 3 1 Δ SO . (9)
where Δ S O = ( 3 i ℏ 4 m 2 c 2 ) ⟨ X ∣ ( ∂ x V p ^ y − ∂ y V p ^ x ) ∣ Y ⟩ \Delta_{\mathrm{SO}}=\left(\frac{3i\hbar}{4m^2c^2}\right)\langle X|(\partial_xV\hat{p}_y-\partial_yV\hat{p}_x)|Y\rangle Δ SO = ( 4 m 2 c 2 3 i ℏ ) ⟨ X ∣ ( ∂ x V p ^ y − ∂ y V p ^ x ) ∣ Y ⟩ is the spin-orbit splitting; the eigenvalues of h S O h_{\mathrm{SO}} h SO are 0 , 1 3 Δ S O , 1 3 Δ S O , − 2 3 Δ S O 0,\frac{1}{3}\Delta_{\mathrm{SO}},\frac{1}{3}\Delta_{\mathrm{SO}},-\frac{2}{3}\Delta_{\mathrm{SO}} 0 , 3 1 Δ SO , 3 1 Δ SO , − 3 2 Δ SO . Thus, h S O h_{\mathrm{SO}} h SO partially lifts the degeneracy between the p p p orbital states (six states at energy E p E_p E p ) to four states at E p + 1 3 Δ S O E_p+\frac{1}{3}\Delta_{\mathrm{SO}} E p + 3 1 Δ SO and two states at E p − 2 3 Δ S O E_p-\frac{2}{3}\Delta_{\mathrm{SO}} E p − 3 2 Δ SO .
The eigenstates of H 0 + H S O H_0 + H_{\mathrm{SO}} H 0 + H SO are formed by the basis
∣ 1 ⟩ = ∣ Γ 6 , + 1 2 ⟩ = ∣ S , ↑ ⟩ , ∣ 2 ⟩ = ∣ Γ 6 , − 1 2 ⟩ = ∣ S , ↓ ⟩ , ∣ 3 ⟩ = ∣ Γ 8 , + 3 2 ⟩ = 1 2 ∣ X + i Y , ↑ ⟩ , ∣ 4 ⟩ = ∣ Γ 8 , + 1 2 ⟩ = 1 6 [ ∣ X + i Y , ↓ ⟩ − 2 ∣ Z , ↑ ⟩ ] , ∣ 5 ⟩ = ∣ Γ 8 , − 1 2 ⟩ = − 1 6 [ ∣ X − i Y , ↑ ⟩ + 2 ∣ Z , ↓ ⟩ ] , ∣ 6 ⟩ = ∣ Γ 8 , − 3 2 ⟩ = − 1 2 ∣ X − i Y , ↓ ⟩ , ∣ 7 ⟩ = ∣ Γ 7 , + 1 2 ⟩ = 1 3 [ ∣ X + i Y , ↓ ⟩ + ∣ Z , ↑ ⟩ ] , ∣ 8 ⟩ = ∣ Γ 7 , − 1 2 ⟩ = 1 3 [ ∣ X − i Y , ↑ ⟩ − ∣ Z , ↓ ⟩ ] . (10) \begin{aligned}
|1\rangle&= |\Gamma_6,+\tfrac{1}{2}\rangle= |S,\uparrow\rangle,\\
|2\rangle&= |\Gamma_6,-\tfrac{1}{2}\rangle= |S,\downarrow\rangle,\\
|3\rangle&= |\Gamma_8,+\tfrac{3}{2}\rangle= \frac{1}{\sqrt{2}}|X+iY,\uparrow\rangle,\\
|4\rangle&= |\Gamma_8,+\tfrac{1}{2}\rangle= \frac{1}{\sqrt{6}}\left[|X+iY,\downarrow\rangle-2|Z,\uparrow\rangle\right],\\
|5\rangle&= |\Gamma_8,-\tfrac{1}{2}\rangle= -\frac{1}{\sqrt{6}}\left[|X-iY,\uparrow\rangle+2|Z,\downarrow\rangle\right],\\
|6\rangle&= |\Gamma_8,-\tfrac{3}{2}\rangle= -\frac{1}{\sqrt{2}}|X-iY,\downarrow\rangle,\\
|7\rangle&= |\Gamma_7,+\tfrac{1}{2}\rangle= \frac{1}{\sqrt{3}}\left[|X+iY,\downarrow\rangle+|Z,\uparrow\rangle\right],\\
|8\rangle&= |\Gamma_7,-\tfrac{1}{2}\rangle= \frac{1}{\sqrt{3}}\left[|X-iY,\uparrow\rangle-|Z,\downarrow\rangle\right]. \tag*{(10)}
\end{aligned} ∣1 ⟩ ∣2 ⟩ ∣3 ⟩ ∣4 ⟩ ∣5 ⟩ ∣6 ⟩ ∣7 ⟩ ∣8 ⟩ = ∣ Γ 6 , + 2 1 ⟩ = ∣ S , ↑ ⟩ , = ∣ Γ 6 , − 2 1 ⟩ = ∣ S , ↓ ⟩ , = ∣ Γ 8 , + 2 3 ⟩ = 2 1 ∣ X + iY , ↑ ⟩ , = ∣ Γ 8 , + 2 1 ⟩ = 6 1 [ ∣ X + iY , ↓ ⟩ − 2∣ Z , ↑ ⟩ ] , = ∣ Γ 8 , − 2 1 ⟩ = − 6 1 [ ∣ X − iY , ↑ ⟩ + 2∣ Z , ↓ ⟩ ] , = ∣ Γ 8 , − 2 3 ⟩ = − 2 1 ∣ X − iY , ↓ ⟩ , = ∣ Γ 7 , + 2 1 ⟩ = 3 1 [ ∣ X + iY , ↓ ⟩ + ∣ Z , ↑ ⟩ ] , = ∣ Γ 7 , − 2 1 ⟩ = 3 1 [ ∣ X − iY , ↑ ⟩ − ∣ Z , ↓ ⟩ ] . (10)
where the notation ∣ Γ r , m j ⟩ |\Gamma_r,m_j\rangle ∣ Γ r , m j ⟩ refers to the irreducible representation Γ r \Gamma_r Γ r (r = 6 , 7 , 8 r=6,7,8 r = 6 , 7 , 8 ) of the point group T d T_d T d under which the states transform as well as the total angular momentum quantum number (J z J_z J z eigenvalue) m j m_j m j . In the basis of Eq. (10) , the Hamiltonian H 0 + H S O H_0 + H_{\mathrm{SO}} H 0 + H SO can be diagonalized as
H 0 + H S O = ( E c 0 0 0 0 0 0 0 0 E c 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v − Δ S O 0 0 0 0 0 0 0 0 E v − Δ S O ) . (11) H_0+H_{\mathrm{SO}}=
\begin{pmatrix}
E_{\mathrm{c}} & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & E_{\mathrm{c}} & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & E_{\mathrm{v}} & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & E_{\mathrm{v}} & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & E_{\mathrm{v}} & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & E_{\mathrm{v}} & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & E_{\mathrm{v}}-\Delta_{\mathrm{SO}} & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & E_{\mathrm{v}}-\Delta_{\mathrm{SO}}
\end{pmatrix}. \tag*{(11)} H 0 + H SO = E c 0 0 0 0 0 0 0 0 E c 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v 0 0 0 0 0 0 0 0 E v − Δ SO 0 0 0 0 0 0 0 0 E v − Δ SO . (11)
with E c ≡ E s E_{\mathrm{c}}\equiv E_{\mathrm{s}} E c ≡ E s , E v ≡ E p + 1 3 Δ E_{\mathrm{v}}\equiv E_{\mathrm{p}}+\frac{1}{3}\Delta E v ≡ E p + 3 1 Δ , and E v − Δ S O ≡ E p − 2 3 Δ E_{\mathrm{v}}-\Delta_{\mathrm{SO}}\equiv E_{\mathrm{p}}-\frac{2}{3}\Delta E v − Δ SO ≡ E p − 3 2 Δ referring to the ‘conduction band’, ‘valence band’ and split-off band energies at Γ \Gamma Γ , respectively. Note that in the notation we use the labels for ‘conduction’ and ‘valence’ band for the Γ 6 \Gamma_6 Γ 6 and Γ 8 \Gamma_8 Γ 8 bands, respectively, without regard to the actual band ordering. For inverted materials, E c E_{\mathrm{c}} E c lies in the valence band and E v E_{\mathrm{v}} E v in the conduction band.
We note that between references (cf. Refs. [1 , 2 , 3 , 16 ] , for example), the basis may differ slightly by complex phases and order. Here, we group the multiplets belonging to each representation (Γ 6 \Gamma_6 Γ 6 , Γ 8 \Gamma_8 Γ 8 , Γ 7 \Gamma_7 Γ 7 ) together. The Hamiltonian thus has the block structure
H = ( H 66 H 68 H 67 H 86 H 88 H 87 H 76 H 78 H 77 ) . (12) H=\begin{pmatrix}
H_{66} & H_{68} & H_{67}\\
H_{86} & H_{88} & H_{87}\\
H_{76} & H_{78} & H_{77}
\end{pmatrix}. \tag*{(12)} H = H 66 H 86 H 76 H 68 H 88 H 78 H 67 H 87 H 77 . (12)
Where necessary due to space restriction, we will write terms of the full 8 × 8 8\times8 8 × 8 Hamiltonian in terms of these smaller blocks.
The k ⋅ p ^ k\cdot\hat{p} k ⋅ p ^ term in the Hamiltonian introduces matrix elements proportional to k x ⟨ S ∣ p x ∣ X ⟩ k_x\langle S|p_x|X\rangle k x ⟨ S ∣ p x ∣ X ⟩ , k y ⟨ S ∣ p y ∣ Y ⟩ k_y\langle S|p_y|Y\rangle k y ⟨ S ∣ p y ∣ Y ⟩ and k z ⟨ S ∣ p z ∣ Z ⟩ k_z\langle S|p_z|Z\rangle k z ⟨ S ∣ p z ∣ Z ⟩ . To write these terms, one defines the Kane parameter
P = ℏ m ∣ ⟨ S ∣ p ^ x ∣ X ⟩ ∣ = ℏ m ∣ ⟨ S ∣ p ^ y ∣ Y ⟩ ∣ = ℏ m ∣ ⟨ S ∣ p ^ z ∣ Z ⟩ ∣ . (13) P=\frac{\hbar}{m}\left|\langle S|\hat{p}_x|X\rangle\right|=\frac{\hbar}{m}\left|\langle S|\hat{p}_y|Y\rangle\right|=\frac{\hbar}{m}\left|\langle S|\hat{p}_z|Z\rangle\right|. \tag*{(13)} P = m ℏ ∣ ⟨ S ∣ p ^ x ∣ X ⟩ ∣ = m ℏ ∣ ⟨ S ∣ p ^ y ∣ Y ⟩ ∣ = m ℏ ∣ ⟨ S ∣ p ^ z ∣ Z ⟩ ∣ . (13)
The ambiguity in the definitions of P P P in the literature (again, cf. Refs. [1 , 2 , 3 , 16 ] ) is resolved by choosing a real and positive value. The value of the Kane parameter is of similar magnitude for many materials due to the similarity of the orbital wave functions.
The next step towards the formulation of the full Kane model is to identify all possible inversion symmetric terms up to quadratic order. (We will discuss inversion asymmetric terms in § 2.6 .) Using the conventions of Ref. [3 ] , we write
H K a n e = H 0 + H S O + H k (14) H_{\mathrm{Kane}}=H_0+H_{\mathrm{SO}}+H_k \tag*{(14)} H Kane = H 0 + H SO + H k (14)
in terms of the constant part H 0 + H S O H_0+H_{\mathrm{SO}} H 0 + H SO [Eq. (11)] and the momentum-dependent part
H k = ( T k 0 − 1 2 P k + 2 3 P k z 1 6 P k − 0 − 1 3 P k z − 1 3 P k − 0 T k 0 − 1 6 P k + 2 3 P k z 1 2 P k − − 1 3 P k + 1 3 P k z − 1 2 P k − 0 U k + V k − S k − R k 0 1 2 S k − − 2 R k 2 3 P k z − 1 6 P k − − S k − † U k − V k C k R k 2 V k − 3 2 S ~ k − 1 6 P k + 2 3 P k z R k † C k † U k − V k S k + − 3 2 S k + − 2 V k 0 1 2 P k + 0 R k † S k + † U k + V k 2 R k † 1 2 S k + − 1 3 P k z − 1 3 P k − 1 2 S k − † 2 V k − 3 2 S ~ k + † 2 R k U k C k − 1 3 P k + 1 3 P k z − 2 R k † − 3 2 S ~ k − † − 2 V k 1 2 S k + † C k † U k ) (15) H_{\mathbf{k}}=
\begin{pmatrix}
T_{\mathbf{k}} & 0 & -\sqrt{\frac{1}{2}}P k_{+} & \sqrt{\frac{2}{3}}P k_z & \sqrt{\frac{1}{6}}P k_{-} & 0 & -\sqrt{\frac{1}{3}}P k_z & -\sqrt{\frac{1}{3}}P k_{-} \\
0 & T_{\mathbf{k}} & 0 & -\sqrt{\frac{1}{6}}P k_{+} & \sqrt{\frac{2}{3}}P k_z & \sqrt{\frac{1}{2}}P k_{-} & -\sqrt{\frac{1}{3}}P k_{+} & \sqrt{\frac{1}{3}}P k_z \\
-\sqrt{\frac{1}{2}}P k_{-} & 0 & U_{\mathbf{k}}+V_{\mathbf{k}} & -S_{\mathbf{k}}^{-} & R_{\mathbf{k}} & 0 & \frac{1}{\sqrt{2}}S_{\mathbf{k}}^{-} & -\sqrt{2}R_{\mathbf{k}} \\
\sqrt{\frac{2}{3}}P k_z & -\sqrt{\frac{1}{6}}P k_{-} & -S_{\mathbf{k}}^{-\dagger} & U_{\mathbf{k}}-V_{\mathbf{k}} & C_{\mathbf{k}} & R_{\mathbf{k}} & \sqrt{2}V_{\mathbf{k}} & -\sqrt{\frac{3}{2}}\widetilde{S}_{\mathbf{k}}^{-} \\
\sqrt{\frac{1}{6}}P k_{+} & \sqrt{\frac{2}{3}}P k_z & R_{\mathbf{k}}^\dagger& C_{\mathbf{k}}^\dagger& U_{\mathbf{k}}-V_{\mathbf{k}} & S_{\mathbf{k}}^{+} & -\sqrt{\frac{3}{2}}S_{\mathbf{k}}^{+} & -\sqrt{2}V_{\mathbf{k}} \\
0 & \sqrt{\frac{1}{2}}P k_{+} & 0 & R_{\mathbf{k}}^\dagger& S_{\mathbf{k}}^{+\dagger} & U_{\mathbf{k}}+V_{\mathbf{k}} & \sqrt{2}R_{\mathbf{k}}^\dagger& \frac{1}{\sqrt{2}}S_{\mathbf{k}}^{+} \\
-\sqrt{\frac{1}{3}}P k_z & -\sqrt{\frac{1}{3}}P k_{-} & \frac{1}{\sqrt{2}}S_{\mathbf{k}}^{-\dagger} & \sqrt{2}V_{\mathbf{k}} & -\sqrt{\frac{3}{2}}\widetilde{S}_{\mathbf{k}}^{+\dagger} & \sqrt{2}R_{\mathbf{k}} & U_{\mathbf{k}} & C_{\mathbf{k}} \\
-\sqrt{\frac{1}{3}}P k_{+} & \sqrt{\frac{1}{3}}P k_z & -\sqrt{2}R_{\mathbf{k}}^\dagger& -\sqrt{\frac{3}{2}}\widetilde{S}_{\mathbf{k}}^{- \dagger} & -\sqrt{2}V_{\mathbf{k}} & \frac{1}{\sqrt{2}}S_{\mathbf{k}}^{+\dagger} & C_{\mathbf{k}}^\dagger& U_{\mathbf{k}}
\end{pmatrix} \tag*{(15)} H k = T k 0 − 2 1 P k − 3 2 P k z 6 1 P k + 0 − 3 1 P k z − 3 1 P k + 0 T k 0 − 6 1 P k − 3 2 P k z 2 1 P k + − 3 1 P k − 3 1 P k z − 2 1 P k + 0 U k + V k − S k −† R k † 0 2 1 S k −† − 2 R k † 3 2 P k z − 6 1 P k + − S k − U k − V k C k † R k † 2 V k − 2 3 S k −† 6 1 P k − 3 2 P k z R k C k U k − V k S k +† − 2 3 S k +† − 2 V k 0 2 1 P k − 0 R k S k + U k + V k 2 R k 2 1 S k +† − 3 1 P k z − 3 1 P k + 2 1 S k − 2 V k − 2 3 S k + 2 R k † U k C k † − 3 1 P k − 3 1 P k z − 2 R k − 2 3 S k − − 2 V k 2 1 S k + C k U k (15)
with
T k = ℏ 2 2 m ( 2 F + 1 ) ∣ k ∣ 2 T_{\mathbf{k}}=\frac{\hbar^2}{2m}(2F+1)|\mathbf{k}|^2 T k = 2 m ℏ 2 ( 2 F + 1 ) ∣ k ∣ 2
U k = − ℏ 2 2 m γ 1 ∣ k ∣ 2 V k = − ℏ 2 2 m γ 2 ( k x 2 + k y 2 − 2 k z 2 ) U_{\mathbf{k}}=-\frac{\hbar^2}{2m}\gamma_1|\mathbf{k}|^2
\qquad
V_{\mathbf{k}}=-\frac{\hbar^2}{2m}\gamma_2(k_x^2+k_y^2-2k_z^2) U k = − 2 m ℏ 2 γ 1 ∣ k ∣ 2 V k = − 2 m ℏ 2 γ 2 ( k x 2 + k y 2 − 2 k z 2 )
R k = ℏ 2 2 m 3 ( γ 2 ( k x 2 − k y 2 ) − 2 i γ 3 k x k y ) R_{\mathbf{k}}=\frac{\hbar^2}{2m}\sqrt{3}\left(\gamma_2(k_x^2-k_y^2)-2i\gamma_3k_xk_y\right) R k = 2 m ℏ 2 3 ( γ 2 ( k x 2 − k y 2 ) − 2 i γ 3 k x k y )
S k ± = − ℏ 2 2 m 3 ( k ± { γ 3 , k z } + k ± [ κ , k z ] ) S ~ k ± = − ℏ 2 2 m 3 ( k ± { γ 3 , k z } − 1 3 k ± [ κ , k z ] ) S_{\mathbf{k}}^{\pm}=-\frac{\hbar^2}{2m}\sqrt{3}\left(k_{\pm}\{\gamma_3,k_z\}+k_{\pm}[\kappa,k_z]\right)
\qquad
\widetilde{S}_{\mathbf{k}}^{\pm}=-\frac{\hbar^2}{2m}\sqrt{3}\left(k_{\pm}\{\gamma_3,k_z\}-\frac{1}{3}k_{\pm}[\kappa,k_z]\right) S k ± = − 2 m ℏ 2 3 ( k ± { γ 3 , k z } + k ± [ κ , k z ] ) S k ± = − 2 m ℏ 2 3 ( k ± { γ 3 , k z } − 3 1 k ± [ κ , k z ] )
C k = ℏ 2 2 m 2 k − [ κ , k z ] . (16) C_{\mathbf{k}}=\frac{\hbar^2}{2m}2k_{-}[\kappa,k_z]. \tag*{(16)} C k = 2 m ℏ 2 2 k − [ κ , k z ] . (16)
where ∣ k ∣ 2 = k x 2 + k y 2 + k z 2 |\mathbf{k}|^2=k_x^2+k_y^2+k_z^2 ∣ k ∣ 2 = k x 2 + k y 2 + k z 2 and k ± = k x ± i k y k_{\pm}=k_x\pm i k_y k ± = k x ± i k y . The band energies E c E_c E c , E v E_v E v and E v − Δ S O E_v-\Delta_{\mathrm{SO}} E v − Δ SO , the Kane parameter P P P , and the band structure parameters F F F , γ 1 , 2 , 3 \gamma_{1,2,3} γ 1 , 2 , 3 , κ \kappa κ are material properties, that contain contributions from couplings with remote bands.
Axial symmetry
Most of the matrix elements of Eq. (16) preserve axial symmetry, i.e., they are invariant under a rotation around the z z z axis. The only exception is R k R_{\mathbf{k}} R k , which can be expanded into an axial and nonaxial part, R k = R k a x + R k n o n a x R_{\mathbf{k}}=R_{\mathbf{k}}^{\mathrm{ax}}+R_{\mathbf{k}}^{\mathrm{nonax}} R k = R k ax + R k nonax with
R k a x = ℏ 2 2 m 3 2 ( γ 2 + γ 3 ) k + 2 , R k n o n a x = ℏ 2 2 m 3 2 ( γ 2 − γ 3 ) k + 2 . (17) R_{\mathbf{k}}^{\mathrm{ax}}=\frac{\hbar^2}{2m}\frac{\sqrt{3}}{2}(\gamma_2+\gamma_3)k_{+}^2,
\qquad
R_{\mathbf{k}}^{\mathrm{nonax}}=\frac{\hbar^2}{2m}\frac{\sqrt{3}}{2}(\gamma_2-\gamma_3)k_{+}^2. \tag*{(17)} R k ax = 2 m ℏ 2 2 3 ( γ 2 + γ 3 ) k + 2 , R k nonax = 2 m ℏ 2 2 3 ( γ 2 − γ 3 ) k + 2 . (17)
In some calculations, we use the axial approximation , where we approximate R k ≈ R k a x R_{\mathbf{k}}\approx R_{\mathbf{k}}^{\mathrm{ax}} R k ≈ R k ax and neglect the non-axial part R k n o n a x R_{\mathbf{k}}^{\mathrm{nonax}} R k nonax . We note that the non-axial contributions are significant in many cases, so that the axial approximation should be used with care. This issue will be discussed in more detail in the context of Landau levels in § 2.4 .
Band structure parameters
For the simulations in kdotpy, we use the material-dependent band structure parameters established by Refs. [2 , 3 ] , summarized in Table 1. Since kdotpy has started out as a simulation program for HgTe and CdTe, we use these materials as an example here, noting that the modelling can be applied for a much wider variety of materials. We define the band energy of the Γ 8 \Gamma_8 Γ 8 orbitals of unstrained HgTe as the reference energy E = 0 E=0 E = 0 . Thus, E v = 0 E_v=0 E v = 0 meV for HgTe by definition. The valence band energy for CdTe is determined by the valence band offset E V B O = − 570 E_{\mathrm{VBO}}=-570 E VBO = − 570 meV of CdTe with respect to HgTe. (All band energies, including the valence band offset, are treated as a material parameters in this model.)
All parameters come with substantial error bars. Especially for the Luttinger parameters γ 1 , 2 , 3 \gamma_{1,2,3} γ 1 , 2 , 3 one finds substantial variations among various literature sources [16 , 17 ] . In order to allow for adjustments of the material parameters, we have equipped kdotpy with an interface where the values can be
caption: Coefficients of the inversion-symmetric k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p Hamiltonian H k H_k H k at zero temperature. The values are adapted from Refs. [2 , 3 ] . We have taken into account the valence band offset E V B O = − 570 E_{\mathrm{VBO}}=-570 E VBO = − 570 meV for CdTe, taking E v = 0 E_v=0 E v = 0 meV for HgTe as the reference energy. These are also the default parameters implemented in kdotpy.
:::
changed in the form of a configuration file (see § 3.2.4 and Appendix § 11 .2). We have supplied the default parameters as listed in Table 1.
For ternary compounds that are formed by alloying two binary compounds for example H g 1 − x C d x T e \mathrm{Hg}_{1-x}\mathrm{Cd}_x\mathrm{Te} Hg 1 − x Cd x Te from HgTe and CdTe, we determine the parameters by suitable interpolation. These interpolations are linear to first approximation, but higher-order corrections are typically also taken into consideration. For example, the gap energy E g = E c − E v E_g=E_c-E_v E g = E c − E v for H g 1 − x C d x T e \mathrm{Hg}_{1-x}\mathrm{Cd}_x\mathrm{Te} Hg 1 − x Cd x Te is
E g ( H g 1 − x C d x T e ) = − 303 ( 1 − x ) + 1606 x − 132 x ( 1 − x ) (18) E_g(\mathrm{Hg}_{1-x}\mathrm{Cd}_x\mathrm{Te})=-303(1-x)+1606x-132x(1-x) \tag*{(18)} E g ( Hg 1 − x Cd x Te ) = − 303 ( 1 − x ) + 1606 x − 132 x ( 1 − x ) (18)
in units of meV, at zero temperature [18 , 19 ] . This expression is a quadratic perturbation to the linear interpolation, with the coefficient of the latter term being known as the bowing parameter . The Luttinger parameters γ 1 , 2 , 3 \gamma_{1,2,3} γ 1 , 2 , 3 and κ \kappa κ are approximated by cubic polynomials, approximating the result of the interpolation scheme used in Ref. [2 ] . In general, material parameters like E g E_g E g are temperature-dependent [18 , 19 ] .
Kane models with different number of orbitals
The Kane model can also be formulated with a different number of orbitals. For example, a simpler 6 × 6 6\times6 6 × 6 version can be used, where the Γ 7 \Gamma_7 Γ 7 orbitals are omitted. Another version contains 14 orbitals, which adds a quadruplet of Γ 8 \Gamma_8 Γ 8 states and a doublet of Γ 7 \Gamma_7 Γ 7 states in the conduction band. We will neither consider the 14 orbital in this work nor have implemented it into kdotpy, because the six additional orbitals add complexity that is not necessary for most purposes for which we use kdotpy. The so-called Luttinger model with only the four Γ 8 \Gamma_8 Γ 8 orbitals [20 ] is also left out of consideration because it cannot capture the essential physics of topological insulators, where Γ 6 \Gamma_6 Γ 6 and Γ 8 \Gamma_8 Γ 8 are inverted.
If one changes perspective between the 6 and 8 orbital Kane model, one needs to take into account renormalizations of the coefficients. The reason for this renormalization is that in the 6 orbital model, the Γ 7 \Gamma_7 Γ 7 orbitals become remote bands, and thus one must consider their additional perturbative contributions P n ′ n P_{n'n} P n ′ n (cf. Eqs. (5) and (6) ). This perturbation contributes to (for example) the band masses of the Γ 6 \Gamma_6 Γ 6 and Γ 8 \Gamma_8 Γ 8 orbitals. In the 8 orbital model, the Γ 7 \Gamma_7 Γ 7 orbitals are treated explicitly and thus its perturbative contribution on the other bands is absent. To ascertain that both models yield the same dispersion, the band masses of the Γ 6 \Gamma_6 Γ 6 and Γ 8 \Gamma_8 Γ 8 orbitals need to be renormalized. Similar renormalizations apply to other coefficients and between different pairs of models. Details are provided, for example, in the tables of Winkler [15 ] .
Lower dimensional geometries
So far, we have considered the Hamiltonian in terms of the momentum coordinates ( k x , k y , k z ) (k_x,k_y,k_z) ( k x , k y , k z ) . These momenta are good quantum numbers by virtue of Bloch’s theorem. For Bloch’s theorem to be valid, the system must have (discrete) translational symmetry in three dimensions. Thus, for a bulk crystal, this description is appropriate.
However, experimentally relevant systems are of finite size; thus the translational symmetry is broken. Nevertheless, if the dimensions of the system are sufficiently large, the system may still be treated as approximately infinite. The decisive criterion is the size of the system compared to the de Broglie wavelength of the particles, or equivalently, the (quantum mechanical) confinement energy compared to other energy scales in the system.
Typically, we have a ‘hybrid’ situation, where the system is infinite in some and finite in other directions. For semiconductor devices simulated by kdotpy, we typically consider ‘2D’ and ‘1D’ geometries, where n D n\mathrm{D} n D refers to the number n n n of dimensions in which the system has translational symmetry, or, in other words, the number of momentum coordinates.
A prominent example of a 2D geometry is a quantum well system. In the 2D geometry, translational symmetry is broken in z z z direction whereas it is preserved in the x x x and y y y direction. The appropriate coordinates in this geometry are thus ( k x , k y , z ) (k_x,k_y,z) ( k x , k y , z ) . This system may be thought of as an infinite slab of material. More generically, any stack of layers of different materials, called a ‘layer stack’, is described as a 2D geometry. In this case, the material parameters (like E c E_\mathrm{c} E c , E v E_\mathrm{v} E v , γ 1 , 2 , 3 \gamma_{1,2,3} γ 1 , 2 , 3 , etc.) are treated as a function of z z z .1 The material parameters are effectively constant in the bulk of each layer and transition smoothly between them at the interfaces between layers. Many important topological aspects, like surface states, can exist only at the interface between a topological and a trivial material and thus need to be simulated in the 2D geometry.
The 1D geometry is equivalent to an infinite wire, with translational symmetry only in x x x direction and a finite size both in y y y and z z z direction, with coordinates ( k x , y , z ) (k_x,y,z) ( k x , y , z ) . The extent in y y y and z z z direction must not necessarily be equal or even similar in size. Typically, in order to simulate the edge states of the quantum spin Hall effect, one considers a ‘ribbon’ or ‘strip’ of material, where the thickness is ∼ 10 n m \sim10\,\mathrm{nm} ∼ 10 nm and the width is ∼ 500 n m \sim500\,\mathrm{nm} ∼ 500 nm or larger [4 ] .
Dimensional reduction
The reduction of the bulk Hamiltonian (3D) to a lower dimensionality is a two step process for each of the confined dimensions. Firstly, the momentum coordinate in the Hamiltonian is substituted by its representation in spatial coordinates. For example, k z k_z k z is substituted by the derivative − i ∂ z -\mathrm{i}\partial_z − i ∂ z (where ∂ z = ∂ / ∂ z \partial_z = \partial/\partial z ∂ z = ∂ / ∂ z ). Likewise, k z 2 k_z^2 k z 2 is substituted by the second-order derivative − ∂ z 2 -\partial_z^2 − ∂ z 2 . These substitutions essentially encode an inverse Fourier transform. Secondly, we choose a finite basis for each spatial direction. This step is necessary, because the computational Hilbert space must be of finite dimension. Here, we specifically choose the basis defined by a finite set of points at which the wave functions are evaluated. We consider uniformly spaced grids of the form { z j } j = j min , … , j max \{z_j\}_{j=j_{\min},\ldots,j_{\max}} { z j } j = j m i n , … , j m a x , with z j = j Δ z z_j = j\Delta z z j = j Δ z , where Δ z \Delta z Δ z is the grid resolution and j j j is an integer index taken from the finite range [ j min , j max ] [j_{\min},j_{\max}] [ j m i n , j m a x ] . We note that our choice differs from the Fortran code of Refs. [2 , 3 ] , which uses a set of envelope functions based on Legendre polynomials.
In the chosen basis, the discretization of the first derivatives is given by
∂ z 2 ψ ( z ) = lim d z → 0 ψ ( z + d z ) − ψ ( z − d z ) 2 d z ≈ ψ ( z + Δ z ) − ψ ( z − Δ z ) 2 Δ z → ∂ z 2 ψ j = ψ j + 1 − ψ j − 1 2 Δ z . (19) \partial_z^2\psi(z) = \lim_{dz\to0}\frac{\psi(z+dz)-\psi(z-dz)}{2dz} \approx\frac{\psi(z+\Delta z)-\psi(z-\Delta z)}{2\Delta z} \to\partial_z^2\psi_j = \frac{\psi_{j+1}-\psi_{j-1}}{2\Delta z}. \tag*{(19)} ∂ z 2 ψ ( z ) = d z → 0 lim 2 d z ψ ( z + d z ) − ψ ( z − d z ) ≈ 2Δ z ψ ( z + Δ z ) − ψ ( z − Δ z ) → ∂ z 2 ψ j = 2Δ z ψ j + 1 − ψ j − 1 . (19)
where in the final step, we substitute z = z j z=z_j z = z j and write ψ j = ψ ( z j ) \psi_j=\psi(z_j) ψ j = ψ ( z j ) and ψ j ± 1 = ψ ( z j ± 1 ) = ψ ( z j ± Δ z ) \psi_{j\pm1}=\psi(z_{j\pm1})=\psi(z_j\pm\Delta z) ψ j ± 1 = ψ ( z j ± 1 ) = ψ ( z j ± Δ z ) . The second derivative is obtained by applying the same principle twice, but substituting d z → Δ z / 2 dz\to\Delta z/2 d z → Δ z /2 ,
∂ z 2 ψ ( z ) = lim d z → 0 ψ ( z + 2 d z ) − 2 ψ ( z ) + ψ ( z − 2 d z ) 4 d z 2 ≈ ψ ( z + Δ z ) − 2 ψ ( z ) + ψ ( z − Δ z ) Δ z 2 → ∂ z 2 ψ j = ψ j + 1 − 2 ψ j + ψ j − 1 Δ z 2 . (20) \partial_z^2\psi(z) = \lim_{dz\to0}\frac{\psi(z+2dz)-2\psi(z)+\psi(z-2dz)}{4dz^2}
\approx\frac{\psi(z+\Delta z)-2\psi(z)+\psi(z-\Delta z)}{\Delta z^2} \to\partial_z^2\psi_j = \frac{\psi_{j+1}-2\psi_j+\psi_{j-1}}{\Delta z^2}. \tag*{(20)} ∂ z 2 ψ ( z ) = d z → 0 lim 4 d z 2 ψ ( z + 2 d z ) − 2 ψ ( z ) + ψ ( z − 2 d z ) ≈ Δ z 2 ψ ( z + Δ z ) − 2 ψ ( z ) + ψ ( z − Δ z ) → ∂ z 2 ψ j = Δ z 2 ψ j + 1 − 2 ψ j + ψ j − 1 . (20)
The inverse-Fourier and discretization steps combined lead to the substitution rules
k z ψ → k ^ z ψ j = − i 2 Δ z ( ψ j + 1 − ψ j − 1 ) , (21) k_z\psi\to\hat{k}_z\psi_j = \frac{-\mathrm{i}}{2\Delta z}(\psi_{j+1}-\psi_{j-1}), \tag*{(21)} k z ψ → k ^ z ψ j = 2Δ z − i ( ψ j + 1 − ψ j − 1 ) , (21)
k z 2 ψ → k ^ z 2 ψ j = − 1 Δ z 2 ( ψ j + 1 − 2 ψ j + ψ j − 1 ) , (22) k_z^2\psi\to\hat{k}_z^2\psi_j = \frac{-1}{\Delta z^2}(\psi_{j+1}-2\psi_j+\psi_{j-1}), \tag*{(22)} k z 2 ψ → k ^ z 2 ψ j = Δ z 2 − 1 ( ψ j + 1 − 2 ψ j + ψ j − 1 ) , (22)
where we use the notation k ^ z \hat{k}_z k ^ z to emphasize that this object is an operator. The substitution rules for k y k_y k y and k y 2 k_y^2 k y 2 are analogous to those for k z k_z k z and k z 2 k_z^2 k z 2 , respectively.
Hermitian discretization
In a layered system (2D geometry), where the material parameters are functions of z z z , special care needs to be taken that these functions generally do not commute with k ^ z = − i ∂ z \hat{k}_z=-\mathrm{i}\partial_z k ^ z = − i ∂ z . For this reason, we find anticommutators and commutators of the form { Q , k z } \{Q,k_z\} { Q , k z } and [ Q , k z ] [Q,k_z] [ Q , k z ] , respectively, in the off-diagonal matrix elements of the Hamiltonian, where Q Q Q denotes a generic z z z -dependent material parameter.
The operator k ^ z \hat{k}_z k ^ z being a derivative, this leads to contributions involving ∂ z Q \partial_z Q ∂ z Q . To clarify this statement, it is useful to expand the matrix element ⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ \langle\phi|\{Q,\hat{k}_z\}|\psi\rangle ⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ in terms of its spatial representation as an integral over z z z ,
⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ = − i ∫ d z ϕ ∗ ( z ) ( Q ( z ) ∂ z + ∂ z Q ( z ) ) ψ ( z ) = − i ∫ d z ( 2 ϕ ∗ ( z ) Q ( z ) ψ ′ ( z ) + ψ ∗ ( z ) Q ′ ( z ) ψ ( z ) ) , (23) \begin{aligned}
\langle\phi|\{Q,\hat{k}_z\}|\psi\rangle&= -i\int dz\,\phi^*(z)\left(Q(z)\partial_z+\partial_zQ(z)\right)\psi(z)\\
&= -i\int dz\,\left(2\phi^*(z)Q(z)\psi'(z)+\psi^*(z)Q'(z)\psi(z)\right), \tag*{(23)}
\end{aligned} ⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ = − i ∫ d z ϕ ∗ ( z ) ( Q ( z ) ∂ z + ∂ z Q ( z ) ) ψ ( z ) = − i ∫ d z ( 2 ϕ ∗ ( z ) Q ( z ) ψ ′ ( z ) + ψ ∗ ( z ) Q ′ ( z ) ψ ( z ) ) , (23)
where a prime denotes the z z z derivative. In the same representation, invoking integration by parts and assuming that the states vanish at the boundaries of the integration domain, one can also write
⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ = − i ∫ d z ( ϕ ∗ ( z ) Q ( z ) ∂ z ψ ( z ) + ϕ ∗ ( z ) ∂ z ( Q ( z ) ψ ( z ) ) ) = − i ( ⟨ ϕ ∣ Q ∣ ∂ z ψ ⟩ − ⟨ ∂ z ϕ ∣ Q ∣ ψ ⟩ ) . (24) \langle\phi|\{Q,\hat{k}_z\}|\psi\rangle=-i\int dz\,\left(\phi^*(z)Q(z)\partial_z\psi(z)+\phi^*(z)\partial_z\left(Q(z)\psi(z)\right)\right)=-i\left(\langle\phi|Q|\partial_z\psi\rangle-\langle\partial_z\phi|Q|\psi\rangle\right). \tag*{(24)} ⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ = − i ∫ d z ( ϕ ∗ ( z ) Q ( z ) ∂ z ψ ( z ) + ϕ ∗ ( z ) ∂ z ( Q ( z ) ψ ( z ) ) ) = − i ( ⟨ ϕ ∣ Q ∣ ∂ z ψ ⟩ − ⟨ ∂ z ϕ ∣ Q ∣ ψ ⟩ ) . (24)
For the matrix element ⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ \langle\phi|[Q,\hat{k}_z]|\psi\rangle ⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ involving a commutator, we find that
⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ = − i ∫ d z ϕ ∗ ( z ) ( Q ( z ) ∂ z − ∂ z Q ( z ) ) ψ ( z ) = − i ∫ d z ϕ ∗ ( z ) Q ′ ( z ) ψ ( z ) = ⟨ ϕ ∣ Q ′ ∣ ψ ⟩ . (25) \langle\phi|[Q,\hat{k}_z]|\psi\rangle=-i\int dz\,\phi^*(z)\left(Q(z)\partial_z-\partial_zQ(z)\right)\psi(z)=-i\int dz\,\phi^*(z)Q'(z)\psi(z)=\langle\phi|Q'|\psi\rangle. \tag*{(25)} ⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ = − i ∫ d z ϕ ∗ ( z ) ( Q ( z ) ∂ z − ∂ z Q ( z ) ) ψ ( z ) = − i ∫ d z ϕ ∗ ( z ) Q ′ ( z ) ψ ( z ) = ⟨ ϕ ∣ Q ′ ∣ ψ ⟩ . (25)
In other words, the commutator [ Q , k ^ z ] [Q,\hat{k}_z] [ Q , k ^ z ] only contributes where Q ′ ( z ) ≡ ∂ z Q ( z ) Q'(z)\equiv\partial_zQ(z) Q ′ ( z ) ≡ ∂ z Q ( z ) is nonzero, which is only near the interfaces between layers, as the material parameters are constant in the bulk of each layer. The commutator terms can thus be interpreted as interface terms.
On the diagonal of the Hamiltonian, the matrix elements T k T_k T k and U k U_k U k contain effective-mass terms, quadratic in the momentum k z k_z k z . The correct substitution to operator form is given by a symmetrized triple product, in general
q k i k j → { k i q k j } S ≡ 1 2 ( k ^ i q ^ k ^ j + k ^ j q ^ k ^ i ) , (26) q k_i k_j\to\{k_i q k_j\}_{S}\equiv\frac{1}{2}\left(\hat{k}_i\hat{q}\hat{k}_j+\hat{k}_j\hat{q}\hat{k}_i\right), \tag*{(26)} q k i k j → { k i q k j } S ≡ 2 1 ( k ^ i q ^ k ^ j + k ^ j q ^ k ^ i ) , (26)
where i i i , j = x , y , z j=x,y,z j = x , y , z and q ^ \hat{q} q ^ is a hermitian operator [2 , 21 , 22 ] . For the relevant diagonal matrix elements with effective mass terms of the form Q k z 2 Qk_z^2 Q k z 2 , the substitution rule reads Q k z 2 → k ^ z Q ( z ) k ^ z Qk_z^2\to\hat{k}_zQ(z)\hat{k}_z Q k z 2 → k ^ z Q ( z ) k ^ z . In the spatial representation, these terms can be written as
⟨ ϕ ∣ k ^ z Q ^ k ^ z ∣ ψ ⟩ = − ∫ d z ϕ ∗ ( z ) ∂ z ( Q ( z ) ∂ z ψ ( z ) ) = ∫ d z ϕ ′ ∗ ( z ) Q ( z ) ψ ′ ( z ) = ⟨ ϕ ′ ∣ Q ∣ ψ ′ ⟩ , (27) \langle\phi|\hat{k}_z\hat{Q}\hat{k}_z|\psi\rangle=-\int dz\,\phi^*(z)\partial_z\left(Q(z)\partial_z\psi(z)\right)=\int dz\,\phi'^*(z)Q(z)\psi'(z)=\langle\phi'|Q|\psi'\rangle, \tag*{(27)} ⟨ ϕ ∣ k ^ z Q ^ k ^ z ∣ ψ ⟩ = − ∫ d z ϕ ∗ ( z ) ∂ z ( Q ( z ) ∂ z ψ ( z ) ) = ∫ d z ϕ ′ ∗ ( z ) Q ( z ) ψ ′ ( z ) = ⟨ ϕ ′ ∣ Q ∣ ψ ′ ⟩ , (27)
where ψ ′ ( z ) ≡ ∂ z ψ ( z ) \psi'(z)\equiv\partial_z\psi(z) ψ ′ ( z ) ≡ ∂ z ψ ( z ) .
The first-order terms are discretized as follows. We take the form of Eq. (24) and substitute ψ ( z ) → ( ψ ( z + 1 2 Δ z ) + ψ ( z − 1 2 Δ z ) ) / 2 \psi(z)\to(\psi(z+\frac{1}{2}\Delta z)+\psi(z-\frac{1}{2}\Delta z))/2 ψ ( z ) → ( ψ ( z + 2 1 Δ z ) + ψ ( z − 2 1 Δ z )) /2 and ∂ z ψ ( z ) → ( ψ ( z + 1 2 Δ z ) − ψ ( z − 1 2 Δ z ) ) / Δ z \partial_z\psi(z)\to(\psi(z+\frac{1}{2}\Delta z)-\psi(z-\frac{1}{2}\Delta z))/\Delta z ∂ z ψ ( z ) → ( ψ ( z + 2 1 Δ z ) − ψ ( z − 2 1 Δ z )) /Δ z and analogous rules for ϕ ∗ ( z ) \phi^*(z) ϕ ∗ ( z ) and ∂ z ϕ ∗ ( z ) \partial_z\phi^*(z) ∂ z ϕ ∗ ( z ) . We thus obtain
− i 2 Δ z ∑ z [ ( ϕ ∗ ( z + 1 2 Δ z ) + ϕ ∗ ( z − 1 2 Δ z ) ) Q ( z ) ( ψ ( z + 1 2 Δ z ) − ψ ( z − 1 2 Δ z ) ) − ( ϕ ∗ ( z + 1 2 Δ z ) − ϕ ∗ ( z − 1 2 Δ z ) ) Q ( z ) ( ψ ( z + 1 2 Δ z ) + ψ ( z − 1 2 Δ z ) ) ] (28) \begin{aligned}
\frac{-i}{2\Delta z}\sum_z\Big[&\left(\phi^*(z+\tfrac{1}{2}\Delta z)+\phi^*(z-\tfrac{1}{2}\Delta z)\right)Q(z)\left(\psi(z+\tfrac{1}{2}\Delta z)-\psi(z-\tfrac{1}{2}\Delta z)\right)\\
&-\left(\phi^*(z+\tfrac{1}{2}\Delta z)-\phi^*(z-\tfrac{1}{2}\Delta z)\right)Q(z)\left(\psi(z+\tfrac{1}{2}\Delta z)+\psi(z-\tfrac{1}{2}\Delta z)\right)\Big] \tag*{(28)}
\end{aligned} 2Δ z − i z ∑ [ ( ϕ ∗ ( z + 2 1 Δ z ) + ϕ ∗ ( z − 2 1 Δ z ) ) Q ( z ) ( ψ ( z + 2 1 Δ z ) − ψ ( z − 2 1 Δ z ) ) − ( ϕ ∗ ( z + 2 1 Δ z ) − ϕ ∗ ( z − 2 1 Δ z ) ) Q ( z ) ( ψ ( z + 2 1 Δ z ) + ψ ( z − 2 1 Δ z ) ) ] (28)
By expanding and erasing the terms that cancel, we find
− i Δ z ∑ z ( ϕ ∗ ( z − 1 2 Δ z ) Q ( z ) ψ ( z + 1 2 Δ z ) − ϕ ∗ ( z + 1 2 Δ z ) Q ( z ) ψ ( z − 1 2 Δ z ) ) (29) \frac{-i}{\Delta z}\sum_z\left(\phi^*(z-\tfrac{1}{2}\Delta z)Q(z)\psi(z+\tfrac{1}{2}\Delta z)-\phi^*(z+\tfrac{1}{2}\Delta z)Q(z)\psi(z-\tfrac{1}{2}\Delta z)\right) \tag*{(29)} Δ z − i z ∑ ( ϕ ∗ ( z − 2 1 Δ z ) Q ( z ) ψ ( z + 2 1 Δ z ) − ϕ ∗ ( z + 2 1 Δ z ) Q ( z ) ψ ( z − 2 1 Δ z ) ) (29)
In our computational basis, the Hilbert space is defined as the wave functions on the discrete coordinates z j z_j z j , so we must align z ± 1 2 Δ z z\pm\frac{1}{2}\Delta z z ± 2 1 Δ z with these values. This implies that Q ( z ) Q(z) Q ( z ) is evaluated at intermediate points z j ± 1 2 Δ z z_j\pm\frac{1}{2}\Delta z z j ± 2 1 Δ z , which is not a problem since Q Q Q is a function which we can evaluate anywhere. The resulting expression can be written in three equivalent forms, related by shifts of the ‘dummy variable’ j j j ,
⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ → − i Δ z ∑ j ( ϕ j ∗ Q ( z j + 1 2 Δ z ) ψ j + 1 − ϕ j ∗ Q ( z j − 1 2 Δ z ) ψ j − 1 ) (30) \langle\phi| \{Q,\hat{k}_z\} | \psi\rangle\to-\frac{\mathrm{i}}{\Delta z}\sum_j\left(\phi_j^* Q\left(z_j+\frac{1}{2}\Delta z\right)\psi_{j+1}-\phi_j^* Q\left(z_j-\frac{1}{2}\Delta z\right)\psi_{j-1}\right) \tag*{(30)} ⟨ ϕ ∣ { Q , k ^ z } ∣ ψ ⟩ → − Δ z i j ∑ ( ϕ j ∗ Q ( z j + 2 1 Δ z ) ψ j + 1 − ϕ j ∗ Q ( z j − 2 1 Δ z ) ψ j − 1 ) (30)
= − i Δ z ∑ j Q ( z j − 1 2 Δ z ) ( ϕ j − 1 ∗ ψ j − ϕ j ∗ ψ j − 1 ) (31) = -\frac{\mathrm{i}}{\Delta z}\sum_j Q\left(z_j-\frac{1}{2}\Delta z\right)\left(\phi_{j-1}^*\psi_j-\phi_j^*\psi_{j-1}\right) \tag*{(31)} = − Δ z i j ∑ Q ( z j − 2 1 Δ z ) ( ϕ j − 1 ∗ ψ j − ϕ j ∗ ψ j − 1 ) (31)
= − i Δ z ∑ j Q ( z j + 1 2 Δ z ) ( ϕ j ∗ ψ j + 1 − ϕ j + 1 ∗ ψ j ) . (32) = -\frac{\mathrm{i}}{\Delta z}\sum_j Q\left(z_j+\frac{1}{2}\Delta z\right)\left(\phi_j^*\psi_{j+1}-\phi_{j+1}^*\psi_j\right). \tag*{(32)} = − Δ z i j ∑ Q ( z j + 2 1 Δ z ) ( ϕ j ∗ ψ j + 1 − ϕ j + 1 ∗ ψ j ) . (32)
We use the first form [Eq. (30) ] to extract the action of the Hamiltonian matrix, ( H ψ ) i = ∑ j H i j ψ j (H\psi)_i=\sum_j H_{ij}\psi_j ( H ψ ) i = ∑ j H ij ψ j . From the second and third forms [Eqs. (31) ] and [(32) ], we find that the resulting Hamiltonian matrix is hermitian.
For the matrix elements of commutator form [ Q , k ^ z ] [Q,\hat{k}_z] [ Q , k ^ z ] , we simply substitute the derivative Q ′ Q' Q ′ into Eq. (25) ,
⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ → ∑ j ϕ j ∗ Q ′ ( z j ) ψ j , (33) \langle\phi| [Q,\hat{k}_z] | \psi\rangle\to\sum_j \phi_j^*Q'(z_j)\psi_j, \tag*{(33)} ⟨ ϕ ∣ [ Q , k ^ z ] ∣ ψ ⟩ → j ∑ ϕ j ∗ Q ′ ( z j ) ψ j , (33)
where Q ′ ( z j ) Q'(z_j) Q ′ ( z j ) is the derivative of Q Q Q evaluated at the grid point z j z_j z j . In kdotpy, we use the discrete derivative Q ′ ( z j ) = ( Q ′ ( z j + Δ z ) − Q ′ ( z j − Δ z ) ) / 2 Δ z Q'(z_j)=(Q'(z_j+\Delta z)-Q'(z_j-\Delta z))/2\Delta z Q ′ ( z j ) = ( Q ′ ( z j + Δ z ) − Q ′ ( z j − Δ z )) /2Δ z .
The discretization of the quadratic terms follows from Eq. (27) , where we substitute ψ ′ ( z ) = ∂ z ψ ( z ) → ( ψ ( z + 1 2 Δ z ) − ψ ( z − 1 2 Δ z ) ) / Δ z \psi'(z)=\partial_z\psi(z)\to(\psi(z+\frac{1}{2}\Delta z)-\psi(z-\frac{1}{2}\Delta z))/\Delta z ψ ′ ( z ) = ∂ z ψ ( z ) → ( ψ ( z + 2 1 Δ z ) − ψ ( z − 2 1 Δ z )) /Δ z . We thus obtain
− 1 Δ z 2 ∑ z ( ϕ ∗ ( z + 1 2 Δ z ) − ϕ ∗ ( z − 1 2 Δ z ) ) Q ( z ) ( ψ ( z + 1 2 Δ z ) − ψ ( z − 1 2 Δ z ) ) . (34) -\frac{1}{\Delta z^2}\sum_z\left(\phi^*\left(z+\frac{1}{2}\Delta z\right)-\phi^*\left(z-\frac{1}{2}\Delta z\right)\right)Q(z)\left(\psi\left(z+\frac{1}{2}\Delta z\right)-\psi\left(z-\frac{1}{2}\Delta z\right)\right). \tag*{(34)} − Δ z 2 1 z ∑ ( ϕ ∗ ( z + 2 1 Δ z ) − ϕ ∗ ( z − 2 1 Δ z ) ) Q ( z ) ( ψ ( z + 2 1 Δ z ) − ψ ( z − 2 1 Δ z ) ) . (34)
We expand and align z ± 1 2 Δ z z\pm\frac{1}{2}\Delta z z ± 2 1 Δ z with the discrete coordinates z j z_j z j , and obtain
⟨ ϕ ∣ k ^ z Q k ^ z ∣ ψ ⟩ → 1 Δ z 2 ∑ j ( ϕ j ∗ Q ( z j + 1 2 Δ z ) ( ψ j + 1 − ψ j ) + ϕ j ∗ Q ( z j − 1 2 Δ z ) ( ψ j − 1 − ψ j ) ) (35) \langle\phi|\hat{k}_zQ\hat{k}_z|\psi\rangle\to\frac{1}{\Delta z^2}\sum_j\left(\phi_j^*Q\left(z_j+\frac{1}{2}\Delta z\right)(\psi_{j+1}-\psi_j)+\phi_j^*Q\left(z_j-\frac{1}{2}\Delta z\right)(\psi_{j-1}-\psi_j)\right) \tag*{(35)} ⟨ ϕ ∣ k ^ z Q k ^ z ∣ ψ ⟩ → Δ z 2 1 j ∑ ( ϕ j ∗ Q ( z j + 2 1 Δ z ) ( ψ j + 1 − ψ j ) + ϕ j ∗ Q ( z j − 2 1 Δ z ) ( ψ j − 1 − ψ j ) ) (35)
= − 1 Δ z 2 ∑ j ( ϕ j ∗ − ϕ j − 1 ∗ ) Q ( z j − 1 2 Δ z ) ( ψ j − ψ j − 1 ) (36) =-\frac{1}{\Delta z^2}\sum_j(\phi_j^*-\phi_{j-1}^*)Q\left(z_j-\frac{1}{2}\Delta z\right)(\psi_j-\psi_{j-1}) \tag*{(36)} = − Δ z 2 1 j ∑ ( ϕ j ∗ − ϕ j − 1 ∗ ) Q ( z j − 2 1 Δ z ) ( ψ j − ψ j − 1 ) (36)
= − 1 Δ z 2 ∑ j ( ϕ j + 1 ∗ − ϕ j ∗ ) Q ( z j + 1 2 Δ z ) ( ψ j + 1 − ψ j ) . (37) =-\frac{1}{\Delta z^2}\sum_j(\phi_{j+1}^*-\phi_j^*)Q\left(z_j+\frac{1}{2}\Delta z\right)(\psi_{j+1}-\psi_j). \tag*{(37)} = − Δ z 2 1 j ∑ ( ϕ j + 1 ∗ − ϕ j ∗ ) Q ( z j + 2 1 Δ z ) ( ψ j + 1 − ψ j ) . (37)
The first form [Eq. (35) ] again defines the action of the Hamiltonian matrix ( H ψ ) i = ∑ j H i j ψ j (H\psi)_i=\sum_j H_{ij}\psi_j ( H ψ ) i = ∑ j H ij ψ j and the second and third forms [Eqs. (36) ] and [(37) ] show that the expression is hermitian if ψ = ϕ \psi=\phi ψ = ϕ .
Magnetic fields
Peierls substitution
In (classical) Hamiltonian mechanics, the motion of a charged particle with dispersion p 2 / 2 m p^2/2m p 2 /2 m and charge − e -e − e in a magnetic field B \mathbf{B} B is given by
H = 1 2 m ( p + e A ) 2 , (38) H=\frac{1}{2m}(\mathbf{p}+e\mathbf{A})^2, \tag*{(38)} H = 2 m 1 ( p + e A ) 2 , (38)
in terms of the magnetic gauge field A \mathbf{A} A that satisfies B = ∇ × A \mathbf{B}=\nabla\times\mathbf{A} B = ∇ × A . In this expression, p \mathbf{p} p acts as the canonical momentum, while Π = p + e A \mathbf{\Pi}=\mathbf{p}+e\mathbf{A} Π = p + e A is the kinetic momentum, equal to mass times velocity. In order to obtain the Hamiltonian for the motion of a particle in a magnetic field from a generic zero-field Hamiltonian, one applies the Peierls substitution
p → Π = p + e A , (39) \mathbf{p}\to\mathbf{\Pi}=\mathbf{p}+e\mathbf{A}, \tag*{(39)} p → Π = p + e A , (39)
or equivalently, k → k + ( e / ℏ ) A \mathbf{k}\to\mathbf{k}+(e/\hbar)\mathbf{A} k → k + ( e /ℏ ) A .
The electromagnetic gauge field A \mathbf{A} A is subject to gauge invariance by the transformation A → A + ∇ Λ \mathbf{A}\to\mathbf{A}+\nabla\Lambda A → A + ∇Λ where Λ \Lambda Λ is a function depending on the spatial coordinates. This gauge transformation does not alter the relation B = ∇ × A \mathbf{B}=\nabla\times\mathbf{A} B = ∇ × A . (Here, and in the remainder of the work, we assume that B \mathbf{B} B and A \mathbf{A} A are not time-dependent.) This leaves us with a freedom to choose the gauge conveniently. For example, for a perpendicular magnetic field B = ( 0 , 0 , B z ) \mathbf{B}=(0,0,B_z) B = ( 0 , 0 , B z ) , two common gauge choices are the symmetric gauge A = B z ( − y / 2 , x / 2 , 0 ) \mathbf{A}=B_z(-y/2,x/2,0) A = B z ( − y /2 , x /2 , 0 ) and the Lorentz gauge A = B z ( − y , 0 , 0 ) \mathbf{A}=B_z(-y,0,0) A = B z ( − y , 0 , 0 ) . For the numerical simulations, one should notice that the symmetric gauge breaks translational invariance in x x x and y y y direction, while the Lorentz gauge breaks it in y y y direction only. Thus, for simulations of a device in a magnetic field, kdotpy uses the Lorentz gauge so that the translational symmetry in x x x direction is left intact. This simulation is done in the strip geometry, i.e., the 1D geometry with momentum coordinates k x k_x k x and spatial coordinates y y y and z z z .
For in-plane fields B = ( B x , B y , 0 ) \mathbf{B}=(B_x,B_y,0) B = ( B x , B y , 0 ) , on similar grounds we choose a gauge that depends only on the z z z coordinate, leaving translational symmetries in x x x and y y y directions intact (if they are not yet broken by some other means). The gauge that satisfies this property is A = ( B y z , − B x z , 0 ) \mathbf{A}=(B_yz,-B_xz,0) A = ( B y z , − B x z , 0 ) . For generic magnetic fields B = ( B x , B y , B z ) \mathbf{B}=(B_x,B_y,B_z) B = ( B x , B y , B z ) we simply take the sum of in-plane and out-of-plane, and use the gauge
A = ( B y z − B z y , − B x z , 0 ) . (40) \mathbf{A}=(B_yz-B_zy,-B_xz,0). \tag*{(40)} A = ( B y z − B z y , − B x z , 0 ) . (40)
The appropriate geometry for the simulations depends on the out-of-plane component: If B z ≠ 0 B_z\ne0 B z = 0 , a 1D geometry is needed, while for a purely in-plane field, the 2D geometry is typically the appropriate one.
In quantum mechanics, the momentum and gauge fields discussed above must be replaced by the appropriate operators. Importantly, the momentum k ^ \hat{\mathbf{k}} k ^ and gauge field A ^ \hat{\mathbf{A}} A ^ operators (which is a function of spatial coordinates) do not commute in general. We quantize the quadratic terms in a symmetric way
( k i + e ℏ A i ) ( k j + e ℏ A j ) → k ^ i k ^ j + e ℏ ( k ^ i A j + k ^ j A i ) + ( e ℏ ) 2 A i A j (41) \left(k_i+\frac{e}{\hbar}A_i\right)\left(k_j+\frac{e}{\hbar}A_j\right)\to\hat{k}_i\hat{k}_j+\frac{e}{\hbar}\left(\hat{k}_iA_j+\hat{k}_jA_i\right)+\left(\frac{e}{\hbar}\right)^2A_iA_j \tag*{(41)} ( k i + ℏ e A i ) ( k j + ℏ e A j ) → k ^ i k ^ j + ℏ e ( k ^ i A j + k ^ j A i ) + ( ℏ e ) 2 A i A j (41)
= − ∂ i ∂ j − i e ℏ ( ∂ i A j + ∂ j A i + A i ∂ j + A j ∂ i ) + ( e ℏ ) 2 A i A j (42) =-\partial_i\partial_j-\mathrm{i}\frac{e}{\hbar}\left(\partial_iA_j+\partial_jA_i+A_i\partial_j+A_j\partial_i\right)+\left(\frac{e}{\hbar}\right)^2A_iA_j \tag*{(42)} = − ∂ i ∂ j − i ℏ e ( ∂ i A j + ∂ j A i + A i ∂ j + A j ∂ i ) + ( ℏ e ) 2 A i A j (42)
with i , j = x , y , z i,j=x,y,z i , j = x , y , z , because this form assures that the Hamiltonian is hermitian [23 ] . The Hamiltonian is gauge invariant under the gauge transformation A → A + ∇ Λ \mathbf{A}\to\mathbf{A}+\nabla\Lambda A → A + ∇Λ and ∣ ψ ⟩ → exp ( − i e Λ / ℏ ) ∣ ψ ⟩ \lvert\psi\rangle\to\exp(-\mathrm{i}e\Lambda/\hbar)\lvert\psi\rangle ∣ ψ ⟩ → exp ( − i e Λ/ℏ ) ∣ ψ ⟩ , where Λ \Lambda Λ is a function of the spatial coordinates [23 ] .
Importantly, the kinetic momentum operators do not commute,
[ k i + e ℏ A i , k j + e ℏ A j ] = − i e ℏ ( ∂ i A j − ∂ j A i ) = − i e ℏ ∑ k ε i j k B k , (43) \left[k_i+\frac{e}{\hbar}A_i,k_j+\frac{e}{\hbar}A_j\right]=-\mathrm{i}\frac{e}{\hbar}\left(\partial_iA_j-\partial_jA_i\right)=-\mathrm{i}\frac{e}{\hbar}\sum_k\varepsilon_{ijk}B_k, \tag*{(43)} [ k i + ℏ e A i , k j + ℏ e A j ] = − i ℏ e ( ∂ i A j − ∂ j A i ) = − i ℏ e k ∑ ε ij k B k , (43)
which raises the question how terms of the form ( k i + ( e / ℏ ) A i ) ( k j + ( e / ℏ ) A j ) (k_i+(e/\hbar)A_i)(k_j+(e/\hbar)A_j) ( k i + ( e /ℏ ) A i ) ( k j + ( e /ℏ ) A j ) should be quantized. Obviously, if i = j i=j i = j , there is no ambiguity. For the off-diagonal terms, we assume the following quantization rules
k ± 2 → ( k ^ x ) 2 − ( k ^ y ) 2 ± i ( k ^ x k ^ y + k ^ y k ^ x ) = − ∂ x 2 + ∂ y 2 ∓ 2 i ∂ x ∂ y + 2 e ℏ ( A x ± i A y ) ( − i ∂ x ± ∂ y ) + e ℏ B z + ( e ℏ ) 2 ( A x ± i A y ) 2 (44) \begin{aligned}
k_\pm^2\to(\hat{k}_x)^2-(\hat{k}_y)^2\pm\mathrm{i}(\hat{k}_x\hat{k}_y+\hat{k}_y\hat{k}_x) \\
&=-\partial_x^2+\partial_y^2\mp2\mathrm{i}\partial_x\partial_y+2\frac{e}{\hbar}(A_x\pm\mathrm{i}A_y)(-\mathrm{i}\partial_x\pm\partial_y)+\frac{e}{\hbar}B_z+\left(\frac{e}{\hbar}\right)^2(A_x\pm\mathrm{i}A_y)^2 \tag*{(44)}
\end{aligned} k ± 2 → ( k ^ x ) 2 − ( k ^ y ) 2 ± i ( k ^ x k ^ y + k ^ y k ^ x ) = − ∂ x 2 + ∂ y 2 ∓ 2 i ∂ x ∂ y + 2 ℏ e ( A x ± i A y ) ( − i ∂ x ± ∂ y ) + ℏ e B z + ( ℏ e ) 2 ( A x ± i A y ) 2 (44)
k ± k z → 1 2 { k ^ x ± i k ^ y , k ^ z } = − i ( ∂ x ± i ∂ y ) ∂ z − e ℏ ( A x ± i A y ) ∂ z + e 2 ℏ ( B x ± i B y ) (45) \begin{aligned}
k_\pm k_z\to\frac{1}{2}\{\hat{k}_x\pm\mathrm{i}\hat{k}_y,\hat{k}_z\} \\
&=-\mathrm{i}(\partial_x\pm\mathrm{i}\partial_y)\partial_z-\frac{e}{\hbar}(A_x\pm\mathrm{i}A_y)\partial_z+\frac{e}{2\hbar}(B_x\pm\mathrm{i}B_y) \tag*{(45)}
\end{aligned} k ± k z → 2 1 { k ^ x ± i k ^ y , k ^ z } = − i ( ∂ x ± i ∂ y ) ∂ z − ℏ e ( A x ± i A y ) ∂ z + 2ℏ e ( B x ± i B y ) (45)
where we have defined k ^ i ′ = k ^ i + ( e / ℏ ) A i \hat{k}'_i=\hat{k}_i+(e/\hbar)A_i k ^ i ′ = k ^ i + ( e /ℏ ) A i and we have assumed the gauge defined by Eq. (40) . The terms e B z / ℏ eB_z/\hbar e B z /ℏ and e ( B x ± i B y ) / 2 ℏ e(B_x\pm\mathrm{i}B_y)/2\hbar e ( B x ± i B y ) /2ℏ in Eqs. (44) and (45) , respectively, can be interpreted as originating from the non-commutative nature of the kinetic momentum operators. For the sake of doing the numerics, we further substitute A x ± i A y = ( B y ∓ i B x ) z − B z y = ∓ i ( B x ± i B y ) z − B z y A_x\pm\mathrm{i}A_y=(B_y\mp\mathrm{i}B_x)z-B_zy=\mp\mathrm{i}(B_x\pm\mathrm{i}B_y)z-B_zy A x ± i A y = ( B y ∓ i B x ) z − B z y = ∓ i ( B x ± i B y ) z − B z y .
Out-of-plane magnetic field in strip geometry
The case of a pure out-of-plane field, B = ( 0 , 0 , B z ) \mathbf{B}=(0,0,B_z) B = ( 0 , 0 , B z ) , can be treated in the strip geometry, i.e., the 1D case with coordinates ( k x , y , z ) (k_x,y,z) ( k x , y , z ) . We choose the gauge A = ( A x , 0 , 0 ) \mathbf{A}=(A_x,0,0) A = ( A x , 0 , 0 ) with A x = − B z ( y − y 0 ) A_x=-B_z(y-y_0) A x = − B z ( y − y 0 ) , where the gauge origin y 0 y_0 y 0 can be freely chosen.
In kdotpy, we choose y 0 = 0 y_0=0 y 0 = 0 to be the centre of the strip, so that A x A_x A x is antisymmetric under reflection in y y y . The momentum coordinate is simply shifted according to the Peierls substitution, $k_x\to k x − ( e / ℏ ) B z y k_x-(e/\hbar)B_z y k x − ( e /ℏ ) B z y . The operators k ^ ± 2 \hat{k}_{\pm}^{2} k ^ ± 2 are calculated along similar lines as Eq. (44) , but with k ^ x ′ = k x − ( e B z / ℏ ) y \hat{k}'_x=k_x-(eB_z/\hbar)y k ^ x ′ = k x − ( e B z /ℏ ) y ,
k ^ ± 2 → ( k x − e B z ℏ y ) 2 ± 2 i ( k x − e B z ℏ y ) ( − i ∂ y ) + ∂ y 2 ± e B z ℏ . (46) \hat{k}_{\pm}^{2}\rightarrow\left(k_x-\frac{eB_z}{\hbar}y\right)^2\pm2i\left(k_x-\frac{eB_z}{\hbar}y\right)(-i\partial_y)+\partial_y^2\pm\frac{eB_z}{\hbar}. \tag*{(46)} k ^ ± 2 → ( k x − ℏ e B z y ) 2 ± 2 i ( k x − ℏ e B z y ) ( − i ∂ y ) + ∂ y 2 ± ℏ e B z . (46)
We describe its action in the Hilbert space defined by the discrete coordinates ( y i , z j ) (y_i,z_j) ( y i , z j ) on a grid with resolutions ( Δ y , Δ z ) (\Delta y,\Delta z) ( Δ y , Δ z ) as the matrix element
⟨ ϕ ∣ k ^ ± 2 ∣ ψ ⟩ = ∑ i , j ϕ i , j ∗ [ ( k x − e B z ℏ y ) 2 ψ i , j ± 2 ( k x − e B z ℏ y ) ( ψ i + 1 , j − ψ i − 1 , j 2 Δ y ) − ψ i + 1 , j − 2 ψ i , j + ψ i − 1 , j ( Δ y ) 2 ± e B z 2 ℏ ( ψ i + 1 , j + ψ i − 1 , j ) ] (47) \langle\phi|\hat{k}_{\pm}^{2}|\psi\rangle=\sum_{i,j}\phi_{i,j}^{*}\left[\left(k_x-\frac{eB_z}{\hbar}y\right)^2\psi_{i,j}\pm2\left(k_x-\frac{eB_z}{\hbar}y\right)\left(\frac{\psi_{i+1,j}-\psi_{i-1,j}}{2\Delta y}\right)-\frac{\psi_{i+1,j}-2\psi_{i,j}+\psi_{i-1,j}}{(\Delta y)^2}\pm\frac{eB_z}{2\hbar}\left(\psi_{i+1,j}+\psi_{i-1,j}\right)\right] \tag*{(47)} ⟨ ϕ ∣ k ^ ± 2 ∣ ψ ⟩ = i , j ∑ ϕ i , j ∗ [ ( k x − ℏ e B z y ) 2 ψ i , j ± 2 ( k x − ℏ e B z y ) ( 2Δ y ψ i + 1 , j − ψ i − 1 , j ) − ( Δ y ) 2 ψ i + 1 , j − 2 ψ i , j + ψ i − 1 , j ± 2ℏ e B z ( ψ i + 1 , j + ψ i − 1 , j ) ] (47)
= ∑ i , j [ ϕ i , j ∗ ( k x − e B z ℏ y ) 2 ∓ ϕ i + 1 , j ∗ − ϕ i − 1 , j ∗ 2 Δ y ( k x − e B z ℏ y ) − ϕ i + 1 , j ∗ − 2 ϕ i , j ∗ + ϕ i − 1 , j ∗ ( Δ y ) 2 ± e B z 2 ℏ ( ϕ i + 1 , j ∗ + ϕ i − 1 , j ∗ ) ] ψ i , j (48) =\sum_{i,j}\left[\phi_{i,j}^{*}\left(k_x-\frac{eB_z}{\hbar}y\right)^2\mp\frac{\phi_{i+1,j}^{*}-\phi_{i-1,j}^{*}}{2\Delta y}\left(k_x-\frac{eB_z}{\hbar}y\right)-\frac{\phi_{i+1,j}^{*}-2\phi_{i,j}^{*}+\phi_{i-1,j}^{*}}{(\Delta y)^2}\pm\frac{eB_z}{2\hbar}\left(\phi_{i+1,j}^{*}+\phi_{i-1,j}^{*}\right)\right]\psi_{i,j} \tag*{(48)} = i , j ∑ [ ϕ i , j ∗ ( k x − ℏ e B z y ) 2 ∓ 2Δ y ϕ i + 1 , j ∗ − ϕ i − 1 , j ∗ ( k x − ℏ e B z y ) − ( Δ y ) 2 ϕ i + 1 , j ∗ − 2 ϕ i , j ∗ + ϕ i − 1 , j ∗ ± 2ℏ e B z ( ϕ i + 1 , j ∗ + ϕ i − 1 , j ∗ ) ] ψ i , j (48)
where ψ i , j ≡ ψ ( y i , z j ) \psi_{i,j}\equiv\psi(y_i,z_j) ψ i , j ≡ ψ ( y i , z j ) . Equation (47) is implemented as matrix element in kdotpy. Equation (48) is the conjugate form obtained from Eq. (47) by shifting the dummy variables i → i ± 1 i\to i\pm1 i → i ± 1 and y → y ± Δ y y\to y\pm\Delta y y → y ± Δ y . Note that the variable shift yields a contribution ( e B z / ℏ ) ( ϕ i + 1 , j ∗ + ϕ i − 1 , j ∗ ) ψ i , j (eB_z/\hbar)(\phi_{i+1,j}^{*}+\phi_{i-1,j}^{*})\psi_{i,j} ( e B z /ℏ ) ( ϕ i + 1 , j ∗ + ϕ i − 1 , j ∗ ) ψ i , j from the second term, which has the same structure as the final term. For this reason, we use the non-diagonal form ∓ ( e B z / 2 ℏ ) ϕ i , j ∗ ( ψ i + 1 , j + ψ i − 1 , j ) \mp(eB_z/2\hbar)\phi_{i,j}^{*}(\psi_{i+1,j}+\psi_{i-1,j}) ∓ ( e B z /2ℏ ) ϕ i , j ∗ ( ψ i + 1 , j + ψ i − 1 , j ) for the matrix element of the final term, and not the diagonal form ∓ ( e B z / ℏ ) ϕ i , j ∗ ψ i , j \mp(eB_z/\hbar)\phi_{i,j}^{*}\psi_{i,j} ∓ ( e B z /ℏ ) ϕ i , j ∗ ψ i , j as one could have expected naively.
In-plane magnetic field in slab and strip geometries
Let us consider a pure in-plane field, B = ( B x , B y , 0 ) \mathbf{B}=(B_x,B_y,0) B = ( B x , B y , 0 ) . The gauge choice is A = ( A x , A y , 0 ) \mathbf{A}=(A_x,A_y,0) A = ( A x , A y , 0 ) with A x = B y ( z − z 0 ) A_x=B_y(z-z_0) A x = B y ( z − z 0 ) and A y = − B x ( z − z 0 ) A_y=-B_x(z-z_0) A y = − B x ( z − z 0 ) . For kdotpy we choose z 0 = 0 z_0=0 z 0 = 0 , i.e., the centre of the layer stack.
In the slab (2D) geometry, k ^ ± 2 \hat{k}_{\pm}^{2} k ^ ± 2 simply evaluates as ( k x ′ ) 2 − ( k y ′ ) 2 ± 2 i k x ′ k y ′ (k_x')^2-(k_y')^2\pm2ik_x'k_y' ( k x ′ ) 2 − ( k y ′ ) 2 ± 2 i k x ′ k y ′ with k x ′ = k x + ( e B y / ℏ ) z k_x'=k_x+(eB_y/\hbar)z k x ′ = k x + ( e B y /ℏ ) z and k y ′ = k y − ( e B x / ℏ ) z k_y'=k_y-(eB_x/\hbar)z k y ′ = k y − ( e B x /ℏ ) z . With k ± ′ = k x ′ ± i k y ′ k_{\pm}'=k_x'\pm ik_y' k ± ′ = k x ′ ± i k y ′ and B ± = B x ± i B y B_{\pm}=B_x\pm iB_y B ± = B x ± i B y , we find k ± ′ = k ± ± i ( e B ± / ℏ ) z k_{\pm}'=k_{\pm}\pm i(eB_{\pm}/\hbar)z k ± ′ = k ± ± i ( e B ± /ℏ ) z . For the S ± † S_{\pm}^{\dagger} S ± † matrix elements in the Hamiltonian, we consider k ± ′ { γ 3 , k ^ z } k_{\pm}'\{\gamma_3,\hat{k}_z\} k ± ′ { γ 3 , k ^ z } . Combining Eqs. (30) and (45) , we find the matrix element
⟨ ϕ ∣ k ± ′ { γ 3 , k ^ z } ∣ ψ ⟩ = ∑ j ϕ j ∗ [ i Δ z ( k ± ± i e B ± ℏ z ) ( γ 3 ( z + 1 2 Δ z ) ψ j + 1 − γ 3 ( z − 1 2 Δ z ) ψ j − 1 ) ± e B ± 2 ℏ ( γ 3 ( z + 1 2 Δ z ) ψ j + 1 + γ 3 ( z − 1 2 Δ z ) ψ j − 1 ) ] (49) \langle\phi|k_{\pm}'\{\gamma_3,\hat{k}_z\}|\psi\rangle=\sum_j\phi_j^{*}\left[\frac{i}{\Delta z}\left(k_{\pm}\pm i\frac{eB_{\pm}}{\hbar}z\right)\left(\gamma_3\left(z+\frac{1}{2}\Delta z\right)\psi_{j+1}-\gamma_3\left(z-\frac{1}{2}\Delta z\right)\psi_{j-1}\right)\pm\frac{eB_{\pm}}{2\hbar}\left(\gamma_3\left(z+\frac{1}{2}\Delta z\right)\psi_{j+1}+\gamma_3\left(z-\frac{1}{2}\Delta z\right)\psi_{j-1}\right)\right] \tag*{(49)} ⟨ ϕ ∣ k ± ′ { γ 3 , k ^ z } ∣ ψ ⟩ = j ∑ ϕ j ∗ [ Δ z i ( k ± ± i ℏ e B ± z ) ( γ 3 ( z + 2 1 Δ z ) ψ j + 1 − γ 3 ( z − 2 1 Δ z ) ψ j − 1 ) ± 2ℏ e B ± ( γ 3 ( z + 2 1 Δ z ) ψ j + 1 + γ 3 ( z − 2 1 Δ z ) ψ j − 1 ) ] (49)
= ∑ j [ i Δ z ( k ± ± i e B ± ℏ z ) ( ϕ j + 1 ∗ γ 3 ( z + 1 2 Δ z ) − ϕ j − 1 ∗ γ 3 ( z − 1 2 Δ z ) ) ± e B ± 2 ℏ ( ϕ j + 1 ∗ γ 3 ( z + 1 2 Δ z ) + ϕ j − 1 ∗ γ 3 ( z − 1 2 Δ z ) ) ] ψ j (50) =\sum_j\left[\frac{i}{\Delta z}\left(k_{\pm}\pm i\frac{eB_{\pm}}{\hbar}z\right)\left(\phi_{j+1}^{*}\gamma_3\left(z+\frac{1}{2}\Delta z\right)-\phi_{j-1}^{*}\gamma_3\left(z-\frac{1}{2}\Delta z\right)\right)\pm\frac{eB_{\pm}}{2\hbar}\left(\phi_{j+1}^{*}\gamma_3\left(z+\frac{1}{2}\Delta z\right)+\phi_{j-1}^{*}\gamma_3\left(z-\frac{1}{2}\Delta z\right)\right)\right]\psi_j \tag*{(50)} = j ∑ [ Δ z i ( k ± ± i ℏ e B ± z ) ( ϕ j + 1 ∗ γ 3 ( z + 2 1 Δ z ) − ϕ j − 1 ∗ γ 3 ( z − 2 1 Δ z ) ) ± 2ℏ e B ± ( ϕ j + 1 ∗ γ 3 ( z + 2 1 Δ z ) + ϕ j − 1 ∗ γ 3 ( z − 2 1 Δ z ) ) ] ψ j (50)
where k ± ′ = k ± ± i ( e B ± / ℏ ) z k_{\pm}'=k_{\pm}\pm i(eB_{\pm}/\hbar)z k ± ′ = k ± ± i ( e B ± /ℏ ) z and ψ j ≡ ψ ( z j ) \psi_j\equiv\psi(z_j) ψ j ≡ ψ ( z j ) . Again, these two expressions are related by a shift in variables j → j ± 1 j\to j\pm1 j → j ± 1 and z → z ± Δ z z\to z\pm\Delta z z → z ± Δ z .
In the strip geometry, we obtain ⟨ ϕ ∣ k ± ′ { γ 3 , k ^ z } ∣ ψ ⟩ \langle\phi|k_{\pm}'\{\gamma_3,\hat{k}_z\}|\psi\rangle ⟨ ϕ ∣ k ± ′ { γ 3 , k ^ z } ∣ ψ ⟩ by simply substituting k y → k ^ y k_y\to\hat{k}_y k y → k ^ y , where k ^ y ψ i , j = − i ( ψ i + 1 , j − ψ i − 1 , j ) / Δ y \hat{k}_y\psi_{i,j}=-i(\psi_{i+1,j}-\psi_{i-1,j})/\Delta y k ^ y ψ i , j = − i ( ψ i + 1 , j − ψ i − 1 , j ) /Δ y . The bracketed parts in Eqs. (49) and (50) do not contain y y y -dependent terms other than the wave functions ϕ \phi ϕ and ψ \psi ψ ; k ^ y \hat{k}_y k ^ y commutes with the other factors.
Generic magnetic fields
For a generic magnetic field B = ( B x , B y , B z ) \mathbf{B}=(B_x,B_y,B_z) B = ( B x , B y , B z ) , we can straightforwardly adapt the equations above. For the k ^ ± 2 \hat{k}_{\pm}^{2} k ^ ± 2 terms, we simply make the substitutions k ^ x ′ = k x − ( e B z / ℏ ) y + ( e B y / ℏ ) z \hat{k}'_x=k_x-(eB_z/\hbar)y+(eB_y/\hbar)z k ^ x ′ = k x − ( e B z /ℏ ) y + ( e B y /ℏ ) z and k ^ y ′ = − i ∂ y − ( e B x / ℏ ) z \hat{k}'_y=-i\partial_y-(eB_x/\hbar)z k ^ y ′ = − i ∂ y − ( e B x /ℏ ) z , adding the in-plane component of the field to the gauge compared to Eq. (44) . The derivative ∂ y \partial_y ∂ y commutes with the terms proportional with z z z , hence no extra terms of the form e B x / ℏ eB_x/\hbar e B x /ℏ or e B y / ℏ eB_y/\hbar e B y /ℏ (constant in space) appear. Likewise, for k ± ′ { γ 3 , k ^ z } k_{\pm}'\{\gamma_3,\hat{k}_z\} k ± ′ { γ 3 , k ^ z } , the out-of-plane component appears as an extra term ( e B z / ℏ ) y (eB_z/\hbar)y ( e B z /ℏ ) y in k x + ( e / ℏ ) A x k_x+(e/\hbar)A_x k x + ( e /ℏ ) A x compared to Eqs. (49) and (50) . This term commutes with ∂ z \partial_z ∂ z .
Landau level formalism
Out-of-plane field in the axial approximation
If the magnetic field is purely out-of-plane, we have the commutator relation [ k ^ − ′ , k ^ + ′ ] = 2 e B z / ℏ [\hat{k}'_{-},\hat{k}'_{+}] = 2eB_z/\hbar [ k ^ − ′ , k ^ + ′ ] = 2 e B z /ℏ while k ^ z ′ \hat{k}'_z k ^ z ′ commutes with both k ^ x ′ \hat{k}'_x k ^ x ′ and k ^ y ′ \hat{k}'_y k ^ y ′ . This structure is formally equivalent to the ladder operators of the harmonic oscillator with commutation relation [ a , a † ] = 1 [a,a^\dagger] = 1 [ a , a † ] = 1 , if we define
a = ℏ 2 e B z k ^ − ′ = 1 2 l B k ^ − ′ , a † = ℏ 2 e B z k ^ + ′ = 1 2 l B k ^ + ′ , (51) a = \sqrt{\frac{\hbar}{2eB_z}}\hat{k}'_{-} = \frac{1}{\sqrt{2}}l_B\hat{k}'_{-}, \qquad a^\dagger= \sqrt{\frac{\hbar}{2eB_z}}\hat{k}'_{+} = \frac{1}{\sqrt{2}}l_B\hat{k}'_{+}, \tag*{(51)} a = 2 e B z ℏ k ^ − ′ = 2 1 l B k ^ − ′ , a † = 2 e B z ℏ k ^ + ′ = 2 1 l B k ^ + ′ , (51)
where l B = ℏ / e B z l_B = \sqrt{\hbar/eB_z} l B = ℏ/ e B z is the magnetic length. (Here, we have tacitly assumed B z > 0 B_z > 0 B z > 0 .) The eigenstates of the number operator a † a a^\dagger a a † a are denoted ∣ n ⟩ |n\rangle ∣ n ⟩ , where n n n is the eigenvalue, i.e., a † a ∣ n ⟩ = n ∣ n ⟩ a^\dagger a|n\rangle= n|n\rangle a † a ∣ n ⟩ = n ∣ n ⟩ . The raising and lowering operator act as a † ∣ n ⟩ = n + 1 ∣ n + 1 ⟩ a^\dagger|n\rangle= \sqrt{n+1}|n+1\rangle a † ∣ n ⟩ = n + 1 ∣ n + 1 ⟩ and a ∣ n ⟩ = n − 1 ∣ n − 1 ⟩ a|n\rangle= \sqrt{n-1}|n-1\rangle a ∣ n ⟩ = n − 1 ∣ n − 1 ⟩ , respectively.
In this context, these eigenstates are called Landau level states (see, e.g., Refs. [2 , 3 ] ). The Hamiltonian can be reformulated in terms of ladder operators by substituting k + k_+ k + and k − k_- k − by a † a^\dagger a † and a a a , respectively. The combination k x 2 + k y 2 = 1 2 ( k + k − + k − k + ) k_x^2 + k_y^2 = \frac{1}{2}(k_+k_- + k_-k_+) k x 2 + k y 2 = 2 1 ( k + k − + k − k + ) is substituted by a term proportional to a † a + a a † = 2 n + 1 a^\dagger a + aa^\dagger= 2n + 1 a † a + a a † = 2 n + 1 .
It can be shown [2 , 3 ] that in the axial approximation, the eigenstates of the Hamiltonian can be written in the form
∣ Ψ ( n ) ⟩ = ( f 1 ( n ) ( z ) ∣ n ⟩ f 2 ( n ) ( z ) ∣ n + 1 ⟩ f 3 ( n ) ( z ) ∣ n − 1 ⟩ f 4 ( n ) ( z ) ∣ n ⟩ f 5 ( n ) ( z ) ∣ n + 1 ⟩ f 6 ( n ) ( z ) ∣ n + 2 ⟩ f 7 ( n ) ( z ) ∣ n ⟩ f 8 ( n ) ( z ) ∣ n + 1 ⟩ ) , (52) |\Psi^{(n)}\rangle=
\begin{pmatrix}
f_1^{(n)}(z)|n\rangle\\
f_2^{(n)}(z)|n+1\rangle\\
f_3^{(n)}(z)|n-1\rangle\\
f_4^{(n)}(z)|n\rangle\\
f_5^{(n)}(z)|n+1\rangle\\
f_6^{(n)}(z)|n+2\rangle\\
f_7^{(n)}(z)|n\rangle\\
f_8^{(n)}(z)|n+1\rangle
\end{pmatrix}, \tag*{(52)} ∣ Ψ ( n ) ⟩ = f 1 ( n ) ( z ) ∣ n ⟩ f 2 ( n ) ( z ) ∣ n + 1 ⟩ f 3 ( n ) ( z ) ∣ n − 1 ⟩ f 4 ( n ) ( z ) ∣ n ⟩ f 5 ( n ) ( z ) ∣ n + 1 ⟩ f 6 ( n ) ( z ) ∣ n + 2 ⟩ f 7 ( n ) ( z ) ∣ n ⟩ f 8 ( n ) ( z ) ∣ n + 1 ⟩ , (52)
where n = − 2 , − 1 , 0 , 1 , … n = -2,-1,0,1,\ldots n = − 2 , − 1 , 0 , 1 , … is called the Landau level index (LL index). For n = − 2 , − 1 , 0 n = -2,-1,0 n = − 2 , − 1 , 0 , some of the indices n ′ n' n ′ in ∣ n ′ ⟩ |n'\rangle ∣ n ′ ⟩ on the right-hand side are negative; these components are understood to be zero. For n ≥ 1 n \geq1 n ≥ 1 , the dimension of the subspace spanned by ∣ Ψ ( n ) ⟩ |\Psi^{(n)}\rangle ∣ Ψ ( n ) ⟩ is 8 n z 8n_z 8 n z , where n z n_z n z is the number of degrees of freedom in the z z z direction. (For discrete coordinates z j z_j z j , as in the kdotpy calculation, n z n_z n z is equal to the number of grid points.) For n = − 2 , − 1 , 0 n = -2,-1,0 n = − 2 , − 1 , 0 , the dimensionality of the subspace is reduced to 1 n z 1n_z 1 n z , 4 n z 4n_z 4 n z , and 7 n z 7n_z 7 n z , respectively, where 1, 4, and 7 refer to the number of nonzero components in Eq. (52) . This observation is important for the implementation, as we will discuss in detail later.
The Landau level index n n n is a conserved quantity in axial approximation [where we neglect R k n o n a x R_k^{\mathrm{nonax}} R k nonax , Eq. (17) ], meaning that the Hamiltonian is block-diagonal in the basis { ∣ Ψ ( n ) ⟩ } n = − 2 , − 1 , 0 , 1 , … \{|\Psi^{(n)}\rangle\}_{n=-2,-1,0,1,\ldots} { ∣ Ψ ( n ) ⟩ } n = − 2 , − 1 , 0 , 1 , … , i.e., ⟨ Φ ( n ′ ) ∣ H a x ∣ Ψ ( n ) ⟩ = 0 \langle\Phi^{(n')}|H^{\mathrm{ax}}|\Psi^{(n)}\rangle= 0 ⟨ Φ ( n ′ ) ∣ H ax ∣ Ψ ( n ) ⟩ = 0 if n ′ ≠ n n' \ne n n ′ = n . This property allows to calculate Landau level spectra separately for each Landau level n = − 2 , − 1 , 0 , … , n max n = -2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x , where n max n_{\max} n m a x is the desired maximal Landau level index. The result is a set of magnetic-field dependent energy eigenvalues E j ( n ) ( B z ) E_j^{(n)}(B_z) E j ( n ) ( B z ) for each Landau index n n n , where j j j runs over all eigenstates within each Landau level. Due to the fact that the basis is finite, by choosing a Landau level cutoff n max n_{\max} n m a x , the spectrum is inherently incomplete. This is typically a problem only at small magnetic fields, where the energy spacing between Landau levels is small. This energy spacing is equivalent to the cyclotron energy ℏ ω c = ℏ e B z / m \hbar\omega_c = \hbar eB_z/m ℏ ω c = ℏ e B z / m known from the theory of the quantum Hall effect.
Landau level formalism with axial symmetry breaking
If the nonaxial term R k n o n a x R_k^{\mathrm{nonax}} R k nonax [Eq. (17) ] is added, the Landau level index is no longer a conserved quantum number. In order to demonstrate this, let us define
H k n o n a x = R k n o n a x ( ∣ 3 ⟩ ⟨ 5 ∣ + ∣ 4 ⟩ ⟨ 6 ∣ ) + R k n o n a x † ( ∣ 5 ⟩ ⟨ 3 ∣ + ∣ 6 ⟩ ⟨ 4 ∣ ) (53) H_k^{\mathrm{nonax}} = R_k^{\mathrm{nonax}}(|3\rangle\langle5| + |4\rangle\langle6|) + R_k^{\mathrm{nonax}\dagger}(|5\rangle\langle3| + |6\rangle\langle4|) \tag*{(53)} H k nonax = R k nonax ( ∣3 ⟩ ⟨ 5∣ + ∣4 ⟩ ⟨ 6∣ ) + R k nonax † ( ∣5 ⟩ ⟨ 3∣ + ∣6 ⟩ ⟨ 4∣ ) (53)
to be the nonaxial part of the Hamiltonian, expressed in the orbital basis of Eq. (10) (with bold-face numbers indicating the orbitals). In the ladder operator formalism, R k n o n a x ∼ a † a † R_{k}^{\mathrm{nonax}}\sim a^{\dagger}a^{\dagger} R k nonax ∼ a † a † , so that
H n o n a x ∣ Ψ ( n ) ⟩ ∼ [ ( ∣ 3 ⟩ ⟨ 5 ∣ + ∣ 4 ⟩ ⟨ 6 ∣ ) a † a † + ( ∣ 5 ⟩ ⟨ 3 ∣ + ∣ 6 ⟩ ⟨ 4 ∣ ) a a ] ∣ Ψ ( n ) ⟩ ∼ ( 0 0 f 5 ( n ) ( z ) n + 2 n + 3 ∣ n + 3 ⟩ f 6 ( n ) ( z ) n + 2 n + 3 ∣ n + 4 ⟩ f 3 ( n ) ( z ) n − 1 n − 2 ∣ n − 3 ⟩ f 4 ( n ) ( z ) n n − 1 ∣ n − 2 ⟩ 0 0 ) , (54) H^{\mathrm{nonax}}|\Psi^{(n)}\rangle\sim\left[(|3\rangle\langle5|+|4\rangle\langle6|)a^{\dagger}a^{\dagger}+(|5\rangle\langle3|+|6\rangle\langle4|)aa\right]|\Psi^{(n)}\rangle\sim\begin{pmatrix} 0 \\ 0 \\ f_{5}^{(n)}(z)\sqrt{n+2}\sqrt{n+3}|n+3\rangle\\ f_{6}^{(n)}(z)\sqrt{n+2}\sqrt{n+3}|n+4\rangle\\ f_{3}^{(n)}(z)\sqrt{n-1}\sqrt{n-2}|n-3\rangle\\ f_{4}^{(n)}(z)\sqrt{n}\sqrt{n-1}|n-2\rangle\\ 0 \\ 0 \end{pmatrix}, \tag*{(54)} H nonax ∣ Ψ ( n ) ⟩ ∼ [ ( ∣3 ⟩ ⟨ 5∣ + ∣4 ⟩ ⟨ 6∣ ) a † a † + ( ∣5 ⟩ ⟨ 3∣ + ∣6 ⟩ ⟨ 4∣ ) aa ] ∣ Ψ ( n ) ⟩ ∼ 0 0 f 5 ( n ) ( z ) n + 2 n + 3 ∣ n + 3 ⟩ f 6 ( n ) ( z ) n + 2 n + 3 ∣ n + 4 ⟩ f 3 ( n ) ( z ) n − 1 n − 2 ∣ n − 3 ⟩ f 4 ( n ) ( z ) n n − 1 ∣ n − 2 ⟩ 0 0 , (54)
where ∼ \sim ∼ indicates that we have suppressed the prefactors in the notation. Examining Eqs. (52) and (54) , we observe that ⟨ Φ ( n ′ ) ∣ H n o n a x ∣ Ψ ( n ) ⟩ \langle\Phi^{(n')}|H^{\mathrm{nonax}}|\Psi^{(n)}\rangle ⟨ Φ ( n ′ ) ∣ H nonax ∣ Ψ ( n ) ⟩ is generally nonzero if n ′ = n ± 4 n'=n\pm4 n ′ = n ± 4 and zero otherwise. Thus, the nonaxial terms couple Landau levels with indices differing by 4. In the basis of ∣ Ψ ( n ) ⟩ |\Psi^{(n)}\rangle ∣ Ψ ( n ) ⟩ , the total Hamiltonian (axial and nonaxial terms) has matrix elements between the n n n and n ′ n' n ′ blocks for n ′ − n = − 4 , 0 , 4 n'-n=-4,0,4 n ′ − n = − 4 , 0 , 4 . We note that the Landau index modulo 4 remains conserved, because ⟨ Φ ( n ′ ) ∣ H n o n a x ∣ Ψ ( n ) ⟩ = 0 \langle\Phi^{(n')}|H^{\mathrm{nonax}}|\Psi^{(n)}\rangle=0 ⟨ Φ ( n ′ ) ∣ H nonax ∣ Ψ ( n ) ⟩ = 0 if n ′ − n n'-n n ′ − n is not divisable by 4.
The block off-diagonal (n ′ ≠ n n'\ne n n ′ = n ) nonaxial terms are typically much weaker than dominant axial terms on the block diagonal (n ′ = n n'=n n ′ = n ), so that the former can be viewed as perturbation to the latter. For this reason, basis of Landau level states is still useful even if the Landau index is not conserved. In typical Landau level spectra, the Landau index is often almost conserved, unless two levels of indices n , n ′ n,n' n , n ′ with n ′ − n = ± 4 n'-n=\pm4 n ′ − n = ± 4 come close in energy: In the latter case, hybridization between the states occurs and the spectrum exhibits an anticrossing.
In kdotpy, we always use the Landau level basis in the Landau level mode (kdotpy ll). In the axial approximation where the Hamiltonian matrix is block diagonal, the diagonalization can thus be performed block by block, which gives a performance bonus in view of the smaller matrix size. If nonaxial terms are considered, the Hamiltonian is written as one large matrix with all ∣ Ψ ( n ) ⟩ |\Psi^{(n)}\rangle ∣ Ψ ( n ) ⟩ with n = − 2 , − 1 , 0 , … , n max n=-2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x . This Hamiltonian is diagonalized as a whole. In kdotpy, we do not perform perturbation theory explicitly, but always diagonalize the full matrix. Due to the upper limit n max n_{\max} n m a x , the levels with n = n max − 3 , n max − 2 , n max − 1 , n max n=n_{\max}-3,n_{\max}-2,n_{\max}-1,n_{\max} n = n m a x − 3 , n m a x − 2 , n m a x − 1 , n m a x are not coupled to their counterpart with n ′ = n + 4 n'=n+4 n ′ = n + 4 ; as a result, there is a slight inaccuracy in the energies of the highest levels. This numerical error can often be estimated by raising n max n_{\max} n m a x and analyzing how well the energies have converged to definite value.
Other magnetic couplings
Zeeman effect
The electrons are subject to additional magnetic coupling, for example the Zeeman effect H Z = g μ B B ⋅ S H_Z=g\mu_B\mathbf{B}\cdot\mathbf{S} H Z = g μ B B ⋅ S , where g g g is the gyromagnetic ratio or “g-factor” (g ≈ 2 g\approx2 g ≈ 2 in vacuum), μ B \mu_B μ B is the Bohr magneton, and S \mathbf{S} S is the vector of spin operators (s ^ x , s ^ y , s ^ z \hat{s}_x,\hat{s}_y,\hat{s}_z s ^ x , s ^ y , s ^ z ). The nonzero blocks (cf. Eq. (12) ) of the Zeeman Hamiltonian H Z H_Z H Z are
H Z , 66 = g e μ B ( 1 2 B z 1 2 B − 1 2 B + − 1 2 B z ) , H Z , 88 = 2 κ μ B ( − 3 2 B z − 1 2 3 B − 0 0 − 1 2 3 B + − 1 2 B z − B − 0 0 − B + 1 2 B z − 1 2 3 B − 0 0 − 1 2 3 B + 3 2 B z ) , H_{Z,66}=g_e\mu_B\begin{pmatrix}\frac{1}{2}B_z & \frac{1}{2}B_- \\ \frac{1}{2}B_+ & -\frac{1}{2}B_z\end{pmatrix}, \qquad H_{Z,88}=2\kappa\mu_B\begin{pmatrix}-\frac{3}{2}B_z & -\frac{1}{2}\sqrt{3}B_- & 0 & 0 \\ -\frac{1}{2}\sqrt{3}B_+ & -\frac{1}{2}B_z & -B_- & 0 \\ 0 & -B_+ & \frac{1}{2}B_z & -\frac{1}{2}\sqrt{3}B_- \\ 0 & 0 & -\frac{1}{2}\sqrt{3}B_+ & \frac{3}{2}B_z \end{pmatrix}, H Z , 66 = g e μ B ( 2 1 B z 2 1 B + 2 1 B − − 2 1 B z ) , H Z , 88 = 2 κ μ B − 2 3 B z − 2 1 3 B + 0 0 − 2 1 3 B − − 2 1 B z − B + 0 0 − B − 2 1 B z − 2 1 3 B + 0 0 − 2 1 3 B − 2 3 B z ,
H Z , 77 = 2 ( κ + 1 2 ) μ B ( − 1 2 B z − 1 2 B − − 1 2 B + 1 2 B z ) , H Z , 87 = 2 ( κ + 1 ) μ B ( 3 8 B − 0 − 1 8 B z 1 8 B − − 1 8 B + − 1 2 B z 0 − 3 8 B + ) (55) H_{Z,77}=2\left(\kappa+\frac{1}{2}\right)\mu_B\begin{pmatrix}-\frac{1}{2}B_z & -\frac{1}{2}B_- \\ -\frac{1}{2}B_+ & \frac{1}{2}B_z\end{pmatrix}, \qquad H_{Z,87}=2(\kappa+1)\mu_B\begin{pmatrix}\sqrt{\frac{3}{8}}B_- & 0 \\ -\sqrt{\frac{1}{8}}B_z & \sqrt{\frac{1}{8}}B_- \\ -\sqrt{\frac{1}{8}}B_+ & -\sqrt{\frac{1}{2}}B_z \\ 0 & -\sqrt{\frac{3}{8}}B_+\end{pmatrix} \tag*{(55)} H Z , 77 = 2 ( κ + 2 1 ) μ B ( − 2 1 B z − 2 1 B + − 2 1 B − 2 1 B z ) , H Z , 87 = 2 ( κ + 1 ) μ B 8 3 B − − 8 1 B z − 8 1 B + 0 0 8 1 B − − 2 1 B z − 8 3 B + (55)
where g e g_e g e is the g g g -factor for the Γ 6 \Gamma_6 Γ 6 block and − 2 κ -2\kappa − 2 κ acts as the g g g -factor of the combined Γ 8 , Γ 7 \Gamma_8,\Gamma_7 Γ 8 , Γ 7 block [2 , 3 , 15 ] .
Table 2. Coefficients of the magnetic couplings (Zeeman and paramagnetic exchange). The values of κ \kappa κ also appear in Table 1. The values relevant for the paramagnetic exchange in Hg1 − y _{1-y} 1 − y Mny _y y Te are based on Ref. [3 ] . The value for T 0 T_0 T 0 is appropriate only for y ∼ 0.02 y \sim0.02 y ∼ 0.02 . (However, kdotpy implements it as this constant value, to remain consistent with past models.)
Exchange coupling in Mn-doped materials
In the dilute magnetic semiconductor Hg1 − y _{1-y} 1 − y Mny _y y Te, the Mn atoms carry a finite magnetic moment, such that the material behaves paramagnetically if the Mn content y y y does not exceed a few percent [24 ] . The coupling between the Mn magnetic moments and the carrier spins has a similar matrix structure as the Zeeman effect [Eq. (55)], but the response to the external magnetic field B \mathbf{B} B is nonlinear. This coupling is modelled by the (paramagnetic) exchange Hamiltonian [3 , 4 , 24 ] ,
H e x = ∑ l C ( l ) ⟨ m ⟩ ⋅ S ( l ) (56) H_{\mathrm{ex}} = \sum_l C^{(l)} \langle\mathbf{m} \rangle\cdot\mathbf{S}^{(l)} \tag*{(56)} H ex = l ∑ C ( l ) ⟨ m ⟩ ⋅ S ( l ) (56)
where l l l labels the blocks, (the Γ 6 \Gamma_6 Γ 6 block and the Γ 8 , Γ 7 \Gamma_8,\Gamma_7 Γ 8 , Γ 7 block), ⟨ m ⟩ \langle\mathbf{m} \rangle ⟨ m ⟩ is the average Mn spin and S ( l ) \mathbf{S}^{(l)} S ( l ) the spin operators of the respective block. The coupling constants C ( l ) C^{(l)} C ( l ) (cf. g e g_e g e and 2 κ 2\kappa 2 κ in Eq. (55) ) are phenomenologically determined material parameters. For Hg1 − y _{1-y} 1 − y Mny _y y Te, we assume that they are proportional to the Mn content y y y ,
C Γ 6 = − y N 0 α and C Γ 8 , Γ 7 = − y N 0 β , (57) C^{\Gamma_6} = -yN_0\alpha\qquad\text{and}\qquad C^{\Gamma_8,\Gamma_7} = -yN_0\beta, \tag*{(57)} C Γ 6 = − y N 0 α and C Γ 8 , Γ 7 = − y N 0 β , (57)
with N 0 α = 400 m e V N_0\alpha= 400\,\mathrm{meV} N 0 α = 400 meV and N 0 β = − 600 m e V N_0\beta= -600\,\mathrm{meV} N 0 β = − 600 meV [3 , 24 ] .
The paramagnetic response of the Mn magnetic moments to the external field is modelled by the empirical law [3 , 24 , 25 ]
⟨ m ⟩ = − S 0 B ∣ B ∣ B 5 / 2 ( 5 2 g M n μ B ∣ B ∣ k B ( T + T 0 ) ) , (58) \langle\mathbf{m} \rangle= -S_0 \frac{\mathbf{B}}{|\mathbf{B}|} B_{5/2}\left(\frac{\frac{5}{2}g_{\mathrm{Mn}}\mu_{\mathrm{B}}|\mathbf{B}|}{k_{\mathrm{B}}(T+T_0)}\right), \tag*{(58)} ⟨ m ⟩ = − S 0 ∣ B ∣ B B 5/2 ( k B ( T + T 0 ) 2 5 g Mn μ B ∣ B ∣ ) , (58)
where B 5 / 2 B_{5/2} B 5/2 is the Brillouin function for spin J = 5 2 J = \frac{5}{2} J = 2 5 ,
B J ( x ) = 2 J + 1 2 J coth ( 2 J + 1 2 J x ) − 1 2 J coth ( 1 2 J x ) . (59) B_J(x) = \frac{2J+1}{2J}\coth\left(\frac{2J+1}{2J}x\right) - \frac{1}{2J}\coth\left(\frac{1}{2J}x\right). \tag*{(59)} B J ( x ) = 2 J 2 J + 1 coth ( 2 J 2 J + 1 x ) − 2 J 1 coth ( 2 J 1 x ) . (59)
The effective total spin S 0 = − 5 2 S_0 = -\frac{5}{2} S 0 = − 2 5 and the temperature offset T 0 T_0 T 0 are material parameters. For historical reasons, we have used the value T 0 = 2.6 K T_0 = 2.6\,\mathrm{K} T 0 = 2.6 K , but recent experiments have proved that T 0 T_0 T 0 depends on the Mn content y y y and is typically smaller than this value, especially for smaller y y y [26 ] . In kdotpy, the values g M n g_{\mathrm{Mn}} g Mn and T 0 T_0 T 0 are treated as material parameter and need not be constant in the Mn content, though the default material definitions for Hg1 − y _{1-y} 1 − y Mny _y y Te contain the y y y -independent values for historical reasons.
Bulk inversion asymmetry
The terms in Hamiltonian H K a n e H_{\mathrm{Kane}} H Kane [Eq. (14)] are symmetric under spatial inversion, i.e., the transformation given by ( x , y , z ) → ( − x , − y , − z ) (x,y,z) \to(-x,-y,-z) ( x , y , z ) → ( − x , − y , − z ) and ( k x , k y , k z ) → ( − k x , − k y , − k z ) (k_x,k_y,k_z) \to(-k_x,-k_y,-k_z) ( k x , k y , k z ) → ( − k x , − k y , − k z ) . For H K a n e H_{\mathrm{Kane}} H Kane , the relevant point group is O h O_h O h . However, the zincblende crystal structure is not symmetric under inversion; it has point group T d T_d T d . This means that terms breaking spatial inversion symmetry are allowed to appear in the Hamiltonian. Indeed, bulk-inversion asymmetry (BIA) is known to affect the band structure, although the inversion symmetric terms remain dominant. In other words, bulk-inversion asymmetry can be treated as a perturbation to the inversion symmetric Hamiltonian H K a n e H_{\mathrm{Kane}} H Kane .
From representation theory of the point group T d T_d T d , it can be derived which BIA terms are permitted. Like before, we consider only those terms up to quadratic order in momentum. There is a single independent term linear in momentum, given by the Hamiltonian blocks [15 ]
H B I A , 88 = C ( 0 − 1 2 k + k z − 1 2 3 k − − 1 2 k − 0 1 2 3 k + − k z k z 1 2 3 k − 0 − 1 2 k + − 1 2 3 k + − k z − 1 2 k − 0 ) , H B I A , 87 = 1 2 2 C ( k + 2 k z 0 − 3 k + 3 k − 0 2 k z − k − ) , (60) H_{\mathrm{BIA},88}=C\begin{pmatrix}0 & -\frac{1}{2}k_+ & k_z & -\frac{1}{2}\sqrt{3}k_- \\ -\frac{1}{2}k_- & 0 & \frac{1}{2}\sqrt{3}k_+ & -k_z \\ k_z & \frac{1}{2}\sqrt{3}k_- & 0 & -\frac{1}{2}k_+ \\ -\frac{1}{2}\sqrt{3}k_+ & -k_z & -\frac{1}{2}k_- & 0\end{pmatrix}, \qquad H_{\mathrm{BIA},87}=\frac{1}{2\sqrt{2}}C\begin{pmatrix}k_+ & 2k_z \\ 0 & -\sqrt{3}k_+ \\ \sqrt{3}k_- & 0 \\ 2k_z & -k_-\end{pmatrix}, \tag*{(60)} H BIA , 88 = C 0 − 2 1 k − k z − 2 1 3 k + − 2 1 k + 0 2 1 3 k − − k z k z 2 1 3 k + 0 − 2 1 k − − 2 1 3 k − − k z − 2 1 k + 0 , H BIA , 87 = 2 2 1 C k + 0 3 k − 2 k z 2 k z − 3 k + 0 − k − , (60)
and H B I A , 78 = H B I A , 87 † H_{\mathrm{BIA},78}=H_{\mathrm{BIA},87}^{\dagger} H BIA , 78 = H BIA , 87 † . The coefficient C C C is the material parameter for the strength of linear BIA. There are three independent quadratic terms, given by
H B I A , 68 = 1 6 B 8 + ( 3 k − k z 2 i k x k y k + k z 0 0 k − k z 2 i k x k y 3 k + k z ) + 1 3 2 B 8 − ( 0 3 K 4 0 K 5 − K 5 0 − 3 K 4 0 ) , H_{\mathrm{BIA},68}=\frac{1}{\sqrt{6}}B_{8+}\begin{pmatrix}\sqrt{3}k_-k_z & 2\mathrm{i}k_xk_y & k_+k_z & 0 \\ 0 & k_-k_z & 2\mathrm{i}k_xk_y & \sqrt{3}k_+k_z\end{pmatrix}+\frac{1}{3\sqrt{2}}B_{8-}\begin{pmatrix}0 & \sqrt{3}K_4 & 0 & K_5 \\ -K_5 & 0 & -\sqrt{3}K_4 & 0\end{pmatrix}, H BIA , 68 = 6 1 B 8 + ( 3 k − k z 0 2 i k x k y k − k z k + k z 2 i k x k y 0 3 k + k z ) + 3 2 1 B 8 − ( 0 − K 5 3 K 4 0 0 − 3 K 4 K 5 0 ) ,
H B I A , 67 = 1 3 B 7 ( − i k x k y − k + k z k − k z i k x k y ) , (61) H_{\mathrm{BIA},67}=\frac{1}{\sqrt{3}}B_7\begin{pmatrix}-\mathrm{i}k_xk_y & -k_+k_z \\ k_-k_z & \mathrm{i}k_xk_y\end{pmatrix}, \tag*{(61)} H BIA , 67 = 3 1 B 7 ( − i k x k y k − k z − k + k z i k x k y ) , (61)
where K 4 ≡ k x 2 − k y 2 K_4\equiv k_x^2-k_y^2 K 4 ≡ k x 2 − k y 2 and K 5 ≡ k x 2 + k y 2 − 2 k z 2 K_5\equiv k_x^2+k_y^2-2k_z^2 K 5 ≡ k x 2 + k y 2 − 2 k z 2 , and the coefficients B 8 + B_{8+} B 8 + , B 8 − B_{8-} B 8 − , and B 7 B_7 B 7 are material parameters. The blocks H B I A , 76 H_{\mathrm{BIA},76} H BIA , 76 and H B I A , 86 H_{\mathrm{BIA},86} H BIA , 86 are given by the respective hermitian conjugates. The blocks H 66 H_{66} H 66 and H 77 H_{77} H 77 do not contain BIA terms up to quadratic order. Representative values of the material parameters for CdTe [15 , 27 ] and HgTe [28 ] are listed in Table 3 . These values are also included as material parameters in kdotpy.
Table 3. Coefficients of the BIA Hamiltonian H B I A H_{\mathrm{BIA}} H BIA up to quadratic order in momentum. The values for CdTe are taken from Ref. [15 ] , which in turn cites Ref. [27 ] for C C C . The values for C C C , B 8 + B_{8+} B 8 + and B 8 − B_{8-} B 8 − for HgTe are based on the result of a calculation by Di Sante and Sangiovanni based on density-functional theory (DFT) [28 ] . The value for B 7 B_7 B 7 for HgTe is an educated guess approximately equal to B 7 , C d T e B 8 + , H g T e / B 8 + , C d T e B_{7,\mathrm{CdTe}}B_{8+,\mathrm{HgTe}}/B_{8+,\mathrm{CdTe}} B 7 , CdTe B 8 + , HgTe / B 8 + , CdTe . The values in this table are included as material parameters in kdotpy.
For nonzero magnetic fields, the BIA terms also lead to extra contributions from the Peierls substitution. For a strip geometry, this leads to extra contributions involving the gauge field A A A (see § 2.3.1 ). In the Landau level formalism (see § 2.4 ), additional ladder operators appear. For growth direction (001), this leads to terms coupling Landau levels with indices n , n ′ n,n' n , n ′ with n ′ − n = ± 2 n'-n=\pm2 n ′ − n = ± 2 . Whereas for the inversion symmetric LL Hamiltonian n m o d 4 n\ \mathrm{mod}\ 4 n mod 4 is a conserved quantum number, the BIA lowers this symmetry such that only n m o d 2 n\ \mathrm{mod}\ 2 n mod 2 remains conserved.
Strain
Strain and stress
The materials used in a heterostructure typically have slight differences in their equilibrium lattice constant. Two adjacent epitaxially grown layers can be strained as to match their in-plane lattice constants, if the mismatch between the equilibrium lattice constants is sufficiently small. This is known as pseudomorphic growth (see Ref. [29 ] and references therein). In practice, the in-plane lattice constant is generally determined by that of the substrate, which is usually much thicker than the epitaxial layers on top. If the epitaxial layers are too thick (more than a few hundred nm for HgTe and CdTe), relaxation occurs towards the equilibrium lattice constant.
The physical quantity strain is the deviation of the lattice constant of the strained layer a s a_s a s relative to the equilibrium lattice constant a 0 a_0 a 0 ; in one dimension, strain is the dimensionless quantity
ϵ = a s − a 0 a 0 . (62) \epsilon=\frac{a_s-a_0}{a_0}. \tag*{(62)} ϵ = a 0 a s − a 0 . (62)
In a three-dimensional crystal, strain leads to a displacement of each of the three lattice vectors a i \mathbf{a}_i a i (i = x , y , z i=x,y,z i = x , y , z in a crystal with cubic symmetry). The displacement can be written in terms of a tensor A i j A_{ij} A ij , which satisfies [30 ]
a i , s = ∑ j = 1 3 ( δ i j + A i j ) a j , 0 , (63) a_{i,s}=\sum_{j=1}^{3}(\delta_{ij}+A_{ij})a_{j,0}, \tag*{(63)} a i , s = j = 1 ∑ 3 ( δ ij + A ij ) a j , 0 , (63)
where δ i j \delta_{ij} δ ij is the Kronecker delta. The non-rotational (i.e., symmetrical) part of A i j A_{ij} A ij is the strain tensor
ϵ i j = 1 2 ( A i j + A j i ) . (64) \epsilon_{ij}=\frac{1}{2}(A_{ij}+A_{ji}). \tag*{(64)} ϵ ij = 2 1 ( A ij + A j i ) . (64)
The strain tensor ϵ i j \epsilon_{ij} ϵ ij is symmetric by definition. The diagonal terms ϵ i i \epsilon_{ii} ϵ ii represent linear strain and the off-diagonal terms ϵ x y , ϵ y z , ϵ z x \epsilon_{xy},\epsilon_{yz},\epsilon_{zx} ϵ x y , ϵ y z , ϵ z x represent shear strain .
A strained crystal is not in equilibrium and thus experiences forces that pushes the crystal back to its equilibrium lattice constant, or conversely, external forces are needed to bring a crystal into a strained state. Here, we consider the linear response regime, where Hooke’s law is valid, i.e., the force F F F and the displacement u u u are linearly proportional, F = k u F=ku F = k u , with the stiffness constant k k k . The generalization of Hooke’s law to a crystal in three dimensions relates the stress tensor σ i j \sigma_{ij} σ ij to the strain tensor ϵ k l \epsilon_{kl} ϵ k l as
σ i j = ∑ k , l = 1 3 S i j k l ϵ k l , (65) \sigma_{ij}=\sum_{k,l=1}^{3}S_{ijkl}\epsilon_{kl}, \tag*{(65)} σ ij = k , l = 1 ∑ 3 S ij k l ϵ k l , (65)
in terms of the stiffness tensor C i j k l C_{ijkl} C ij k l . The stiffness tensor is a rank-4 tensor with 81 = 3 × 3 × 3 × 3 81=3 \times3 \times3 \times3 81 = 3 × 3 × 3 × 3 components (also known as elasticity modules). The stress tensor and stiffness tensor (elasticity modules) both carry the units of pressure, typically GPa in this context.
For a crystal with cubic symmetry, the stiffness tensor has only 3 independent components [30 ] . If the strain and stress tensors are vectorized as ϵ ~ = ( ϵ x x , ϵ y y , ϵ z z , 2 ϵ y z , 2 ϵ z x , 2 ϵ x y ) \tilde{\epsilon}=(\epsilon_{xx},\epsilon_{yy},\epsilon_{zz},2\epsilon_{yz},2\epsilon_{zx},2\epsilon_{xy}) ϵ ~ = ( ϵ xx , ϵ y y , ϵ z z , 2 ϵ y z , 2 ϵ z x , 2 ϵ x y ) and σ ~ = ( σ x x , σ y y , σ z z , σ y z , σ z x , σ x y ) \tilde{\sigma}=(\sigma_{xx},\sigma_{yy},\sigma_{zz},\sigma_{yz},\sigma_{zx},\sigma_{xy}) σ ~ = ( σ xx , σ y y , σ z z , σ y z , σ z x , σ x y ) , respectively, Eq. (65) can be written as σ ~ = C ~ ϵ ~ \tilde{\sigma}=\tilde{C}\tilde{\epsilon} σ ~ = C ~ ϵ ~ in terms of the elasticity matrix
C ~ = ( C 11 C 12 C 12 0 0 0 C 12 C 11 C 12 0 0 0 C 12 C 12 C 11 0 0 0 0 0 0 C 44 0 0 0 0 0 0 C 44 0 0 0 0 0 0 C 44 ) . (66) \tilde{C}=
\begin{pmatrix}
C_{11} & C_{12} & C_{12} & 0 & 0 & 0\\
C_{12} & C_{11} & C_{12} & 0 & 0 & 0\\
C_{12} & C_{12} & C_{11} & 0 & 0 & 0\\
0 & 0 & 0 & C_{44} & 0 & 0\\
0 & 0 & 0 & 0 & C_{44} & 0\\
0 & 0 & 0 & 0 & 0 & C_{44}
\end{pmatrix}. \tag*{(66)} C ~ = C 11 C 12 C 12 0 0 0 C 12 C 11 C 12 0 0 0 C 12 C 12 C 11 0 0 0 0 0 0 C 44 0 0 0 0 0 0 C 44 0 0 0 0 0 0 C 44 . (66)
The three independent components C 11 C_{11} C 11 , C 12 C_{12} C 12 , and C 44 C_{44} C 44 are material parameters that can be found in the literature.
Strain Hamiltonian
The effect of strain on the band structure is formalized in the Bir-Pikus formalism [31 ] : The strain Hamiltonian is obtained from the k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p Hamiltonian by substitution of all terms quadratic in momentum as
k i k j → ϵ i j (67) k_i k_j \to\epsilon_{ij} \tag*{(67)} k i k j → ϵ ij (67)
and changing the band mass parameters F F F , γ 1 , 2 , 3 \gamma_{1,2,3} γ 1 , 2 , 3 to the deformation potentials (i.e., strain coefficients) C 1 C_1 C 1 , D d D_d D d , D u D_u D u , and D u ′ D'_u D u ′ [2 , 3 , 15 ] . Taking Eq. (15) as a starting point, we find the strain Hamiltonian
H s = ( T s 0 0 0 0 0 0 0 0 T s 0 0 0 0 0 0 0 0 U s + V s S s R s 0 − 1 2 S s − 2 R s 0 0 S s ∗ U s − V s 0 R s 2 V s 3 2 S s 0 0 R s ∗ 0 U s − V s − S s 3 2 S s ∗ − 2 V s 0 0 0 R s ∗ − S s ∗ U s + V s 2 R s ∗ − 1 2 S s ∗ 0 0 − 1 2 S s ∗ 2 V s 3 2 S s 2 R s U s 0 0 0 − 2 R s ∗ 3 2 S s ∗ − 2 V s − 1 2 S s 0 U s ) (68) H_s =
\begin{pmatrix}
T_s & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & T_s & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & U_s+V_s & S_s & R_s & 0 & -\frac{1}{\sqrt{2}}S_s & -\sqrt{2}R_s \\
0 & 0 & S_s^* & U_s-V_s & 0 & R_s & \sqrt{2}V_s & \sqrt{\frac{3}{2}}S_s \\
0 & 0 & R_s^* & 0 & U_s-V_s & -S_s & \sqrt{\frac{3}{2}}S_s^* & -\sqrt{2}V_s \\
0 & 0 & 0 & R_s^* & -S_s^* & U_s+V_s & \sqrt{2}R_s^* & -\frac{1}{\sqrt{2}}S_s^* \\
0 & 0 & -\frac{1}{\sqrt{2}}S_s^* & \sqrt{2}V_s & \sqrt{\frac{3}{2}}S_s & \sqrt{2}R_s & U_s & 0 \\
0 & 0 & -\sqrt{2}R_s^* & \sqrt{\frac{3}{2}}S_s^* & -\sqrt{2}V_s & -\frac{1}{\sqrt{2}}S_s & 0 & U_s
\end{pmatrix} \tag*{(68)} H s = T s 0 0 0 0 0 0 0 0 T s 0 0 0 0 0 0 0 0 U s + V s S s ∗ R s ∗ 0 − 2 1 S s ∗ − 2 R s ∗ 0 0 S s U s − V s 0 R s ∗ 2 V s 2 3 S s ∗ 0 0 R s 0 U s − V s − S s ∗ 2 3 S s − 2 V s 0 0 0 R s − S s U s + V s 2 R s − 2 1 S s 0 0 − 2 1 S s 2 V s 2 3 S s ∗ 2 R s ∗ U s 0 0 0 − 2 R s 2 3 S s − 2 V s − 2 1 S s ∗ 0 U s (68)
with
T s = C 1 tr ε U s = D d tr ε , R s = 1 3 D u ( ε x x − ε y y ) − 2 3 D u ′ i ε x y , V s = − 1 3 D u ( ε x x + ε y y − 2 ε z z ) , S s = 2 3 D u ′ ( ε x z − i ε y z ) , (69) \begin{aligned}
T_s &= C_1\operatorname{tr}\varepsilon\\
U_s &= D_d\operatorname{tr}\varepsilon, \qquad
R_s = \frac{1}{\sqrt{3}}D_u(\varepsilon_{xx}-\varepsilon_{yy})-\frac{2}{\sqrt{3}}D'_u i\varepsilon_{xy}, \\
V_s &= -\frac{1}{3}D_u(\varepsilon_{xx}+\varepsilon_{yy}-2\varepsilon_{zz}), \qquad
S_s = \frac{2}{\sqrt{3}}D'_u(\varepsilon_{xz}-i\varepsilon_{yz}), \tag*{(69)}
\end{aligned} T s U s V s = C 1 tr ε = D d tr ε , R s = 3 1 D u ( ε xx − ε y y ) − 3 2 D u ′ i ε x y , = − 3 1 D u ( ε xx + ε y y − 2 ε z z ) , S s = 3 2 D u ′ ( ε x z − i ε y z ) , (69)
where tr ε = ε x x + ε y y + ε z z \operatorname{tr}\varepsilon=\varepsilon_{xx}+\varepsilon_{yy}+\varepsilon_{zz} tr ε = ε xx + ε y y + ε z z . The values of the deformation potentials C 1 C_1 C 1 , D d D_d D d , D u D_u D u , and D u ′ D'_u D u ′ for HgTe and CdTe that have been provided with kdotpy, are listed in Table 4 and have been taken from Ref. [2 ] . We note that this and other literature sources (e.g., Ref. [31 ] ) use the alternative set of deformation potentials C = C 1 C=C_1 C = C 1 , a = D d a=D_d a = D d , b = − 2 3 D u b=-\frac{2}{3}D_u b = − 3 2 D u and d = − 2 3 D u ′ d=-\frac{2}{\sqrt{3}}D'_u d = − 3 2 D u ′ .
Table 4. Deformation potentials for HgTe and CdTe, see Refs. [2 ] and references therein. Note that some references use the alternative notation C = C 1 C=C_1 C = C 1 , a = D d a=D_d a = D d , b = − 2 3 D u b=-\frac{2}{3}D_u b = − 3 2 D u and d = − 2 3 D u ′ d=-\frac{2}{\sqrt{3}}D'_u d = − 3 2 D u ′ [2 , 31 ] . The values in this table are included as material parameters in kdotpy.
Symmetry allows further terms in the strain Hamiltonian. For example, application of the Bir-Pikus substitution to cubic momentum terms leads to strain terms linear in strain and momentum, i.e., involving linear combinations of ε i j k l \varepsilon_{ij}k_l ε ij k l . (See the tables in Ref. [15 ] for examples of these terms.) Here, we neglect these ‘higher-order’ terms, as they are negligible for these materials [2 ] . For a systematic study of these higher-order strain terms, we refer to Ref. [32 ] .
Topology
Berry connection, Berry curvature, Chern number
The topological character of a material is typically understood theoretically in terms of the Chern number of the bands. In a nutshell, band inversion can cause the Chern numbers to become non-trivial, which leads to measurable signatures in the Hall conductance.
A common picture to understand the concept of a Chern number is the analogy with a winding number of the spin of a spin-1 2 \frac{1}{2} 2 1 particle [33 ] . The spin eigenstate ∣ ψ ( k ) ⟩ \lvert\psi(\mathbf{k})\rangle ∣ ψ ( k )⟩ can be represented by a momentum dependent vector d ( k ) \mathbf{d}(\mathbf{k}) d ( k ) on the Bloch sphere. Then one can consider the area swept out by d ( k ) \mathbf{d}(\mathbf{k}) d ( k ) where the momenta k \mathbf{k} k span the complete Brillouin zone. The signed area is 4 π C 4\pi C 4 π C , i.e., the area 4 π 4\pi 4 π of the unit sphere times the Chern number C C C . If the Brillouin zone is finite, the Chern number is integer, whereas for the continuum limit of infinitely large Brillouin zones, it may also be half-integer.
The above picture can be formalized in terms of concepts from differential geometry. If we consider an eigenstate ∣ ψ ( k ) ⟩ \lvert\psi(\mathbf{k})\rangle ∣ ψ ( k )⟩ that is differentiable in the Brillouin zone, we can define the Berry connection [33 ]
A ( ψ ) ( k ) = i ⟨ ψ ( k ) ∣ ∇ k ∣ ψ ( k ) ⟩ (70) \mathbf{A}^{(\psi)}(\mathbf{k})=i\langle\psi(\mathbf{k})\lvert\nabla_{\mathbf{k}}\rvert\psi(\mathbf{k})\rangle \tag*{(70)} A ( ψ ) ( k ) = i ⟨ ψ ( k ) ∣ ∇ k ∣ ψ ( k )⟩ (70)
at each point k \mathbf{k} k . This quantity is analogous to the magnetic vector potential, hence it also goes by the name Berry vector potential [33 ] . The Berry phase is an integral of the Berry curvature over the closed contour C \mathcal{C} C that surrounds the Brillouin zone,
γ ( ψ ) = ∮ C d k ⋅ A ( ψ ) ( k ) . (71) \gamma^{(\psi)}=\oint_{\mathcal{C}} \mathrm{d}\mathbf{k}\cdot\mathbf{A}^{(\psi)}(\mathbf{k}). \tag*{(71)} γ ( ψ ) = ∮ C d k ⋅ A ( ψ ) ( k ) . (71)
The Berry phase is an integer number times 2 π 2\pi 2 π , which defines the Chern number C ( ψ ) C^{(\psi)} C ( ψ ) as γ ( ψ ) = 2 π C ( ψ ) \gamma^{(\psi)}=2\pi C^{(\psi)} γ ( ψ ) = 2 π C ( ψ ) [33 ] .
The integral of Eq. (71) can be rewritten by virtue of Stokes’ theorem as an integral over the interior S S S of the Brillouin zone,
γ ( ψ ) = ∫ S d S ⋅ ∇ k × A ( ψ ) ( k ) = ∫ S d S ⋅ Ω ( ψ ) ( k ) , (72) \gamma^{(\psi)} = \int_S d\mathbf{S} \cdot\nabla_{\mathbf{k}} \times\mathbf{A}^{(\psi)}(\mathbf{k}) = \int_S d\mathbf{S} \cdot\mathbf{\Omega}^{(\psi)}(\mathbf{k}), \tag*{(72)} γ ( ψ ) = ∫ S d S ⋅ ∇ k × A ( ψ ) ( k ) = ∫ S d S ⋅ Ω ( ψ ) ( k ) , (72)
where d S d\mathbf{S} d S is a surface element and Ω ( ψ ) ( k ) \mathbf{\Omega}^{(\psi)}(\mathbf{k}) Ω ( ψ ) ( k ) is the Berry curvature, defined by Ω ( ψ ) ( k ) = ∇ k × A ( ψ ) \mathbf{\Omega}^{(\psi)}(\mathbf{k}) = \nabla_{\mathbf{k}} \times\mathbf{A}^{(\psi)} Ω ( ψ ) ( k ) = ∇ k × A ( ψ ) , or in component notation (i , l , m = 1 , 2 , 3 i,l,m = 1,2,3 i , l , m = 1 , 2 , 3 ),
Ω i ( ψ ) ( k ) = ∑ l , m ϵ i l m F l m ( ψ ) ( k ) (73) \Omega_i^{(\psi)}(\mathbf{k}) = \sum_{l,m} \epsilon_{ilm} F_{lm}^{(\psi)}(\mathbf{k}) \tag*{(73)} Ω i ( ψ ) ( k ) = l , m ∑ ϵ i l m F l m ( ψ ) ( k ) (73)
with
F l m ( ψ ) ( k ) = ∂ k l A m ( ψ ) ( k ) − ∂ k m A l ( ψ ) ( k ) = i ⟨ ∂ k l ψ ( k ) ∣ ∂ k m ψ ( k ) ⟩ − i ⟨ ∂ k m ψ ( k ) ∣ ∂ k l ψ ( k ) ⟩ . (74) F_{lm}^{(\psi)}(\mathbf{k}) = \partial_{k_l} A_m^{(\psi)}(\mathbf{k}) - \partial_{k_m} A_l^{(\psi)}(\mathbf{k}) = i\langle\partial_{k_l}\psi(\mathbf{k}) \mid\partial_{k_m}\psi(\mathbf{k})\rangle- i\langle\partial_{k_m}\psi(\mathbf{k}) \mid\partial_{k_l}\psi(\mathbf{k})\rangle. \tag*{(74)} F l m ( ψ ) ( k ) = ∂ k l A m ( ψ ) ( k ) − ∂ k m A l ( ψ ) ( k ) = i ⟨ ∂ k l ψ ( k ) ∣ ∂ k m ψ ( k )⟩ − i ⟨ ∂ k m ψ ( k ) ∣ ∂ k l ψ ( k )⟩ . (74)
The analogue of the Berry curvature in electrodynamics is the magnetic field B = ∇ × A \mathbf{B} = \nabla\times\mathbf{A} B = ∇ × A .
In practice, the Berry connection is challenging to calculate numerically: The derivative is discretized, where we evaluate the eigenstates at k \mathbf{k} k and k + d k \mathbf{k} + d\mathbf{k} k + d k . However, the result of the numerical evaluation has an indefinite overall phase factor (U ( 1 ) U(1) U ( 1 ) gauge factor) which can vary randomly even between two points k \mathbf{k} k and k + d k \mathbf{k} + d\mathbf{k} k + d k close in momentum space. In Ref. [33 ] , the Berry curvature Ω ( ψ ) ( k ) \mathbf{\Omega}^{(\psi)}(\mathbf{k}) Ω ( ψ ) ( k ) [Eqs. (73) and (74) ] is rewritten by ‘insertion of one’, ∑ ψ ′ ∣ ψ ′ ⟩ ⟨ ψ ′ ∣ \sum_{\psi'} |\psi'\rangle\langle\psi'| ∑ ψ ′ ∣ ψ ′ ⟩ ⟨ ψ ′ ∣ . This manipulation eventually yields a gauge invariant form of the Berry curvature
Ω i ( ψ ) ( k ) = − Im ∑ ψ ′ ≠ ψ ∑ l , m ϵ i l m ⟨ ψ ′ ( k ) ∣ ( ∂ k l H ) ∣ ψ ( k ) ⟩ ⟨ ψ ( k ) ∣ ( ∂ k m H ) ∣ ψ ′ ( k ) ⟩ ( E ψ ′ − E ψ ) 2 , (75) \Omega_i^{(\psi)}(\mathbf{k}) = -\operatorname{Im} \sum_{\psi' \ne\psi} \sum_{l,m} \frac{\epsilon_{ilm}\langle\psi'(\mathbf{k}) \mid(\partial_{k_l} H) \mid\psi(\mathbf{k})\rangle\langle\psi(\mathbf{k}) \mid(\partial_{k_m} H) \mid\psi'(\mathbf{k})\rangle}{(E_{\psi'} - E_{\psi})^2}, \tag*{(75)} Ω i ( ψ ) ( k ) = − Im ψ ′ = ψ ∑ l , m ∑ ( E ψ ′ − E ψ ) 2 ϵ i l m ⟨ ψ ′ ( k ) ∣ ( ∂ k l H ) ∣ ψ ( k )⟩ ⟨ ψ ( k ) ∣ ( ∂ k m H ) ∣ ψ ′ ( k )⟩ , (75)
where the summation is over all states in the spectrum other than ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ itself, and E ψ E_\psi E ψ and E ψ ′ E_{\psi'} E ψ ′ are the energy eigenvalues. This expression is manifestly U ( 1 ) U(1) U ( 1 ) invariant, as all phase factors from the eigenstates come in conjugate pairs. The momentum derivatives of the Hamiltonian ∂ k l H \partial_{k_l} H ∂ k l H (l = 1 , 2 , 3 l = 1,2,3 l = 1 , 2 , 3 ) can be evaluated analytically or numerically; even for the numerical derivative, there are no indefinite phase factors to be taken care of.
Hall conductance
The bulk-boundary theorem (see, e.g., Ref. [33 ] ) connects the Chern numbers to the Hall conductance σ H = σ x y \sigma_{\mathrm{H}} = \sigma_{xy} σ H = σ x y of a device in a magnetic field, as
σ H = e 2 h ∑ occupied states ψ C ( ψ ) . (76) \sigma_{\mathrm{H}} = \frac{e^2}{h} \sum_{\text{occupied states }\psi} C^{(\psi)}. \tag*{(76)} σ H = h e 2 occupied states ψ ∑ C ( ψ ) . (76)
That is, the sum of the Chern numbers of the occupied bands yields the Hall conductance in units of the conductance quantum e 2 / h e^2/h e 2 / h . This result can be used to find the Hall conductance σ H \sigma_{\mathrm{H}} σ H in a Landau fan: For each additional occupied Landau level, the Hall conductance is increased by C ( ψ ) e 2 / h C^{(\psi)}e^2/h C ( ψ ) e 2 / h . Typically, C ( ψ ) = 1 C^{(\psi)} = 1 C ( ψ ) = 1 for all Landau levels, so that finding the Hall conductance simplifies to a mere counting problem of occupied states. In kdotpy, the Hall conductance can be determined either with Chern numbers calculated with Eq. (75) or with simulated Chern numbers based on the assumption that C ( ψ ) = 1 C^{(\psi)} = 1 C ( ψ ) = 1 . The implementation is discussed in more detail in § 3.5.3 .
Implementation
Overview of the program
General remarks
Like its name suggests, kdotpy implements k ⋅ p k \cdot p k ⋅ p theory in a Python program. The program is designed as a command-line interface (CLI): The operation of the program is determined primarily by a sequence of command line arguments entered by the user on the shell (e.g., bash). Moreover, the behaviour and output can be adjusted with configuration settings.
Package structure
The kdotpy application is actually a collection of several subprograms, that do the actual work. Most of these subprograms are Python scripts themselves. The subprograms are referred to by the first two arguments on the command line, for example kdotpy 2d. The command kdotpy invokes the main script main.py (provided that the kdotpy module has been installed successfully with PIP, see § 7 ). In this example, main.py imports kdotpy-2d.py and runs its main() function. The latter contains the ‘recipe’ of this subprogram, which we will discuss in greater detail in § 3.1.3 .
The kdotpy module defines five subprograms that we classify as calculation subprograms , because they do the actual computational work: constructing a Hamiltonian, diagonalizing it, and processing the eigenvalues and eigenstates.
kdotpy 2d: Calculates a dispersion of a structure with two translational degrees of freedom. The z z z direction is kept spatial and is appropriately discretized. A typical configuration for this case is a quantum well.
kdotpy 1d: Calculates a dispersion of a structure with one translational degree of freedom, for example a Hall bar. The y y y and z z z direction are kept spatial and are discretized. Due to the very large size of the problem, it usually makes sense to run this subprogram on a cluster that supports ‘jobs’ with large memory requirements.
kdotpy ll: Calculates a Landau level spectrum for a configuration similar to the ‘2D’ mode, using the Landau level formalism of § 2.4 .
kdotpy bulk: Calculates the dispersion for the ‘bulk’, i.e., with translational degrees of freedom in all 3 directions.
kdotpy bulk-ll: Calculates a Landau level spectrum for a geometry with translational symmetry in the z z z direction.
The package also contains several auxiliary subprograms for several other tasks other than doing the actual calculations:
kdotpy merge: This subprogram is used for re-plotting data from earlier runs of kdotpy. It takes as input one or more XML files. The name kdotpy merge derives from the fact that it can be used to merge several data files, and show all results in a single plot.
kdotpy compare: Similar to kdotpy merge, but shows data files (or sets of data files) using different colours/symbols in a single plot.
kdotpy batch: A simple tool for running batch calculations with kdotpy, for example iterating a calculation while varying one of the input parameters. This subprogram serves a similar purpose as a shell script, but has a convenient monitor that shows the estimated time at which the calculations will finish.
kdotpy test: Test suite. This tool runs all standardized tests or a selection of them, as to test whether kdotpy runs properly.
kdotpy config: For viewing and modifying the configuration settings.
kdotpy doc: With kdotpy doc object, one gets developer information on the given object, e.g., a function or class. This tool shows the relevant docstring on the terminal.
The final three are not separate Python scripts, but functions called directly from the main program. For detailed instructions on how to use kdotpy from the command line, we refer to § 8 .
The Python code is structured as follows. The root directory of contains the metadata, such as the pyproject.toml file, the README.md file and the license text. The code itself is found in the subdirectory src/kdotpy. This directory contains the main module (in main.py), the scripts for the subprograms, and several other source files that are imported by the subprograms. Inside src/kdotpy, the following subdirectories collect several larger components of the program:
The materials subdirectory also contains the default materials file. Finally, the built-in helpfile is located at docs/helpfile.txt inside src/kdotpy. The components will be discussed below in the remainder of § 3 , roughly in the order in which they are executed in a kdotpy calculation.
Calculation subprogram workflow
The five calculation subprograms differ substantially in the details, but they all follow a similar workflow, going through the same sequence of stages. Figure 1 illustrates a schematic flow diagram with the important stages. The sequence can be summarized as follows.
Figure 1. Flow diagram of kdotpy, that illustrates the workflow for the calculation subprograms kdotpy 1d, kdotpy 2d, kdotpy bulk, kdotpy ll, and kdotpy bulk-ll. The diagram shows the most important components of the program and some relevant data classes and source files (not a complete list).
Preprocessing:
Parse command line arguments, read configuration values and material parameters
Define electrostatic potential (read from file and/or calculated with the self-consistent Hartree method)
Prepare for diagonalization (determine band characters, charge neutrality point (CNP))
Data structures and data flow
The different components of the program ‘communicate’ via classes which contain the important data. In the following list, we provide the most important ones:
VectorGrid: The class VectorGrid contains the k k k and/or B B B values on which the diagonalization is performed. The important class attributes are the vector type (vtype) and one, two or three arrays of values. The class represents a sequence of vector values (if the dimensionality is one) or a cartesian product of two or three sequences of values.
PhysParams: The class PhysParams contains the physical parameters and coefficients related to the simulated structure, such as its size, the resolution of the spatial coordinates, material parameters, and strain values.
DiagDataPoint: Each instance of DiagDataPoint contains the eigenvalues and (optionally) the eigenvectors at a single value ( k , B ) (k,B) ( k , B ) . The eigenvectors are calculated and stored temporarily, and usually deleted after the observables have been calculated in order to reduce the memory requirement. The observables are stored in the DiagDataPoint instance, together with other eigenstate data such as Landau level index, band index, and subband character. The DiagDataPoint class defines several member functions for retrieving and manipulating the eigenstate data.
DiagData: The class DiagData contains the result of the diagonalization as an array of DiagDataPoint instances. Optionally, it also contains a VectorGrid instance to give a multidimensional view of the data. (The data is stored as a flat list of DiagDataPoint instances.) The DiagData class contains several member functions for retrieving eigenstate data for the complete data set, for example for the output functions. Importantly, after successful band alignment, these member functions can access the eigenstates ‘by band’, e.g., the eigenvalues of all eigenstates with the same band index. This is essential for making the plots and for some of the postprocessing functions.
DensityData: The result of the calculation of the density of states is stored in a DensityData instance. The key quantities inside this class are the integrated density of states (IDOS) and the corresponding energy values. The class can store an IDOS integrated over all k k k as well as separate values per k k k or B B B . In the latter case, also a grid of k k k or B B B values is stored. The member functions allow retrieval of the IDOS and the ordinary density of states (as energy derivative of the IDOS), where the values can be scaled to the desired set of units (inverse units of length, in terms of nm, cm, or m). Broadening can also be applied.
Option values taken from command-line input are stored in the dict instances opts, plotopts, modelopts, etc.
Input and preprocessing
Command line parsing
The kdotpy program is designed as a non-interactive command-line interface (CLI). The behaviour of the program is determined by the string of arguments provided by the user in the shell command that starts kdotpy. The first argument after the program name kdotpy determines the subprogram that is used, for example
kdotpy 2d 8o noax msubst CdZnTe 4% player HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45 split 0.01
runs the script kdotpy-2d.py with further arguments being passed to this script. (For a detailed explanation of all arguments in this example, please refer to the Usage Example of § 8.2 .) Unlike many other programs, the option arguments are not preceded by hyphen or double-hyphen, for ease of input. The argument list sys.argv passed to the script is wrapped in the instance sysargv of the CmdArgs class, which keeps track of all arguments that have been parsed. This allows kdotpy to track if there are any unparsed arguments; if that is the case, a warning message is shown at the end.
The source file cmdargs/cmdargs.py provides several wrapper functions for extracting information from the command line arguments. For example, the functions cmdargs.options(), cmdargs.plot_options(), and cmdargs.bandalign() return dict instances with option values used by several other functions in kdotpy. Some features are enabled by simply putting the appropriate argument in the command line, e.g., extrema in the above example for doing the extrema analysis. This is simply tested by "extrema" in sysargv; the CmdArgs class automatically marks the argument as parsed.
We have provided a comprehensive list of all command line options in Appendix § 13 , sorted thematically. For up-to-date information on commands (for versions other than the present one, v1.0.0), we recommend to consult the wiki [34 ] and/or the built-in help.
Configuration options
For user preferences that are unlikely to change between different calculations, kdotpy uses a system of configuration settings. A comprehensive reference for the configuration options is provided as Appendix § 11 .7. The user may also consult the wiki [34 ] and/or built-in help for up-to-date information.
The configuration settings are stored in the file ~/.kdotpy/kdotpyrc, which is read and parsed at the start of the program. This file contains key=value pairs for all known configuration options defined in config.py. If any configuration option is missing from ~/.kdotpy/kdotpyrc, the key=value pair is added as a comment (i.e., preceded by #) with the default value. Using this system, the configuration file remains usable if new features are added to kdotpy and the new configuration options will become visible to the user.
It is also possible to use a custom configuration file by using config filename as a command line argument. Multiple files may be loaded in sequence, where the files are processed from left to right, and configuration values loaded later override those loaded earlier. For flexibility, it is also possible to adjust configuration values on the command line by providing config followed by semicolon-separated key=value pairs, like
kdotpy 2d ... config ’key1=value1;key2=value2’ ...
where the single quotes are required by the shell. Both variants of the config argument may be combined in any order.
The configuration values are typically parsed ad hoc : they are evaluated at the moment they are needed. The configuration values are not checked for validity at the start of the program. Thus, error messages related to invalid configuration values may occur at any point during runtime.
An auxiliary subprogram kdotpy config is provided in order to read and manipulate settings easily. It also gives access to the help file which contains detailed information on every configuration option. The command-line syntax for the configuration tool kdotpy config is summarized in § 8.7.4 .
Vector grids
The array of momenta k \mathbf{k} k or magnetic fields B \mathbf{B} B where the Hamiltonian is evaluated is called the ‘grid’. In general, the command line parser yields a ZippedK object, which contains the values of k \mathbf{k} k and B \mathbf{B} B . This object may represent a dispersion (k \mathbf{k} k is a VectorGrid instance, B \mathbf{B} B is single valued), a magnetic-field dependence (k \mathbf{k} k is single valued, B \mathbf{B} B is a VectorGrid instance), or a single point (when both are single valued). A combination of k \mathbf{k} k - and B \mathbf{B} B -dependence is not permitted.
The VectorGrid class stores a multi-dimensional array of k \mathbf{k} k or B \mathbf{B} B values as a cartesian product of values. It may have any one of the following coordinate types:
x, y, z: Values along one of the cartesian coordinate axes.
xy: Cartesian coordinates ( x , y ) (x,y) ( x , y ) in the z = 0 z=0 z = 0 plane.
xyz: Cartesian coordinates ( x , y , z ) (x,y,z) ( x , y , z ) .
pol: Polar coordinates ( r , ϕ ) (r,\phi) ( r , ϕ ) , that convert to cartesian coordinates as ( x , y ) = r ( cos ϕ , sin ϕ ) (x,y)=r(\cos\phi,\sin\phi) ( x , y ) = r ( cos ϕ , sin ϕ ) with z = 0 z=0 z = 0 .
cyl: Cylindrical coordinates ( r , ϕ , z ) (r,\phi,z) ( r , ϕ , z ) , that convert to cartesian coordinates as ( x , y , z ) = ( r cos ϕ , r sin ϕ , z ) (x,y,z)=(r\cos\phi,r\sin\phi,z) ( x , y , z ) = ( r cos ϕ , r sin ϕ , z ) .
sph: Spherical coordinates ( r , θ , ϕ ) (r, \theta, \phi) ( r , θ , ϕ ) , where θ \theta θ is the polar angle in [ 0 , π ] = [ 0 , 180 ∘ ] [0, \pi] = [0, 180^\circ] [ 0 , π ] = [ 0 , 18 0 ∘ ] and ϕ \phi ϕ the azimuthal angle. The relation to cartesian coordinates is given by ( x , y , z ) = ( r sin θ cos ϕ , r sin θ sin ϕ , r cos θ ) (x, y, z) = (r \sin\theta\cos\phi, r \sin\theta\sin\phi, r \cos\theta) ( x , y , z ) = ( r sin θ cos ϕ , r sin θ sin ϕ , r cos θ ) .
In kdotpy, the radial coordinate r r r of the angular coordinate systems may be chosen negative, in contrast to the usual condition that r ≥ 0 r \ge0 r ≥ 0 .
The input of the grid on the command line is done by combination of the vector components on the command line, followed by a single value or a range, for example
kdotpy 2d ... k 0 0.2 / 20 kphi 45 bz 0.1 ...
yields the momentum values given by the polar coordinates ( k i , 45 ∘ ) (k_i, 45^\circ) ( k i , 4 5 ∘ ) with k i = { 0 , 0.01 , … , 0.2 } n m − 1 k_i = \{0, 0.01, \ldots, 0.2\}\,\mathrm{nm}^{-1} k i = { 0 , 0.01 , … , 0.2 } nm − 1 in a magnetic field B = ( 0 , 0 , B z ) \mathbf{B} = (0, 0, B_z) B = ( 0 , 0 , B z ) with B z = 0.1 T B_z = 0.1\,\mathrm{T} B z = 0.1 T . The valid component arguments for momenta, are k, kx, ky, kz, kphi, and ktheta; for magnetic fields, they are b, bx, by, bz, bphi, and btheta. The arguments k and b without explicit component refer to the radial direction if used in combination with angular coordinates. If they are used by themselves, k is equivalent to kx and b is equivalent to bz, i.e., the ‘natural’ directions for momentum and magnetic field, respectively. The values are in units of n m − 1 \mathrm{nm}^{-1} nm − 1 and T \mathrm{T} T for momentum and magnetic field, respectively, and degrees for the angular components.
Values and ranges are input as follows:
k a b / c: Values a a a and b b b are the minimum and maximum of the range, respectively. If c c c is a floating point number, it denotes the step size Δ = c \Delta= c Δ = c . If c c c is an integer, the step size is Δ = ( b − a ) / c \Delta= (b-a)/c Δ = ( b − a ) / c . The resulting values are { a , a + Δ , a + 2 Δ , … , b } \{a, a+\Delta, a+2\Delta, \ldots, b\} { a , a + Δ , a + 2Δ , … , b } . Note that if c c c is an integer, the number of values in this range is c + 1 c+1 c + 1 .
Here, k can be replaced by any of the momentum and magnetic field components listed above. Also, a // (double-slash) operator can be used instead of /. In this case, quadratic stepping is used, which is useful in particular for magnetic fields: bz a b // c (where c c c is an integer) yields the values B z = { a , a + Δ , a + 4 Δ , a + 9 Δ , … , b } T B_z = \{a, a+\Delta, a+4\Delta, a+9\Delta, \ldots, b\}\,\mathrm{T} B z = { a , a + Δ , a + 4Δ , a + 9Δ , … , b } T where Δ = ( b − a ) / c 2 \Delta= (b-a)/c^2 Δ = ( b − a ) / c 2 . The number of values is c + 1 c+1 c + 1 like with the single slash /. The typical use case of // is with the perpendicular magnetic field in Landau-level mode, with a = 0 a=0 a = 0 .
The dimensionality of the grid is determined automatically by kdotpy based on the input of single values and ranges. For momenta, it is always smaller than or equal to the geometric dimension (i.e., the number of momentum components). For magnetic fields, multi-dimensional grids are not supported; the maximum dimension of the grid is 1.
Material parameters
Many of the coefficients of the Hamiltonian are material dependent. The values of these parameters are defined in separate input files. The program provides a default materials file (materials/default) with a set of parameters for HgTe, CdTe, (Hg,Cd)Te, (Hg,Mn)Te, and (Cd,Zn)Te. The user may override these materials and define new ones by providing custom material definitions in their own files in the directory ~/.kdotpy/materials.
The materials files are formatted similar to the .ini format and are parsed by Python’s configparser module. The ‘sections’ in the file serve as the material labels; for example the definitions for HgTe are preceded by the section head [HgTe]. The section contains several param = value pairs. The parser simply reads this data and puts them as keys and values of a dict instance. Comments (everything that follows #) are ignored. In addition, the user may also adjust material parameters on the command line with the argument matparam followed by several key-value pairs.
The ‘left-hand size’ param may be any of the recognized material parameters, as listed in Appendix B.2, or a user defined ‘auxiliary’ parameter which is used in the value of some other parameter. The ‘right-hand size’ value must represent a number or a valid Python expression where a restricted set of functions and operators may be used:
The arithmetic operators +, -, *, /, **. Exponentiation is represented by **, not ^.
The kdotpy defined polynomial functions linint, linearpoly, quadrpoly, cubicpoly, and poly. These represent the functions x ↦ a ( 1 − x ) + b x x \mapsto a(1-x)+bx x ↦ a ( 1 − x ) + b x , x ↦ c 0 + c 1 x x \mapsto c_0+c_1x x ↦ c 0 + c 1 x , x ↦ c 0 + c 1 x + c 2 x 2 x \mapsto c_0+c_1x+c_2x^2 x ↦ c 0 + c 1 x + c 2 x 2 , x ↦ c 0 + c 1 x + c 2 x 2 + c 3 x 3 x \mapsto c_0+c_1x+c_2x^2+c_3x^3 x ↦ c 0 + c 1 x + c 2 x 2 + c 3 x 3 , and x ↦ c 0 + c 1 x + … + c n x n x \mapsto c_0+c_1x+\ldots+c_nx^n x ↦ c 0 + c 1 x + … + c n x n , respectively.
The comparison functions geq, leq, gtr, and less, which implement the binary comparison operators ≥ \ge ≥ , ≤ \le ≤ , > > > , and < < < , respectively.
The value may also contain any other predefined or auxiliary material parameter. If the expression is not valid Python syntax or if any ‘forbidden’ keyword is used (e.g., import), kdotpy will raise an exception. The restricted function and variable labels also cannot be used as param on the left-hand side of =. (The following are also not permitted as param: All Python keywords except as, the numerical constants inf and nan, and the reserved variables x, y, z, and T.) The following examples are an excerpts from the default definitions for HgTe and Hg1 − x _{1-x} 1 − x Cdx _x x Te,
## HgTe, mercury telluride
[HgTe]
compound = HgTe
composition = 1, 1
P = sqrt(18800. * hbarm0)
Ev = 0.0
Ec = -303.0 + 0.495 * T ** 2 / (11.0 + T) # Eg of HgCdTe for x = 0
gamma1 = 4.1
gamma2 = 0.5
gamma3 = 1.3
## HgCdTe (Hg_{1-x} Cd_x Te), mercury cadmium telluride
[HgCdTe]
compound = HgCdTe
linearmix = HgTe,CdTe,x
composition = 1 - x, x, 1 # is also set automatically by linearmix
P = sqrt(18800. * hbarm0)
Eg = -303 * (1 - x) + 1606 * x - 132. * x * (1 - x) + \
(0.495 * (1 - x) - 0.325 * x - 0.393 * x * (1 - x)) * T ** 2 / \
(11.0 * (1 - x) + 78.7 * x + T) # identical to Ref. [HgCdTe2]
Eg0 = -303.0 + 0.495 * T ** 2 / (11.0 + T)
Evoff = -570. * (Eg - Eg0) / (1606 - -303)
Ev = Evoff
Ec = Evoff + Eg
gamma1 = poly( 4.1, -2.8801, 0.3159, -0.0658, x)
gamma2 = poly( 0.5, -0.7175, -0.0790, 0.0165, x)
gamma3 = poly( 1.3, -1.3325, 0.0790, -0.0165, x)
The second example for Hg1 − x _{1-x} 1 − x Cdx _x x Te also illustrates the ‘special parameter’ linearmix, which creates a third material as linear combination of two other materials. Here, linearmix = HgTe,CdTe,x indicates that all material parameters are interpolated as p H g C d T e = ( 1 − x ) p H g T e + x p C d T e p_{\mathrm{HgCdTe}}=(1-x)p_{\mathrm{HgTe}}+xp_{\mathrm{CdTe}} p HgCdTe = ( 1 − x ) p HgTe + x p CdTe . The subsequent definitions (like gamma1 in this example) override the linearly interpolated ones.
The expressions on the right-hand side are parsed by an abstract syntax tree (AST) parser based on Python’s ast module, so that it accepts the ‘whitelisted’ functions and operators only. If an expression value evaluates to a finite value (not ± ∞ \pm\infty ± ∞ , not nan), the parser substitutes that value, otherwise it leaves the expression unevaluated. The latter is common when a material parameter depends on the composition (e.g., x x x in Hg1 − x _{1-x} 1 − x Cdx _x x Te). This is acceptable until the layer stack is built; at that point, all material parameters must evaluate to numerical values.
Using the built-in and custom defined materials is done by using the material label (the section label in the materials file, e.g., [HgTe], without the brackets), possibly followed by up to three numerical values. For example, HgTe simply yields the material HgTe and HgCdTe 68% yields the material HgCdTe with the substitution x → 0.68 x \to0.68 x → 0.68 . As the material label can be any alphanumerical string starting with a letter (numbers, hyphens and underscores are also allowed at following positions), it is not needed to use molecular formulas as labels. For example, the label mercury_telluride would be acceptable too. This also gives the freedom to define multiple sets of parameters for one material, e.g., using labels CdTe_Novik and CdTe_Weiler for CdTe parameters based on the different literature sources (Refs. [3 ] and [16 ] , respectively).
Building the layer stack
The structure of the sample as function of the growth direction z z z is known as the layer stack in the language of kdotpy. The relevant properties of the materials in the device are stored in a LayerStack instance. This includes the material and thickness of each layer, the z z z resolution, the coordinates of the interfaces, the width of the interface smoothening, and the ‘layer names’ (like ‘well’, ‘barrier’, etc.). The LayerStack object is itself an attribute of the PhysParams instance that is used to construct the Hamiltonian.
Importantly, the LayerStack class provides a function that creates a cache of all material parameters, which is stored within PhysParams. The z z z dependence of each material parameter Q is calculated in the following manner. We first construct a set of layer weights functions w l ( z ) w_l(z) w l ( z ) for each layer l l l . Without interface smoothening, w l ( z ) = 1 w_l(z)=1 w l ( z ) = 1 for z z z inside the layer l l l and 0 0 0 elsewhere. For a finite interface smoothening width δ i f \delta_{\mathrm{if}} δ if (by default δ i f = 0.075 \delta_{\mathrm{if}}=0.075 δ if = 0.075 nm), the weight is
w l ( z ) = 1 2 [ tanh ( z − z min , l δ i f ) − tanh ( z − z max , l δ i f ) ] , (77) w_l(z)=\frac{1}{2}\left[\tanh\left(\frac{z-z_{\min,l}}{\delta_{\mathrm{if}}}\right)-\tanh\left(\frac{z-z_{\max,l}}{\delta_{\mathrm{if}}}\right)\right], \tag*{(77)} w l ( z ) = 2 1 [ tanh ( δ if z − z m i n , l ) − tanh ( δ if z − z m a x , l ) ] , (77)
where the layer l l l spans the interval [ z min , l , z max , l ] [z_{\min,l},z_{\max,l}] [ z m i n , l , z m a x , l ] . The weights are normalized as w ~ l ( z ) = w l ( z ) / ∑ l ′ w l ′ ( z ) \widetilde{w}_l(z)=w_l(z)/\sum_{l'}w_{l'}(z) w l ( z ) = w l ( z ) / ∑ l ′ w l ′ ( z ) , so that ∑ l w ~ l ( z ) = 1 \sum_l\widetilde{w}_l(z)=1 ∑ l w l ( z ) = 1 everywhere inside the layer stack. If we write the value of the material parameter Q in layer l l l as Q l Q_l Q l , the function Q ( z ) Q(z) Q ( z ) is constructed as
Q ( z ) = ∑ l w ~ l ( z ) Q l . (78) Q(z)=\sum_l\widetilde{w}_l(z)Q_l. \tag*{(78)} Q ( z ) = l ∑ w l ( z ) Q l . (78)
This function has the desired property that it interpolates smoothly between Q l Q_l Q l and Q l + 1 Q_{l+1} Q l + 1 if δ i f \delta_{\mathrm{if}} δ if is finite, while it approaches the values Q l Q_l Q l away from the interfaces.
In view of the discrete representation of the z z z coordinates, we need to evaluate Q ( z ) Q(z) Q ( z ) only in a discrete array of z z z values. If the z z z resolution is Δ z \Delta z Δ z , we require evaluation at integer and half-integer multiples of Δ z \Delta z Δ z , because the action of the first and second degree derivatives in z z z , given by Eqs. (30) and (35) , respectively, involves Q ( z j ± 1 2 Δ z ) Q(z_j \pm\frac{1}{2}\Delta z) Q ( z j ± 2 1 Δ z ) . The functions Q ( z ) Q(z) Q ( z ) are thus evaluated on a discretized set of coordinates
{ z min − 1 2 Δ z , z min , z min + 1 2 Δ z , … , z max − 1 2 Δ z , z max , z max + 1 2 Δ z } (79) \left\{z_{\min}-\frac{1}{2}\Delta z,z_{\min},z_{\min}+\frac{1}{2}\Delta z,\ldots,z_{\max}-\frac{1}{2}\Delta z,z_{\max},z_{\max}+\frac{1}{2}\Delta z\right\} \tag*{(79)} { z m i n − 2 1 Δ z , z m i n , z m i n + 2 1 Δ z , … , z m a x − 2 1 Δ z , z m a x , z m a x + 2 1 Δ z } (79)
where z min z_{\min} z m i n and z max z_{\max} z m a x refer to the bottom and top of the complete layer stack. In physparams.py, this is achieved by setting
self.cache_z = -0.5 + 0.5 * np.arange(2 * self.nz + 1)
where coordinates are interpreted in units of Δ z \Delta z Δ z with 0 located at z min z_{\min} z m i n at the bottom of the layer stack.
Handling of strain
In kdotpy, we use a simplified strain model for the diagonal components of the strain tensor. (The shear components are assumed to be zero.) By default, we strain each layer to match the in-plane lattice constants to that of the substrate. This defines
ϵ ∥ = ϵ x x = ϵ y y = a s − a 0 a 0 (80) \epsilon_{\parallel}=\epsilon_{xx}=\epsilon_{yy}=\frac{a_s-a_0}{a_0} \tag*{(80)} ϵ ∥ = ϵ xx = ϵ y y = a 0 a s − a 0 (80)
in terms of the target (‘strained’) lattice constant a s a_s a s and the equilibrium lattice constant a 0 a_0 a 0 of each layer material, cf. § 2.7 . The target lattice constant a s a_s a s is determined by one of three command-line arguments
From minimization of the strain-energy tensor [30 , 35 ] , under the assumptions that the substrate is thick (so that its lattice constant stays at the equilibrium value) and that shear strain is absent, we find that the out-of-plane strain of the epitaxial layers equals
ϵ ⊥ = ϵ z z = − 2 C 12 C 11 ϵ ∥ (81) \epsilon_{\perp} = \epsilon_{zz} = -\frac{2C_{12}}{C_{11}}\epsilon_{\parallel} \tag*{(81)} ϵ ⊥ = ϵ z z = − C 11 2 C 12 ϵ ∥ (81)
For both HgTe and CdTe, C 12 / C 11 ≈ 0.69 C_{12}/C_{11} \approx0.69 C 12 / C 11 ≈ 0.69 [2 ] , which is presently hardcoded as a constant. (In a future kdotpy release, strain handling will be improved, by treating the elasticity modules C 11 C_{11} C 11 , C 12 C_{12} C 12 , and C 44 C_{44} C 44 as material parameters.)
The strain command-line argument also allows for several other strain configurations. In short, the values following strain are interpreted as ϵ x x \epsilon_{xx} ϵ xx , ϵ y y \epsilon_{yy} ϵ y y , and ϵ z z \epsilon_{zz} ϵ z z , in order. If any of these values is not specified (omitted or input as -), it is determined from the other value(s), following these rules:
ϵ x x = ϵ y y = − C 12 / C 11 1 + C 12 / C 11 ϵ z z . (82) \epsilon_{xx} = \epsilon_{yy} = -\frac{C_{12}/C_{11}}{1+C_{12}/C_{11}}\epsilon_{zz}. \tag*{(82)} ϵ xx = ϵ y y = − 1 + C 12 / C 11 C 12 / C 11 ϵ z z . (82)
This relation minimizes the strain-energy tensor with ϵ x x \epsilon_{xx} ϵ xx and ϵ y y \epsilon_{yy} ϵ y y as free variables [30 ] .
ϵ z z = − ( C 12 / C 11 ) ( ϵ x x + ϵ y y ) (83) \epsilon_{zz} = -(C_{12}/C_{11})(\epsilon_{xx}+\epsilon_{yy}) \tag*{(83)} ϵ z z = − ( C 12 / C 11 ) ( ϵ xx + ϵ y y ) (83)
which generalizes Eq. (81) to the case where ϵ x x ≠ ϵ y y \epsilon_{xx} \ne\epsilon_{yy} ϵ xx = ϵ y y . (Presently, only ϵ x x = ϵ y y \epsilon_{xx} = \epsilon_{yy} ϵ xx = ϵ y y is supported, but this will change in a future version.)
The relations (82) and (83) apply to growth direction (001). If strain is combined with a nontrivial orientation (command-line argument orient), a correct result is not guaranteed.
Electrostatic potentials
In addition to the intrinsic potentials defined by the band edges, kdotpy can also model electrostatic potentials V ( z ) V(z) V ( z ) . The potential is added to the Hamiltonian as a diagonal matrix, adding V ( z j ) V(z_j) V ( z j ) to each point z j z_j z j in the z z z -coordinate basis. The potential can be read from a file or calculated from a carrier density profile with certain boundary conditions. In kdotpy 2d and kdotpy ll, the potential V ( z ) V(z) V ( z ) is initialized in the following order:
Read the potential from a file, if the command line argument potential filename is provided. The input file must be a CSV file with two columns, labelled z z z and potential in the first row. The values that follow represent the coordinates z i z_i z i and the values V ( z i ) V(z_i) V ( z i ) . The input coordinate values need not align with the z z z coordinates of the lattice: Interpolation and extrapolation is used to calculate V ( z ) V(z) V ( z ) on all z z z coordinates of the lattice. (Thus, certain coordinate values may be omitted, e.g., when V ( z ) = 0 V(z)=0 V ( z ) = 0 for all z ∈ [ z 1 , z 2 ] z \in[z_1,z_2] z ∈ [ z 1 , z 2 ] , one can specify the potential at z 1 z_1 z 1 and z 2 z_2 z 2 and omit all intermediate values.) A numerical multiplier can be added in order to scale the potential, for example potential v.csv 10 adds 10 V ( z ) 10V(z) 10 V ( z ) to the Hamiltonian, where V ( z ) V(z) V ( z ) is the potential defined in v.csv. Multiple arguments and numerical multipliers may be added in order to input linear combinations, for example with potential v1.csv 10 potential v2.csv -5 the potential is 10 V 1 ( z ) − 5 V 2 ( z ) 10V_1(z)-5V_2(z) 10 V 1 ( z ) − 5 V 2 ( z ) . The parsing of potential files is done by the function read_potential() in potential.py.
Calculate a Hartree potential self-consistently, if the command line argument selfcon is given. This method considers the electric charge density profile due to the occupied eigenstates, solves V ( z ) V(z) V ( z ) from the Poisson equation, and then feeds this back into the Hamiltonian, after which diagonalization yields a new set of eigenstates. If this iterative process converges, it yields a self-consistent solution of the Schrödinger and the Poisson equation. We discuss this method in greater detail in § 6.1 .
Define a potential from boundary conditions, specified on the command line. This is a ‘static’ calculation, not done self-consistently. The following commands are the most common ones to define a potential:
vinner v0, where v0 is a numerical value, representing an energy V 0 V_0 V 0 in meV. The potential V ( z ) V(z) V ( z ) is fixed at V ( z 0 ) = 0 V(z_0)=0 V ( z 0 ) = 0 in the centre of the ‘well’ layer and a potential difference V 0 V_0 V 0 is applied between the bottom and top interface of this layer. (This is equivalent to setting the potential to − 1 2 V 0 -\frac{1}{2}V_0 − 2 1 V 0 and 1 2 V 0 \frac{1}{2}V_0 2 1 V 0 at the bottom and top interface of the well layer.) Extrapolation to the other layers is done by assuming a constant electric field.
vouter v0, where v0 is a numerical value, representing an energy V 0 V_0 V 0 in meV. This command is similar to vinner, with the difference that a potential difference V 0 V_0 V 0 is applied between the bottom and top of the full layer stack.
vsurf v0 w, where v0 and w represent an energy V 0 V_0 V 0 in meV and a width w w w in nm. The resulting potential depends on the minimal distance d i f ( z ) d_{\mathrm{if}}(z) d if ( z ) between z z z and each interface z i z_i z i . The potential is
V ( z ) = V 0 ( 1 − d i f ( z ) / w ) (84) V(z)=V_0(1-d_{\mathrm{if}}(z)/w) \tag*{(84)} V ( z ) = V 0 ( 1 − d if ( z ) / w ) (84)
if d i f ( z ) ≤ w d_{\mathrm{if}}(z)\le w d if ( z ) ≤ w , otherwise 0. If the command is followed by q, this is changed to the quadratic dependence V ( z ) = V 0 ( 1 − d i f ( z ) / w ) 2 V(z)=V_0(1-d_{\mathrm{if}}(z)/w)^2 V ( z ) = V 0 ( 1 − d if ( z ) / w ) 2
The parsing of the potential options is done by gate_potential_from_opts(), whereas the solution of V ( z ) V(z) V ( z ) given the boundary conditions is done by solve_potential(), both in potential.py. We provide more details on solving V ( z ) V(z) V ( z ) in Appendix § 10 .§ 7 .
These options may be combined, e.g., if one uses a potential input file together with the self-consistent Hartree method, then the input potential serves as the initial potential for the iterative solution process. For kdotpy 1d, the self-consistent Hartree method is not available. The extra option potentialy filename provides the capability of defining a potential V ( y ) V(y) V ( y ) . For kdotpy bulk and kdotpy bulk-ll, none of the potential options is available.
Construction of Hamiltonian
Bulk geometry
The k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p Hamiltonian is an 8 × 8 8\times8 8 × 8 matrix H p q ( k x , k y , k z ) H_{pq}(k_x,k_y,k_z) H pq ( k x , k y , k z ) with orbital indices p , q p,q p , q and depending on the momentum coordinates ( k x , k y , k z ) (k_x,k_y,k_z) ( k x , k y , k z ) . For bulk materials, the band structure can simply be obtained by substituting values ( k x , k y , k z ) (k_x,k_y,k_z) ( k x , k y , k z ) and diagonalizing the 8 × 8 8\times8 8 × 8 matrix as to obtain 8 eigenvalues and 8 eigenvectors.
Two-dimensional geometry
As discussed in § 2.2 , layered structures break translational symmetry in the z z z direction. The momentum k z k_z k z is substituted by the operator − i ∂ z -\mathrm{i}\partial_z − i ∂ z , and the coordinates are discretized to z = { z j } z=\{z_j\} z = { z j } . This set has to be finite for the sake of calculation. With n z n_z n z coordinates in this set, the dimension of the Hilbert space is 8 n z 8n_z 8 n z . The Hamiltonian is thus represented as an 8 n z × 8 n z 8n_z\times8n_z 8 n z × 8 n z matrix H i , p ; j , q ( k x , k y ) H_{i,p;j,q}(k_x,k_y) H i , p ; j , q ( k x , k y ) where i , j i,j i , j represent the z z z coordinates and p , q p,q p , q the orbitals.
In kdotpy, the matrix H i , p ; j , q ( k x , k y ) H_{i,p;j,q}(k_x,k_y) H i , p ; j , q ( k x , k y ) is constructed as a sparse matrix from 8 × 8 8\times8 8 × 8 blocks. (The blocks are 6 × 6 6\times6 6 × 6 is the six-orbital Kane model is used. For the sake of clarity, we assume the eight-orbital model in the following discussion.) The 8 × 8 8\times8 8 × 8 blocks that constitute several terms of the Hamiltonian are defined in the submodule hamiltonian.blocks. They are summed up in a function from hamiltonian.full. For the 2D geometry, the appropriate function is h ( z ) h(z) h ( z ) , defined with the argument signature
hz(z, dz, k, b, params, **kwds)
This function returns an 8 × 8 8 \times8 8 × 8 matrix for each combination of arguments. The indices i , j i,j i , j for the z z z coordinates encoded as z and z + dz, respectively. The arguments k and b are momentum and magnetic field. The argument params is the PhysParams instance needed to construct the matrices and **kwds denotes several additional options.
In line with the algorithm discussed in § 2.2 , hz returns a nonzero result only for dz being 0 or ± 1 \pm1 ± 1 . For dz = 0, the results are the 8 × 8 8 \times8 8 × 8 submatrices H i , p ; i , q H_{i,p;i,q} H i , p ; i , q appearing on the block diagonal of the full Hamiltonian matrix. For dz = 1 and dz = -1, we find the off-diagonal blocks H i , p ; i ± 1 , q H_{i,p;i\pm1,q} H i , p ; i ± 1 , q that contain terms involving z derivatives, see, e.g., Eqs. (30) and (35) .
The full Hamiltonian matrix, a sparse matrix of dimension 8 n z × 8 n z 8n_z \times8n_z 8 n z × 8 n z , is constructed as follows.
Initialize lists allrows, allcols, allvals. These will be used later to construct a sparse matrix in COO (coordinate) format, where nonzero matrix elements are represented as triplets ( I , J , v ) (I,J,v) ( I , J , v ) of row index, column index, and value.
Iterate over the diagonal blocks: For z = 0 , … , n z − 1 z = 0,\ldots,n_z-1 z = 0 , … , n z − 1 , call hz(z, 0, k, b, params, **kwds). Flatten the resulting 8 × 8 8 \times8 8 × 8 matrix m and append the values to allvals,
allvals.append(m.flatten())
The corresponding row and column indices are I = 8 z + p I = 8z + p I = 8 z + p , J = 8 z + q J = 8z + q J = 8 z + q where p , q p,q p , q are the orbital indices. This is implemented as
allrows.append(z * norb + rows0)
allcols.append(z * norb + cols0)
where rows0 and cols0 are (precalculated) arrays of length 64 with the row and column indices (0,...,7) corresponding to the flattened matrix.
Iterate over the off-diagonal blocks. For z = 0 , … , n z − 2 z = 0,\ldots,n_z-2 z = 0 , … , n z − 2 , calculate
mm = 0.5 * (hz(z + 1, -1, k, b, params, **kwds) \
+ hz(z, 1, k, b, params, **kwds).conjugate().transpose())
mp = mm.conjugate().transpose()
In principle, we could have used hz(z + 1, -1, k, b, params, **kwds) and hz(z, 1, k, b, params, **kwds) as the two blocks above and below the diagonal. By construction they are each other’s hermitian conjugate, but we symmetrize them in order to eliminate numerical errors and to make the Hamiltonian exactly hermitian. We proceed by filling the value, row, and column lists as
allvals.append(mp.flatten())
allrows.append(z * norb + rows0)
allcols.append((z + 1) * norb + cols0)
allvals.append(mm.flatten())
allrows.append((z + 1) * norb + rows0)
allcols.append(z * norb + cols0)
Turn allvals, allrows, and allcols into one-dimensional arrays and construct the sparse matrix from all nonzero values,
non0 = (allvals != 0)
s = coo_matrix(
(allvals[non0], (allrows[non0], allcols[non0])),
shape = (norb * nz, norb * nz), dtype = complex
)
using coo_matrix from scipy.sparse.
The COO format is suitable for construction of a sparse matrix, but not so much for other operations. Diagonalization is done most efficiently in the CSC (compressed sparse column) format. For obtaining a sparse matrix in CSC format, constructing the matrix in COO format and converting it to CSC is more efficient than constructing it directly as a CSC matrix.2
One-dimensional geometry
The construction of the Hamiltonian for 1D geometries follows the same line of reasoning. With the additional discretization of the y y y coordinates, the Hilbert space has dimension 8 n y n z 8n_y n_z 8 n y n z , where n y n_y n y and n z n_z n z are the number of coordinate values in y y y and z z z direction, respectively. The Hamiltonian is thus an 8 n y n z × 8 n y n z 8n_y n_z \times8n_y n_z 8 n y n z × 8 n y n z matrix H l , i , p ; m , j , q ( k x , k y ) H_{l,i,p;m,j,q}(k_x,k_y) H l , i , p ; m , j , q ( k x , k y ) where the indices l , m l,m l , m encode the y y y coordinates, i , j i,j i , j the z z z coordinates and p , q p,q p , q the orbitals. The construction is by filling a sparse matrix with 8 × 8 8 \times8 8 × 8 blocks; the appropriate function for a 1D geometry (in absence of magnetic fields) is hzy(), defined with the argument signature
hzy(z, dz, y, dy, kx, params, **kwds)
where the indices l , m l,m l , m are represented by y y y and y + d y y + dy y + d y , and i , j i,j i , j by z z z and z + d z z + dz z + d z as before. The sparse matrix constructor iterates over z z z and y y y . For example, for the diagonal terms (d z = 0 dz = 0 d z = 0 and d y = 0 dy = 0 d y = 0 ),
allvals.append(m.flatten())
allrows.append(y * norb * nz + z * norb + rows0)
allcols.append(y * norb * nz + z * norb + cols0)
where the row and column indices are obtained as I = 8 n z y + 8 z + p I = 8n_z y + 8z + p I = 8 n z y + 8 z + p and J = 8 n z y + 8 z + q J = 8n_z y + 8z + q J = 8 n z y + 8 z + q , respectively. The constructor also does a similar iteration for three types of off-diagonal blocks, ( d z , d y ) = ( 0 , ± 1 ) (dz,dy) = (0,\pm1) ( d z , d y ) = ( 0 , ± 1 ) , ( ± 1 , 0 ) (\pm1,0) ( ± 1 , 0 ) , and ( ± 1 , ± 1 ) (\pm1,\pm1) ( ± 1 , ± 1 ) . Like the 2D geometry, symmetrization is applied to the off-diagonal blocks to make the Hamiltonian matrix exactly hermitian. The constructor function also has an option periodicy by means of which periodic boundary conditions can be applied in the y y y direction. This is done by adding the blocks corresponding to ( l , m ) = ( 0 , n y − 1 ) (l,m) = (0,n_y - 1) ( l , m ) = ( 0 , n y − 1 ) and ( n y − 1 , 0 ) (n_y - 1,0) ( n y − 1 , 0 ) . In the presence of magnetic fields, the blocks are obtained by using hzy_magn(), instead of hzy(), but the sparse construction itself is fully analogous.
Landau levels in axial approximation
In the Landau level formalism, the in-plane momentum operators k ^ x \hat{k}_x k ^ x and k ^ y \hat{k}_y k ^ y are substituted by the ladder operators a a a and a † a^\dagger a † acting on the Landau level states, see § 2.4 . In the axial approximation, the Landau level index n n n is a conserved quantum number, so that the Hamiltonian may be split in several independent blocks H a x , ( n ) H^{\mathrm{ax},(n)} H ax , ( n ) . The diagonalization is then simply done for each n = − 2 , − 1 , 0 , … , n max n=-2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x , where n max n_{\max} n m a x is the maximum index set by the command line argument nll.
For the axial model, we use the symbolic Landau level mode. (The label symbolic distinguishes it from the legacy mode, which was implemented earlier, but is no longer used.) In this mode, a symbolic form of the 2D Hamiltonian H ( k x , k y , z ) H(k_x,k_y,z) H ( k x , k y , z ) is constructed. Subsequently, the operators k ^ x \hat{k}_x k ^ x and k ^ y \hat{k}_y k ^ y are substituted by a a a and a † a^\dagger a † following Eq. (51) . The block H a x , ( n ) H^{\mathrm{ax},(n)} H ax , ( n ) is obtained by applying the ladder operators which yields factors involving n n n . In detail, these steps are performed as follows:
H ( k x , k y , z ) = H ( 0 , 0 , z ) + k x ( ∂ k x H ) ( 0 , 0 , z ) + k y ( ∂ k y H ) ( 0 , 0 , z ) + 1 2 k x 2 ( ∂ k x 2 H ) ( 0 , 0 , z ) + 1 2 k y 2 ( ∂ k y 2 H ) ( 0 , 0 , z ) + k x k y ( ∂ k x ∂ k y H ) ( 0 , 0 , z ) . (85) H(k_x,k_y,z) = H(0,0,z) + k_x(\partial_{k_x}H)(0,0,z) + k_y(\partial_{k_y}H)(0,0,z)
+ \frac{1}{2}k_x^2(\partial_{k_x}^2H)(0,0,z) + \frac{1}{2}k_y^2(\partial_{k_y}^2H)(0,0,z) + k_xk_y(\partial_{k_x}\partial_{k_y}H)(0,0,z). \tag*{(85)} H ( k x , k y , z ) = H ( 0 , 0 , z ) + k x ( ∂ k x H ) ( 0 , 0 , z ) + k y ( ∂ k y H ) ( 0 , 0 , z ) + 2 1 k x 2 ( ∂ k x 2 H ) ( 0 , 0 , z ) + 2 1 k y 2 ( ∂ k y 2 H ) ( 0 , 0 , z ) + k x k y ( ∂ k x ∂ k y H ) ( 0 , 0 , z ) . (85)
We evaluate H 0 ( z ) ≡ H ( 0 , 0 , z ) H_0(z) \equiv H(0,0,z) H 0 ( z ) ≡ H ( 0 , 0 , z ) and its first and second degree derivatives at ( k x , k y ) = ( 0 , 0 ) (k_x,k_y) = (0,0) ( k x , k y ) = ( 0 , 0 ) .
We calculate the derivatives as
H x ( z ) = ( ∂ k x H ) ( 0 , 0 , z ) = H ( Δ k x , 0 , z ) − H ( − Δ k x , 0 , z ) 2 Δ k x H y ( z ) = ( ∂ k y H ) ( 0 , 0 , z ) = H ( 0 , Δ k y , z ) − H ( 0 , − Δ k y , z ) 2 Δ k y H x x ( z ) = ( ∂ k x 2 H ) ( 0 , 0 , z ) = H ( Δ k x , 0 , z ) − 2 H ( 0 , 0 , z ) + H ( − Δ k x , 0 , z ) 2 ( Δ k x ) 2 H y y ( z ) = ( ∂ k y 2 H ) ( 0 , 0 , z ) = H ( 0 , Δ k y , z ) − 2 H ( 0 , 0 , z ) + H ( 0 , − Δ k y , z ) 2 ( Δ k y ) 2 H x y ( z ) = ( ∂ k x ∂ k y H ) ( 0 , 0 , z ) = H ( Δ k x , Δ k y , z ) − H ( Δ k x , − Δ k y , z ) − H ( − Δ k x , Δ k y , z ) + H ( − Δ k x , − Δ k y , z ) Δ k x Δ k y . (86) \begin{aligned}
H_x(z) &= (\partial_{k_x} H)(0,0,z) = \frac{H(\Delta k_x,0,z)-H(-\Delta k_x,0,z)}{2\Delta k_x} \\
H_y(z) &= (\partial_{k_y} H)(0,0,z) = \frac{H(0,\Delta k_y,z)-H(0,-\Delta k_y,z)}{2\Delta k_y} \\
H_{xx}(z) &= (\partial_{k_x}^2 H)(0,0,z) = \frac{H(\Delta k_x,0,z)-2H(0,0,z)+H(-\Delta k_x,0,z)}{2(\Delta k_x)^2} \\
H_{yy}(z) &= (\partial_{k_y}^2 H)(0,0,z) = \frac{H(0,\Delta k_y,z)-2H(0,0,z)+H(0,-\Delta k_y,z)}{2(\Delta k_y)^2} \\
H_{xy}(z) &= (\partial_{k_x}\partial_{k_y} H)(0,0,z) \\
&= \frac{H(\Delta k_x,\Delta k_y,z)-H(\Delta k_x,-\Delta k_y,z)-H(-\Delta k_x,\Delta k_y,z)+H(-\Delta k_x,-\Delta k_y,z)}{\Delta k_x\Delta k_y}. \tag*{(86)}
\end{aligned} H x ( z ) H y ( z ) H xx ( z ) H y y ( z ) H x y ( z ) = ( ∂ k x H ) ( 0 , 0 , z ) = 2Δ k x H ( Δ k x , 0 , z ) − H ( − Δ k x , 0 , z ) = ( ∂ k y H ) ( 0 , 0 , z ) = 2Δ k y H ( 0 , Δ k y , z ) − H ( 0 , − Δ k y , z ) = ( ∂ k x 2 H ) ( 0 , 0 , z ) = 2 ( Δ k x ) 2 H ( Δ k x , 0 , z ) − 2 H ( 0 , 0 , z ) + H ( − Δ k x , 0 , z ) = ( ∂ k y 2 H ) ( 0 , 0 , z ) = 2 ( Δ k y ) 2 H ( 0 , Δ k y , z ) − 2 H ( 0 , 0 , z ) + H ( 0 , − Δ k y , z ) = ( ∂ k x ∂ k y H ) ( 0 , 0 , z ) = Δ k x Δ k y H ( Δ k x , Δ k y , z ) − H ( Δ k x , − Δ k y , z ) − H ( − Δ k x , Δ k y , z ) + H ( − Δ k x , − Δ k y , z ) . (86)
Here, the values of Δ k x \Delta k_x Δ k x and Δ k y \Delta k_y Δ k y can be set arbitrarily, because the Hamiltonian is quadratic and does not contain higher-order terms.
H ( k ^ x , k ^ y , z ) = H 0 ( z ) + k ^ x H x ( z ) + k ^ y H y ( z ) + 1 2 k ^ x 2 H x x ( z ) + 1 2 k ^ y 2 H y y ( z ) + 1 2 { k ^ x , k ^ y } H x y ( z ) . (87) H(\hat{k}_x,\hat{k}_y,z)=H_0(z)+\hat{k}_xH_x(z)+\hat{k}_yH_y(z)+\frac{1}{2}\hat{k}_x^2H_{xx}(z)+\frac{1}{2}\hat{k}_y^2H_{yy}(z)+\frac{1}{2}\{\hat{k}_x,\hat{k}_y\}H_{xy}(z). \tag*{(87)} H ( k ^ x , k ^ y , z ) = H 0 ( z ) + k ^ x H x ( z ) + k ^ y H y ( z ) + 2 1 k ^ x 2 H xx ( z ) + 2 1 k ^ y 2 H y y ( z ) + 2 1 { k ^ x , k ^ y } H x y ( z ) . (87)
Note that the order of the operators is important. To simplify the substitution of ladder operators, we first transform to k ^ ± = k ^ x ± i k ^ y \hat{k}_{\pm}=\hat{k}_x\pm i\hat{k}_y k ^ ± = k ^ x ± i k ^ y . We thus obtain the symbolic Hamiltonian
H ( k ^ + , k ^ − , z ) = H 0 ( z ) + k ^ + H + ( z ) + k ^ − H − ( z ) + 1 2 k ^ + 2 H + + ( z ) + 1 2 k ^ − 2 H − − ( z ) + 1 2 k ^ + k ^ − H + − ( z ) + 1 2 k ^ − k ^ + H − + ( z ) . (88) \begin{aligned}
H(\hat{k}_+,\hat{k}_-,z) &= H_0(z)+\hat{k}_+H_+(z)+\hat{k}_-H_-(z) \\
&\quad+\frac{1}{2}\hat{k}_+^2H_{++}(z)+\frac{1}{2}\hat{k}_-^2H_{--}(z)+\frac{1}{2}\hat{k}_+\hat{k}_-H_{+-}(z)+\frac{1}{2}\hat{k}_-\hat{k}_+H_{-+}(z). \tag*{(88)}
\end{aligned} H ( k ^ + , k ^ − , z ) = H 0 ( z ) + k ^ + H + ( z ) + k ^ − H − ( z ) + 2 1 k ^ + 2 H ++ ( z ) + 2 1 k ^ − 2 H −− ( z ) + 2 1 k ^ + k ^ − H +− ( z ) + 2 1 k ^ − k ^ + H −+ ( z ) . (88)
with H ± = 1 2 ( H x ∓ H y ) H_{\pm}=\frac{1}{2}(H_x\mp H_y) H ± = 2 1 ( H x ∓ H y ) , H ± ± = 1 2 ( H x x − H y y ∓ 2 i H x y ) H_{\pm\pm}=\frac{1}{2}(H_{xx}-H_{yy}\mp2iH_{xy}) H ±± = 2 1 ( H xx − H y y ∓ 2 i H x y ) , and H + − = H − + = 1 2 ( H x x + H y y ) H_{+-}=H_{-+}=\frac{1}{2}(H_{xx}+H_{yy}) H +− = H −+ = 2 1 ( H xx + H y y ) .
self.opsum = {
"": h0, "+": hkp, "-": hkm,
"++": hkpkp, "--": hkmkm, "+-": hkpkm, "-+": hkpkm
}
where self refers to the SymbolicMatrix instance. The keys of the operator sum dict are strings that represent combinations of operators k ^ ± \hat{k}_{\pm} k ^ ± ; the values are the 8 n z × 8 n z 8n_z \times8n_z 8 n z × 8 n z matrices H 0 H_0 H 0 , H + H_+ H + , H − H_- H − , etc.
The SymbolicMatrix class has a member function SymbolicMatrix.ll_evaluate() that effectively evaluates matrix elements of the form ⟨ Φ ( n ′ ) ∣ H ( a , a † , z ) ∣ Ψ ( n ) ⟩ \langle\Phi^{(n')}|H(a,a^\dagger,z)|\Psi^{(n)}\rangle ⟨ Φ ( n ′ ) ∣ H ( a , a † , z ) ∣ Ψ ( n ) ⟩ , cf. Eq. (52) . (For the axial model, n ′ = n n'=n n ′ = n .) It acts with the ladder operators on the Landau level states ∣ n + δ n ⟩ |n+\delta n\rangle ∣ n + δ n ⟩ (δ n = − 1 , 0 , 1 , 2 \delta n=-1,0,1,2 δ n = − 1 , 0 , 1 , 2 ) and replaces them by the appropriate values (that depend on n n n and the magnetic field B z B_z B z ). The matrix elements are calculated for each term in the operator sum separately. The result is the sum over these terms. It represents H a x , ( n ) H_{\mathrm{ax},(n)} H ax , ( n ) as an 8 n z × 8 n z 8n_z \times8n_z 8 n z × 8 n z matrix. (Except for n = − 2 , − 1 , 0 n=-2,-1,0 n = − 2 , − 1 , 0 , where the number of orbitals is 1 , 4 , 7 1,4,7 1 , 4 , 7 , respectively, instead of 8 8 8 .)
We note that the construction of the SymbolicMatrix object needs to be done only once. This object can then be evaluated repeatedly by calling ll_evaluate() for each n = − 2 , − 1 , 0 , … , n max n=-2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x and for multiple values of B z B_z B z .
Landau levels in full' mode
In absence of axial symmetry, the Landau level index n n n fails to be a conserved quantum number. As argued in § 2.4 , the nonaxial terms R n o n a x \mathbf{R}^{\mathrm{nonax}} R nonax in the k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p Hamiltonian couple Landau levels n ′ n' n ′ and n n n with n ′ − n = ± 4 n'-n=\pm4 n ′ − n = ± 4 . (That is, ⟨ Φ ( n ′ ) ∣ H ∣ Ψ ( n ) ⟩ \langle\Phi^{(n')}|H|\Psi^{(n)}\rangle ⟨ Φ ( n ′ ) ∣ H ∣ Ψ ( n ) ⟩ is nonzero for n ′ − n = − 4 , 0 , 4 n'-n=-4,0,4 n ′ − n = − 4 , 0 , 4 .) For lower symmetry, there may be other nonzero matrix elements as well for other combinations of n ′ n' n ′ and n n n with ∣ n ′ − n ∣ ≤ 4 |n'-n|\leq4 ∣ n ′ − n ∣ ≤ 4 .
The ‘full’ Landau level Hamiltonian contains the Landau-level degrees of freedom in the Hilbert space. The matrix structure of the Hamiltonian can thus be expressed as H n ′ , i , p ; n , j , q ( B ) H_{n',i,p;n,j,q}(B) H n ′ , i , p ; n , j , q ( B ) , with n ′ , n n',n n ′ , n being the Landau level indices, i , j i,j i , j the z z z coordinates, and p , q p,q p , q the orbitals. This matrix is constructed as a sparse matrix as follows:
Initialize lists allrows, allcols, allvals.
Iterate over the Landau indices n = − 2 , − 1 , 0 , … , n max n=-2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x . For each index n n n , iterate over n ′ = n , … , n + 4 n'=n,\ldots,n+4 n ′ = n , … , n + 4 with n ′ ≤ n max n'\leq n_{\max} n ′ ≤ n m a x . Evaluate the ( n ′ , n ) (n',n) ( n ′ , n ) block of the symbolic Hamiltonian as
ham = hsym.ll_evaluate((nprime, n), magn, ...)
This yields a (sparse) matrix of dimension n o r b ( n ′ ) n z × n o r b ( n ) n z n_{\mathrm{orb}}(n')n_z\times n_{\mathrm{orb}}(n)n_z n orb ( n ′ ) n z × n orb ( n ) n z , where n o r b ( n ) n_{\mathrm{orb}}(n) n orb ( n ) is the number of orbitals for Landau level index n n n , i.e., 1, 4, 7, or 8 for n = − 2 , − 1 , 0 n=-2,-1,0 n = − 2 , − 1 , 0 , and n ≥ 1 n\geq1 n ≥ 1 , respectively.
If the block ham is nonzero (i.e., ham.nnz > 0), convert it to a sparse matrix hamcoo in COO format and extract its values, row indices, and column indices. The block is added the full matrix by copying its values and taking the indices shifted by the correct index offsets
allvals.append(hamcoo.data)
allrows.append(index_offsets[nprime + 2] + hamcoo.row)
allcols.append(index_offsets[n + 2] + hamcoo.col)
where index_offsets is a (precalculated) array of index offsets, defined as the cumulative number of degrees of freedom n o r b ( n ′ ) n z n_{\mathrm{orb}}(n')n_z n orb ( n ′ ) n z for all Landau levels n ′ < n n'<n n ′ < n . The values of index_offsets[n + 2] are equal to 0 , n z , 5 n z , 12 n z 0,n_z,5n_z,12n_z 0 , n z , 5 n z , 12 n z for n = − 2 , − 1 , 0 , 1 n=-2,-1,0,1 n = − 2 , − 1 , 0 , 1 and ( 4 + 8 n ) n z (4+8n)n_z ( 4 + 8 n ) n z for n ≥ 1 n\geq1 n ≥ 1 .
s = coo_matrix(
(allvals, (allrows, allcols)), shape = (dim, dim), dtype = complex
)
where d i m = ( 12 + 8 n max ) n z \mathrm{dim}=(12+8n_{\max})n_z dim = ( 12 + 8 n m a x ) n z . Convert it to CSC format and return the result.
This algorithm is implemented as the function hz_sparse_ll_full() in the submodule hamiltonian.hamiltonian.
Transformable Hamiltonian
The default way of constructing the 8 × 8 8\times8 8 × 8 blocks is by direct definition of the matrices by element. These built-in definitions are appropriate for crystals grown along the (001) direction, the most common direction used in crystal growth. Unfortunately, constructing the Hamiltonian for a generic growth direction from the Hamiltonian for (001) is not straightforward [2 ] .
In kdotpy, we follow a different approach and construct the Hamiltonian bottom up. The idea is that the terms in the Hamiltonian are written as products of momenta k i k_i k i and angular momentum matrices σ j \sigma_j σ j , J j J_j J j , T j T_j T j , T m T_m T m (i , j , l , m = x , y , z i,j,l,m=x,y,z i , j , l , m = x , y , z ), similar to Table C.5 in the book by Winkler [15 ] . Each quantity has known transformation rules given by a representation of the group S O ( 3 ) \mathrm{SO}(3) SO ( 3 ) of the proper rotations of three-dimensional space.
Vector representation: The irreducible three-dimensional representation of SO(3) describes the transformations of vector-like quantities. Examples are momentum ( k x , k y , k z ) (k_x,k_y,k_z) ( k x , k y , k z ) , and angular momentum ( σ x , σ y , σ z ) (\sigma_x,\sigma_y,\sigma_z) ( σ x , σ y , σ z ) and ( J x , J y , J z ) (J_x,J_y,J_z) ( J x , J y , J z ) .
( 2 T y z , 2 T z x , 2 T x y , T x x − T y y , ( 2 T z z − T x x − T y y ) / 3 ) (89) (2T_{yz},2T_{zx},2T_{xy},T_{xx}-T_{yy},(2T_{zz}-T_{xx}-T_{yy})/\sqrt{3}) \tag*{(89)} ( 2 T y z , 2 T z x , 2 T x y , T xx − T y y , ( 2 T z z − T xx − T y y ) / 3 ) (89)
(in the H 68 H_{68} H 68 block) transforms in this representation.
Inversion does not exist in SO(3), hence we do not distinguish axial vectors from regular vectors.
We use this information define the transformation between the lattice coordinates, related to the crystal lattice, and the device coordinates , attached to the geometry of the device. In this section, we denote the device (or sample) coordinates as ( x , y , z ) (x,y,z) ( x , y , z ) . The z z z direction is by definition the growth direction. For a strip geometry, the longitudinal direction (in which momentum is defined) is x x x and the transversal direction (confined) is y y y . For lattice coordinates, we use the primed symbols ( x ′ , y ′ , z ′ ) (x',y',z') ( x ′ , y ′ , z ′ ) . The ‘primed’ axes are aligned with the axes of the crystal lattice. The two coordinate systems are related by a pure rotation,
( x ′ , y ′ , z ′ ) = R ( x , y , z ) (x',y',z')=R(x,y,z) ( x ′ , y ′ , z ′ ) = R ( x , y , z )
where R R R is a matrix in SO(3), i.e., an orthogonal 3 × 3 3 \times3 3 × 3 matrix with determinant + 1 +1 + 1 . Note that for the growth direction (001), the two coordinate systems coincide; in other words, R R R is the identity transformation.
The definition of the Hamiltonian is in terms of the lattice coordinates ( x ′ , y ′ , z ′ ) (x',y',z') ( x ′ , y ′ , z ′ ) , because the electrons are subject to the (local) crystal environment. In order to calculate the band structure for a non-trivial lattice orientation, the Hamiltonian defined in terms of momenta k i k_i k i and angular momenta J i J_i J i is transformed into device coordinates ( x , y , z ) (x,y,z) ( x , y , z ) using the transformation matrix R R R . The following example illustrates this principle: Take the γ 3 \gamma_3 γ 3 term in the Γ 8 \Gamma_8 Γ 8 block [cf. Eq. (15)], which can be written as
− γ 3 [ { J x ′ , J y ′ } { k x ′ , k y ′ } + { J y ′ , J z ′ } { k y ′ , k z ′ } + { J z ′ , J x ′ } { k z ′ , k x ′ } ] (90) -\gamma_3\left[\{J_{x'},J_{y'}\}\{k_{x'},k_{y'}\}+\{J_{y'},J_{z'}\}\{k_{y'},k_{z'}\}+\{J_{z'},J_{x'}\}\{k_{z'},k_{x'}\}\right] \tag*{(90)} − γ 3 [ { J x ′ , J y ′ } { k x ′ , k y ′ } + { J y ′ , J z ′ } { k y ′ , k z ′ } + { J z ′ , J x ′ } { k z ′ , k x ′ } ] (90)
where A , B = A B + B A A,B=AB+BA A , B = A B + B A and we have explicitly indicated that it is defined in the primed (crystal) coordinate system. The unprimed version of this term is then found by setting
( J x ′ , J y ′ , J z ′ ) = R ( J x , J y , J z ) (J_{x'},J_{y'},J_{z'})=R(J_x,J_y,J_z) ( J x ′ , J y ′ , J z ′ ) = R ( J x , J y , J z )
and
( k x ′ , k y ′ , k z ′ ) = R ( k x , k y , k z ) . (91) (k_{x'},k_{y'},k_{z'})=R(k_x,k_y,k_z). \tag*{(91)} ( k x ′ , k y ′ , k z ′ ) = R ( k x , k y , k z ) . (91)
The Hamiltonian is stored in tensor form, where each term is stored as a separate tensor. The term in this example is encoded as tensor T i j ; k l T_{ij;kl} T ij ; k l ; the relation Hamiltonian term is then found by setting T i j ; k l k i k j J k J l T_{ij;kl}k_i k_j J_k J_l T ij ; k l k i k j J k J l . (Einstein summation convention assumed.) The transformation to device coordinates is then given by
T i j ; k l ′ = R i a R j b R k c R l d T a b c d , (92) T'_{ij;kl}=R_{ia}R_{jb}R_{kc}R_{ld}T_{abcd}, \tag*{(92)} T ij ; k l ′ = R ia R j b R k c R l d T ab c d , (92)
This transformation is done for all terms in the Hamiltonian separately.
For the implementation in kdotpy, each term in the Hamiltonian is represented by instances of the KJTtensor class. These are then transformed and evaluated by substituting the angular momentum matrices J j J_j J j . The result is a KTermsDict instance that encodes sum of terms M i j k i k j M_{ij}k_i k_j M ij k i k j where M M M is a matrix. In detail, the algorithm for constructing and transforming the Hamiltonian is as follows:
g3_tens = KJTtensor(
{'yzyz':1, 'xzxz':1, 'yxyx':1}, nk = 2
).symmetrize((0,1), fill = True).symmetrize((2,3), fill = True)
for tens, tens_name in zip(all_tens, tens_names):
invariant = tens.is_invariant_under_transform(params.lattice_trans)
if not invariant:
tens.transform(params.lattice_trans, in_place = True).chop()
Subsequently, calling KJTensor.apply_jmat() on the transformed KJTensor instances turns them into matrix form by substituting the spin matrices J j J_j J j for their matrix representations. This returns a KTerms instance, which encodes the sums of the form M i j k i k j M_{ij}k_i k_j M ij k i k j where M M M is a matrix. Multiple KTerms instances are collected in the KTermsDict instance kterms. For the example term Eq. (90)
kterms = KTermsdict()
...
kterms[’g3_88’] = \
g3_tens.apply_jmat(spin.j3basis, symmetrize_k = True).chop()
Here, the term labelled {’g3_88’ in kterms is a KTerms instance defined by substituting the ‘J J J basis’ (simply the set of matrices J x , J y , J z J_x,J_y,J_z J x , J y , J z ) on the already transformed KJTensor labelled g3_tens. We enforce symmetrization in the momentum components and use .chop() to chop off almost-zero values.
A non-trivial lattice orientation can be requested from the command-line by using the argument orientation with one to three further parameters that define the transformation matrix R R R (see Appendix § 11 .§ 3 for details). If this is done, the KTermsDict object is constructed as described above and passed to the Hamiltonian block construction function as argument kterms. These functions are then responsible for composing the Hamiltonian from all different terms, and for substituting the momentum components k i k_i k i as usual: By discretized derivatives in the confined directions and by momentum values in the unconfined directions.
The orientation may be set as orientation - 001 for the default growth direction. This applies the formalism described here with the rotation matrix R R R being the identity. In absence of an orientation (or an equivalent) argument, the regular construction method of the Hamiltonian is used. Comparison between the two is useful for verification that the two representations of the Hamiltonian yield the same result. We do not use the transformable representation of the Hamiltonian by default, because the regular construction method is significantly faster.
Diagonalization
Default eigensolver: Arnoldi with shift-and-invert
Diagonalization is the process of finding the eigenvalues and eigenvectors of a square matrix M M M . This is an ubiquitous numerical problem, for which several algorithms have been developed over the years. Perhaps the most well-known algorithm adapted to large sparse matrices is the Lanczos algorithm, that finds a subset of the eigenvalues (typically the ones largest in magnitude) and the corresponding eigenvectors for a hermitian matrix M M M [36 ] . The matrix M M M is applied iteratively to a set of independent vectors v j \boldsymbol{v}_j v j until sufficient convergence is reached. The idea is that matrix-vector multiplication is a relatively cheap operation if the matrix M M M is sparse. The naive implementation of this method is numerically unstable, but it can be adapted to yield reliable results [37 ] . The Arnoldi iteration method extends the Lanczos method to generic complex matrices. The implicitly restarted Arnoldi method is a commonly applied method thanks to its implementation in the popular ARPACK package [38 ] , that has been linked to by many software packages, including the SciPy library for Python.
In order for these methods to be usable for kdotpy, we need to make an additional intermediate step. The Lanczos and Arnoldi methods find the eigenvalues with the largest magnitude, yet for band structures, we are typically most interested in the eigenvalues close to the charge neutrality point. Instead of finding the eigenvalues of the Hamiltonian H H H itself, we apply the shift-and-invert algorithm and apply Arnoldi/Lanczos to the matrix
M = ( H − σ I ) − 1 (93) M = (H - \sigma I)^{-1} \tag*{(93)} M = ( H − σ I ) − 1 (93)
where I I I is the identity matrix and σ \sigma σ is the target energy . Indeed, finding the n e i g n_{\mathrm{eig}} n eig largest eigenvalues of M M M is equivalent to finding the n e i g n_{\mathrm{eig}} n eig eigenvalues of H H H with smallest distance to σ \sigma σ . Implementations of the shift-and-invert algorithm generally do not store the matrix ( H − σ I ) − 1 (H-\sigma I)^{-1} ( H − σ I ) − 1 in memory, as it is usually not sparse even if H H H is. Instead, as it only needs to calculate matrix-vector products of the form A − 1 b = x A^{-1}\mathbf{b}=\mathbf{x} A − 1 b = x , it solves the equivalent system of equations A x = b A\mathbf{x}=\mathbf{b} A x = b . This can be solved efficiently with a sparse version of LU factorization.
In kdotpy, the default eigensolver is the function eigsh() from the SciPy module scipy.sparse.linalg. In essence, this SciPy function is just an interface to the ARPACK implementation. For the shift-and-invert step, it uses the SuperLU library. The function eigsh() is applied to the Hamiltonian matrix in CSC sparse format. The number of eigenvalues n e i g n_{\mathrm{eig}} n eig is set by the command line using argument neig. The eigsh() argument sigma is set to the target energy, given by targetenergy on the command line.
The diagonalization step is usually the computationally heaviest part of kdotpy calculations, and as such the overall performance of the program strongly depends on this step. In order to maximize performance, kdotpy applies parallelization to reduce calculation time by making use of all available CPU resources. In addition, custom eigensolvers can increase performance by providing optimized methods for the available hardware, for example using the Intel MKL framework for optimization on supported CPUs or using CUDA for GPU acceleration; see Appendix § 11 .§ 7 for a detailed discussion.
Parallelization of the main loop
In kdotpy, calculation of the eigenvalues at each value of momentum k k k and/or magnetic field B B B constitutes a separate eigenvalue problem, and can be treated as an independent task. For each type of Hamiltonian (1D, 2D, LL, etc.), the diagonalization module provides a diagonalization function that performs the following steps for a single value of k k k and/or B B B :
Construct the Hamiltonian;
Diagonalize the Hamiltonian (apply eigensolver);
Process the eigenstates (e.g., calculate observables and Berry curvature).
This function returns a single DiagDataPoint instance. For a dispersion, the complete process of finding a band structure can be summarized as
datapoints = [diag_function(k, *args, **kwds) for k in kvalues]
data = DiagData(datapoints, grid=kvalues)
where kvalues is the VectorGrid instance containing the k k k values. The iterative application of diag_function is very suitable for parallelization, because each call to diag_function requires a similar amount of resources.
Unfortunately, parallelization in Python is challenging as a result of the global interpreter lock (GIL). However, Python’s multiprocessing module avoids this obstacle by running Python code in parallel subprocesses, each of which is affected only by its own GIL.
The basic form of parallelization in kdotpy is facilitated by the parallel_apply() function in the parallel submodule, that is based on the Pool.apply_async() method of Python’s multiprocessing module. The iteration in the example above is replaced by
datapoints = parallel_apply(
diag_function, kvalues, args, kwds, num_processes=num_cpus
)
data = DiagData(datapoints, grid=grid)
where num_cpus is the number of CPU cores in the system, or a custom value set by the command line argument cpu. The function parallel_apply() also implements a custom signal handler for proper handling of keyboard interrupts (Ctrl-C by the user) and terminate and abort signals. For details, refer to Appendix § 10 .1.
The parallel_apply() method is adequate for the default eigsh solver from SciPy, where the three steps of each diagonalization task run on the same CPU. This approach is no longer adequate when a GPU-accelerated eigensolver is used: While the application of the eigensolver is done by the GPU, the other steps are CPU bound. The need for additional flexibility has motivated us to implement a parallelization framework with a higher level of abstraction. This Task-Model framework is built around the ModelX, Task, and TaskManager classes. Each ModelX class (where X can be 1D, 2D, LL, etc.) implements the recipe analogous to the diagonalization function. It defines the steps as separate functions so that they can be run as separate tasks. The Task class is a wrapper around each such task. The TaskManager initializes, manages, and closes the process and/or thread pools, and thus plays a similar role as parallel_apply(). Like the parallelization framework with parallel_apply(), the Task-Model framework is built around the Pool.apply_async() method of Python’s multiprocessing module. The benefit of using the Task-Model framework is the higher degree of flexibility and configurability. We discuss the implementation details in Appendix § 10 .1.
Post-diagonalization
The eigenvectors obtained from the diagonalization have as many components as the size of the Hamiltonian matrix, and thus they require a substantial space to store them into memory or on disk. The default approach of kdotpy is to extract information from the eigenvectors immediately after each point is diagonalized, and to discard the eigenvectors themselves upon creating a DiagDataPoint instance, i.e., usually the attribute DiagDataPoint.eivec remains None.
Observables
The DiagDataPoint class has a separate attribute DiagDataPoint.obsvals which stores a two-dimensional array with the observable values for each eigenstate in the DiagDataPoint instance. The attribute DiagDataPoint._obsids contains the labels for the observables stored in DiagDataPoint.obsvals. The DiagDataPoint class also defines several functions for getting the values for one or more observables for all eigenstates in the instance.
The observables are defined in observables.py. Each one is an instance of the Observable class. The key attributes in this object are
obsid: The observable label.
obsfun: A function that calculates the values from the eigenvectors.
obsfun_type: Determines the argument pattern passed to this function.
Further properties determine the textual representation of the observable, its unit, as well as the colour map used in plots.
Each observable has two variants, namely a dimensionless and a dimensionful one. For example, the expectation value along the growth axis ⟨ z ⟩ \langle z \rangle ⟨ z ⟩ is a dimensionful value, while its dimensionless partner is ⟨ z ⟩ / d \langle z \rangle/d ⟨ z ⟩ / d where d d d is the total thickness of the layer stack. The obsfun function typically calculated the dimensionless variant. The Observable instance also contains attributes for the conversion between the two, and both the dimensionless and dimensionful variants have their own textual representations for quantity and unit.
The source file observables.py also defines an ObservablesList class with all_observables as its single instance. This instance contains all the Observable objects with the observable definitions. The output functions import all_observables in order to access the relevant properties. An overview of all observables defined in observables.py can be found in Appendix § 11 .§ 8 .
All observable values saved in DiagDataPoint.obsvals are written to the output files. If the command line argument obs obsid is provided, then that observable is used to generate extra output files, e.g., csv files with just the values of that observable as a function of momentum, and to colourize the curves in a dispersion or magnetic-field dependence plot. The appropriate colour scale is determined by the definitions in the appropriate Observable. Depending on the type of observable, a discrete or continuous set of colours is used. It is also possible to combine observables into a dual colour scale or an red-green-blue (RGB) colour map. In particular, obs orbitalrgb visualizes the orbital content of the states by using colours where the red, green, and blue channels (r , g , b r,g,b r , g , b ) with normalized values on the interval [ 0 , 1 ] [0,1] [ 0 , 1 ] represent the gamma6, gamma81, and gamma8h observables, respectively; the gamma7 observable is implicitly represented as the ‘blackness’ 1 − r − g − b 1-r-g-b 1 − r − g − b of the colour. Figure 2 illustrates the legend of figures with obs orbitalrgb with a few example colours.
Figure 2. The legend of figures with obs orbitalrgb as command-line input. The red, green, and blue colour channels (r , g , b r,g,b r , g , b ) indicate the expectation values of the gamma6, gamma8l, and gamma8h observables, respectively. For example, blue (a) represents a pure heavy-hole state and dark yellow (b) an equal mixture of ∣ Γ 6 , ± 1 2 ⟩ |\Gamma_{6},\pm\frac{1}{2}\rangle ∣ Γ 6 , ± 2 1 ⟩ and ∣ Γ 8 , ± 1 2 ⟩ |\Gamma_{8},\pm\frac{1}{2}\rangle ∣ Γ 8 , ± 2 1 ⟩ states. The blackness value k = 1 − r − g − b k=1-r-g-b k = 1 − r − g − b is implied, and represents the gamma7 observable. We show examples with k = 10 % k=10\% k = 10% (c) and pure black k = 100 % k=100\% k = 100% (d), where the latter represents a pure ∣ Γ 7 , ± 1 2 ⟩ |\Gamma_{7},\pm\frac{1}{2}\rangle ∣ Γ 7 , ± 2 1 ⟩ state.
Overlaps
The overlap between eigenvectors at different momenta or magnetic-field values is often useful to identify states in complicated dispersions or Landau fans.
For dispersions in the two-dimensional geometry (kdotpy 2d), the eigenvectors ∣ ψ i ( 0 ) ⟩ |\psi_i(0)\rangle ∣ ψ i ( 0 )⟩ of the subbands at k = 0 \mathbf{k}=0 k = 0 are stored when the extra command line argument overlaps is provided. Then, for each momentum k \mathbf{k} k , kdotpy calculates the subband overlaps ∣ ⟨ ψ i ( 0 ) ∣ ψ j ( k ) ⟩ ∣ 2 |\langle\psi_i(0)|\psi_j(\mathbf{k})\rangle|^2 ∣ ⟨ ψ i ( 0 ) ∣ ψ j ( k )⟩ ∣ 2 for all eigenstates ∣ ψ j ( k ) ⟩ |\psi_j(\mathbf{k})\rangle ∣ ψ j ( k )⟩ . This quantity can be interpreted as the expectation values of the projection operator
O ( i ) = ∣ ψ i ( 0 ) ⟩ ⟨ ψ i ( 0 ) ∣ (94) O^{(i)}=|\psi_i(0)\rangle\langle\psi_i(0)| \tag*{(94)} O ( i ) = ∣ ψ i ( 0 )⟩ ⟨ ψ i ( 0 ) ∣ (94)
on the eigenstates ∣ ψ j ( k ) ⟩ |\psi_j(\mathbf{k})\rangle ∣ ψ j ( k )⟩ . The same also works for Landau level calculations (kdotpy ll), where the overlaps are calculated with the subbands i i i at zero magnetic field.
The values of the subband overlaps are stored in DiagDataPoint.obsvals like any other observable and thus also written to the output files. If one provides obs subbandrgb on the command line, the plot colour of the dispersions is defined as the RGB triplet
( r , g , b ) = ( ⟨ O E 1 + ⟩ + ⟨ O E 1 − ⟩ , ⟨ O H 1 + ⟩ + ⟨ O H 1 − ⟩ , ⟨ O H 2 + ⟩ + ⟨ O H 2 − ⟩ ) , (95) (r,g,b)=(\langle O^{E1+}\rangle+\langle O^{E1-}\rangle,\langle O^{H1+}\rangle+\langle O^{H1-}\rangle,\langle O^{H2+}\rangle+\langle O^{H2-}\rangle), \tag*{(95)} ( r , g , b ) = (⟨ O E 1 + ⟩ + ⟨ O E 1 − ⟩ , ⟨ O H 1 + ⟩ + ⟨ O H 1 − ⟩ , ⟨ O H 2 + ⟩ + ⟨ O H 2 − ⟩) , (95)
where the red, green, and blue channels are normalized values on the interval [ 0 , 1 ] [0,1] [ 0 , 1 ] . Likewise, obs subbande1h1l1 does the same with the H2± subbands replaced by L1±. A larger number of subband labels may also been given, e.g., obs subbande1h1h2l1, where each label refers to a pair of subbands with opposite spin states, like ⟨ O E 1 + ⟩ + ⟨ O E 1 − ⟩ \langle O^{E1+}\rangle+\langle O^{E1-}\rangle ⟨ O E 1 + ⟩ + ⟨ O E 1 − ⟩ . For four labels, the colours are mixed from red, yellow, green, and blue. For n l > 4 n_l>4 n l > 4 labels, the colours are mixed from n l n_l n l equidistant hues (maximally saturated colours).
In Landau level mode, the command line argument lloverlaps can be used in order to calculate the probability density ⟨ n ∣ ψ ⟩ \langle n|\psi\rangle ⟨ n ∣ ψ ⟩ in the Landau levels n = − 2 , − 1 , 0 , … , n max n=-2,-1,0,\ldots,n_{\max} n = − 2 , − 1 , 0 , … , n m a x . These quantities can also be viewed as expectation values of the projection operators ∣ n ⟩ ⟨ n ∣ |n\rangle\langle n| ∣ n ⟩ ⟨ n ∣ . This option is available in the full LL mode only; in the symbolic LL mode, the index n n n is a conserved quantum number, so that the expectation value is always 1 for one index and 0 for all others.
Berry curvature, Chern numbers, Hall conductance
The calculation of the Berry curvature in dispersion mode is based on Eq. (75) (see § 2.8.1 ), with the slight modification that the summation over ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ includes all eigenstates within the energy window that has been calculated, which may be a subset of the full spectrum. Due to the denominator in Eq. (75) , states ∣ ψ ′ ⟩ |\psi'\rangle ∣ ψ ′ ⟩ that are far in energy from ∣ ψ ⟩ |\psi\rangle ∣ ψ ⟩ only contribute weakly to the Berry curvature. Nevertheless, one should be aware that the omission of remote states can lead to deviations of the calculated Chern numbers from integer values.
The implementation in berry.py involves numerical evaluation of the derivatives ∂ k x H \partial_{k_x}H ∂ k x H and ∂ k y H \partial_{k_y}H ∂ k y H of the Hamiltonian. These are used to evaluate the matrices V i V_i V i (i = x , y , z i=x,y,z i = x , y , z ) with
( V i ) p q = ⟨ ψ p ∣ ∂ k i H ∣ ψ q ⟩ E p − E q (96) (V_i)_{pq}=\frac{\langle\psi_p|\partial_{k_i}H|\psi_q\rangle}{E_p-E_q} \tag*{(96)} ( V i ) pq = E p − E q ⟨ ψ p ∣ ∂ k i H ∣ ψ q ⟩ (96)
if p ≠ q p \ne q p = q and V p p = 0 V_{pp}=0 V pp = 0 . Here, p p p and q q q label the eigenstates and they run over all eigenstates obtained from the diagonalization. In terms of V i V_i V i , Eq. (75) may be evaluated as
Ω i q ( k ) = − Im ∑ p ∑ l , m ϵ i l m ( V l ) q p ∗ ( V m ) p q = − Im ∑ l , m ϵ i l m ( V l † V m ) q q (97) \Omega_i^q(\mathbf{k})=-\operatorname{Im}\sum_p\sum_{l,m}\epsilon_{ilm}(V_l)^*_{qp}(V_m)_{pq}=-\operatorname{Im}\sum_{l,m}\epsilon_{ilm}(V_l^\dagger V_m)_{qq} \tag*{(97)} Ω i q ( k ) = − Im p ∑ l , m ∑ ϵ i l m ( V l ) q p ∗ ( V m ) pq = − Im l , m ∑ ϵ i l m ( V l † V m ) q q (97)
The summation over p p p is a matrix multiplication that can be evaluated efficiently with NumPy functions. Because we only need the diagonal elements of V l † V m V_l^\dagger V_m V l † V m , we extract the relevant columns and rows from V l † V_l^\dagger V l † and V m V_m V m and evaluate vector-vector dot products as
bcurv = [
-np.imag(np.dot(vxd[q, :], vy[:, q]) - np.dot(vyd[q, :], vx[:, q]))
for q in range(0, neig1)
]
for evaluating Ω i q ( k ) \Omega_i^q(\mathbf{k}) Ω i q ( k ) for all eigenstates q q q . In view of efficiency, we can choose to restrict the set of eigenstates q q q for which we evaluate the Berry curvature. It is important to note that the set of eigenstates p p p in the summation (or vector-vector product) must be a large as possible as to not lose significant contributions from remote eigenstates.
In two-dimensional dispersion mode (kdotpy 2d), only Ω q ( k ) \Omega^q(\mathbf{k}) Ω q ( k ) is evaluated, as the Berry curvature is essentially scalar in two dimensions. The Berry curvature observable may be accessed with the argument obs berry or obs berryz (equivalent). For three dimensions (kdotpy bulk), the Berry curvature is a vector quantity Ω i q ( k ) \Omega_i^q(\mathbf{k}) Ω i q ( k ) with i = x , y , z i=x,y,z i = x , y , z . The relevant observable labels are berryx, berryy, and berryz.
For Landau levels, Berry curvature Ω q \Omega^q Ω q is calculated in the same manner as for dispersions, with the exception of how the Hamiltonian is treated: In the symbolic and full LL modes, the derivatives ∂ k i H \partial_{k_i}H ∂ k i H of the Hamiltonian are calculated symbolically. The remaining factors k x k_x k x and k y k_y k y are substituted by the appropriate ladder operators a a a and a † a^\dagger a † before ∂ k i H \partial_{k_i}H ∂ k i H is inserted into into Eq. (96) .
The Chern number C q C^q C q of each eigenstate q q q is obtained by multiplying the Berry curvature by the Landau level degeneracy,
C q = e B z ℏ Ω q (98) C^q=\frac{eB_z}{\hbar}\Omega^q \tag*{(98)} C q = ℏ e B z Ω q (98)
in terms of the perpendicular magnetic field B z B_z B z , cf. § 2.8.2 . The degeneracy factor is related to the magnetic length l B l_B l B as e B z / ℏ = 1 / l B 2 eB_z/\hbar=1/l_B^2 e B z /ℏ = 1/ l B 2 . The Chern number from Eq. (98) is stored as observable labelled chern. These values can be used to find the Hall conductance σ H \sigma_H σ H by summing over all occupied states, see Eq. (76) .
Due to the spectrum being incomplete, the Chern numbers calculated with Eq. (98) may deviate from integer values. In addition to observable chern, kdotpy also provides the observable chernsim which ‘simulates’ exactly integer Chern numbers. The value is simply 1 for all states if B z ≠ 0 B_z \ne0 B z = 0 and 0 if B z = 0 B_z=0 B z = 0 . We note that this simple assumption violates the property that the sum of all Chern numbers must vanish, hence the resulting Hall conductance [from Eq. (76) ] is valid only in the part of the spectrum close to the charge neutrality point.
Band alignment
Motivation
For all calculation modes except for the bulk mode, kdotpy uses sparse diagonalization which yields only a subset of all eigenvalues and eigenvectors. Thus, it is not possible to label the eigenvectors from 1 to N (the matrix size) from smallest to largest eigenvalue. Given two sets of eigenvalues at two points in momentum space, it is not known a priori how to connect the eigenvalues to form a (sub)band.
The band alignment algorithm connects the dots : Considering two adjacent points in momentum space (or in magnetic-field value), assign a ‘band index’ to each eigenvalue. States with identical band indices across momentum point are considered to be one connected band. This band index is used by many other functions of kdotpy, for example, plot and CSV output, calculation of density of states, dispersion derivatives, etc.
Figure 3. Illustration of the problem that is solved by the band alignment algorithm.
Band indices definition
Before we look at the actual recipe, let us discuss in detail the properties and the role of the band indices. They satisfy the following basic properties:
The band indices are always monotonic in the energy (eigenvalues). As a consequence, dispersions never cross (e.g., in the output plots). Whereas this is not always the most natural choice from the perspective of the eigenstates, the assumption of monotonicity greatly simplifies the band alignment algorithm. The advantage of this method is that it does not need the eigenvectors, so that the RAM usage can remain limited. Earlier attempts with use of the eigenvectors have proved to be much less reliable than the present implementation.
Additionally, kdotpy tries to determine the charge neutrality point from the band characters at zero momentum and zero magnetic-field. At this point, states above this energy get positive band indices (1 , 2 , 3 , … 1, 2, 3, \ldots 1 , 2 , 3 , … ) and those below get negative indices (− 1 , − 2 , − 3 , … -1, -2, -3, \ldots − 1 , − 2 , − 3 , … ). The index 0 0 0 is never assigned. Thus, the sign of the band index is used to determine ‘electron-like’ or ‘hole-like’ states. (Here, the notions ‘electron’ and ‘hole’ are defined with respect to the band energy with respect to charge neutrality.)
For Landau-level calculations in the axial approximation, the band indices are calculated for each Landau level index separately. In this mode, states are labelled by a pair of indices (LL index, band index). This is not true for full LL mode, where kdotpy uses a single band index similar to dispersion mode.
The band indices are quite essential for many functions to do their job. For example, in order to calculate the derivative of the dispersion, one needs two points of the same band at different points in momentum space, as to be able to calculate the differential quotient. For the integrated density of states (IDOS), the assignment of positive and negative band indices determines at which energy the IDOS = 0 = 0 = 0 . It also increases the accuracy of the (integrated) DOS, because it is based on interpolation of the dispersion between the available data points.
Band alignment algorithm
The band alignment algorithm is given by the following ‘recipe’.
Calculate band characters at zero (k = 0 \mathbf{k} = 0 k = 0 and B = 0 \mathbf{B} = 0 B = 0 ). Determine the charge neutrality point and assign positive band indices above, and negative band indices below this value.
Take a data point adjacent to zero. Align the two sets of eigenvalues (see below). States aligned with each other get the same band index, i.e., the band indices for the ‘new’ data point get them from the data point at zero.
For all band indices that the two points have in common, extrapolate the energies to the next momentum or magnetic field value. That is, given the energies { E i ( 0 ) } \{E_i^{(0)}\} { E i ( 0 ) } and { E i ′ ( 1 ) } \{E_{i'}^{(1)}\} { E i ′ ( 1 ) } , calculate
E ^ j ( 2 ) = E j ( 0 ) + k 2 − k 0 k 1 − k 0 ( E j ( 1 ) − E j ( 0 ) ) (99) \hat{E}_{j}^{(2)} = E_{j}^{(0)} + \frac{k_{2} - k_{0}}{k_{1} - k_{0}}\left(E_{j}^{(1)} - E_{j}^{(0)}\right) \tag*{(99)} E ^ j ( 2 ) = E j ( 0 ) + k 1 − k 0 k 2 − k 0 ( E j ( 1 ) − E j ( 0 ) ) (99)
Figure 4. Band alignment recipe. 1. Determine band characters and assign band indices at zero momentum. 2. Align energies at adjacent point. 3–4. Extrapolate and align at third point. 5. Repeat previous steps forwards till the end of the domain. 6. Repeat previous steps backwards till the other end of the domain.
for all j j j for which E j ( 0 ) E_j^{(0)} E j ( 0 ) and E j ( 1 ) E_j^{(1)} E j ( 1 ) are both defined.
Align the actual eigenvalues at the new data point to the extrapolated values E ~ j ( 2 ) \widetilde{E}_j^{(2)} E j ( 2 ) . Thus, set the band indices for the new data point from the extrapolated energies.
Repeat steps 3. and 4. until one reaches the end of the calculated domain.
Repeat steps 2. for the data point on the other side of the zero point. Perform steps 3. through 5. towards the other end of the domain.
This algorithm is essentially one-dimensional. For two dimensional grids, first perform the algorithm along the k x k_x k x axis, then in the perpendicular direction starting at ( k x , 0 ) (k_x, 0) ( k x , 0 ) , in a ‘fish bone’ pattern. Analogously, in polar coordinates, the algorithm is performed along the radial direction first, then in the angular direction.
The alignment of two sets of energies as described above, is essentially a minimization of the energy differences. Assume two ordered sets of energies { E i ( 1 ) } \{E_i^{(1)}\} { E i ( 1 ) } and { E j ( 2 ) } \{E_j^{(2)}\} { E j ( 2 ) } (i.e., the energies are monotonic). Then vary the two indices relative to each other and find the minimum average energy difference . We also add a ‘penalty’ for non-matching energies, i.e., values in one set that do not have a partner in the other set.
Formalizing this idea, we find the value d d d for which
Δ ( d ) = ( ∑ i ∣ E i ( 1 ) − E i + d ( 2 ) ∣ e ) / n ( d ) + W / n ( d ) . (100) \Delta(d)=\left(\sum_i \left|E_i^{(1)}-E_{i+d}^{(2)}\right|^e\right)/n(d)+W/n(d). \tag*{(100)} Δ ( d ) = ( i ∑ E i ( 1 ) − E i + d ( 2 ) e ) / n ( d ) + W / n ( d ) . (100)
is minimal. The sum runs over all i i i for which both values E i ( 1 ) E_i^{(1)} E i ( 1 ) and E i + d ( 2 ) E_{i+d}^{(2)} E i + d ( 2 ) are defined. The value n i ( d ) n_i(d) n i ( d ) is the number of terms in the sum. The coefficient e e e is an exponent and W W W is the ‘bonus weight’ for each term in the sum. These values are set by the configuration settings band_align_exp (default is 4) and band_align_ndelta_weight (default is 20). (Setting band_align_exp=max replaces the sum by max i ∣ E i ( 1 ) − E i + d ( 2 ) ∣ e \max_i|E_i^{(1)}-E_{i+d}^{(2)}|^e max i ∣ E i ( 1 ) − E i + d ( 2 ) ∣ e .)
Given the value d d d for which Δ ( d ) \Delta(d) Δ ( d ) is minimal, we say that the values E i ( 1 ) E_i^{(1)} E i ( 1 ) and E i + d ( 2 ) E_{i+d}^{(2)} E i + d ( 2 ) are aligned. The result is that they will receive the same band indices.
Note that the algorithm is based on the energies collectively , not individually . This property makes the algorithm quite reliable.
Figure 5. The alignment algorithm. (Left) Given two lists of energy values, we calculate the energy differences Δ E = ∣ E i ( 1 ) − E i ( 2 ) ∣ \Delta E = \lvert E_i^{(1)} - E_i^{(2)} \rvert Δ E = ∣ E i ( 1 ) − E i ( 2 ) ∣ for each pair of values. The second set is shifted uniformly by index relative to the first one, E i ( 2 ) → E i + d ( 2 ) E_i^{(2)} \to E_{i+d}^{(2)} E i ( 2 ) → E i + d ( 2 ) . The sum of energy differences Δ ( d ) \Delta(d) Δ ( d ) [see Eq. (100) ] is calculated for each shift d d d and minimized over d d d .
Manually assisted band alignment
Should the result of the band alignment not be satisfactory (e.g., incorrect), kdotpy merge includes two options to manually ‘guide’ the band alignment to a correct result.
Using the bandalign # [#] command line argument. The first value is an energy and the second one a gap index (omitted value means 0). This pins the gap with that index to the given energy at zero momentum or magnetic field. For example, if one uses bandalign -10 2, then the first eigenstate below −10 meV gets the band index 2, the first one above band index 3. The given energy need not be very precise; it must just lie in between two bands. For convenience, one could choose a large gap.
NOTE: The gap with index 0 lies between the bands with indices −1 and 1. The gap with index g > 0 g > 0 g > 0 between bands g g g and g + 1 g + 1 g + 1 , the gap with index g < 0 g < 0 g < 0 between bands g − 1 g - 1 g − 1 and g g g . Zero gaps (i.e., between degenerate states) also count.
This option replaces step 1. in the above recipe only. The algorithm then uses the same alignment strategy as described in steps 2. through 6.
Using an input file in CSV format with band indices and energies as function of momentum or magnetic field. The file format is the same as the output files dispersion.byband.csv. This output file is essentially the result of the band alignment, i.e., the assignment of band indices to energies. This file may be edited in a spreadsheet editor by moving around values using cut-and-paste, for example. Then it can be saved as a CSV file and loaded into kdotpy by using the command-line option reconnect filename.csv.
The input file may be incomplete: Missing energy values at the left- or right-hand side of each line (not in the middle) will be filled in automatically, by extrapolation of band indices. Momentum (or magnetic field) values for which there is no data are filled in by interpolation or extrapolation from adjacent points, i.e., steps 3. and 4. of the above recipe. The energies only need to be approximately exact. This tolerant behaviour of the input is made possible by the implementation: The file input is processed by aligning the given energies to the actual eigenvalues. The band alignment algorithm does not need the energies to be exact or complete in order to be reliable.
In this manner, it is also possible to get some hybrid result between manual input and the automatic algorithm.
Figure 6. Manually assisted band alignment. Example of the manual input of band indices in a CSV file, as displayed in a spreadsheet editor.
Challenges
The band alignment algorithm is quite reliable, but there are scenarios that commonly lead to incorrect results, for example:
The alignment algorithm may misalign states if the two sets consist of almost equidistant subbands. Such patterns typically occur in both the conduction and the valence band individually. In order to avoid this condition, choose the diagonalization parameters such that at least the highest valence subband and the lowest conduction subband are included at every point in momentum space. The alignment algorithm is then stabilized by the large gap.
The sets of eigenvalues must be connected and complete, i.e., between the lowest and highest eigenvalues, there must be no missing ones. For a single calculation, this is always true, but if one uses kdotpy merge for merging multiple data sets at the same momentum values, make sure that no eigenstates are missing. If the two sets overlap (share at least one eigenvalue, preferably more), then one is on the safe side.
The band alignment algorithm does not admit real crossings. Even when real crossings are expected in the spectrum, e.g., between states that have different values of a conserved quantum number, they are rendered as anticrossings. This also affects derived quantities: For example, density of states may be inaccurate around the absent crossing points. This can partially be mitigated by increasing the momentum or magnetic-field resolution.
Density of states
Motivation
The density of states plays an essential role in many physical quantities observed in experiment. The position of the Fermi level determines whether the material behaves as an insulator or conductor in transport physics. In spectroscopy, the occupation of each state determines which optical transitions are visible. The total carrier density is often known from experiments, is used to determine the Fermi energy. The tuning of the Fermi level with one or more gate electrodes is understood most straightforwardly in terms of carrier density, as the latter typically depends linearly on the gate voltage.
The density functions of kdotpy calculate the relation between carrier density n n n and energy E E E , and places the Fermi level at the correct position if the carrier density is provided with the command line argument cardens. The relation also allows kdotpy to convert k- or B-dependence plots by putting density n n n on the vertical axis instead of energy E E E . This is particularly useful in the Landau-level mode, where Landau fans with n n n on the vertical axis may be compared directly with Landau fan plots from magnetotransport experiments.
Integrated density of states (IDOS)
The key quantity in the density calculations in kdotpy is the integrated density of states (IDOS; equivalent to carrier density), defined as the number of occupied states lying between the charge neutrality point and the Fermi level. The counting of occupied states is based on the principle that each ‘mode’ (given by its momentum) contributes equally. An isolated, fully occupied band would correspond to one state in a volume of a d a^d a d , assuming a (hyper)cubic lattice in d d d dimensions with lattice constant a a a . In momentum space, this state occupies the full Brillouin zone with a volume of ( 2 π / a ) d (2\pi/a)^d ( 2 π / a ) d . A partially occupied band, which occupies a volume of V o c c V_{\mathrm{occ}} V occ in momentum space, thus corresponds to a density of V o c c / ( 2 π ) d V_{\mathrm{occ}}/(2\pi)^d V occ / ( 2 π ) d .
In order to calculate the IDOS, we thus need to calculate the occupied volume in momentum space for all bands and sum over them. In order to get density n ( E ) n(E) n ( E ) as function of energy, we choose a discrete array of energy values, which we call the ‘energy range’. We sketch the algorithm for the IDOS calculation of a dispersion in d = 1 d=1 d = 1 dimension. For each band b b b :
Extract e i = E ( b ) ( k i ) e_i=E^{(b)}(k_i) e i = E ( b ) ( k i ) , the energy dispersion of the band with band index b b b from DiagData. The index i = 1 , … , n k i=1,\ldots,n_k i = 1 , … , n k runs over n k n_k n k data points.
Let E E E be the Fermi energy. Do a piecewise linear interpolation e ( k ) e(k) e ( k ) of the e i e_i e i , i.e., drawing straight lines between ( k i , e i ) (k_i,e_i) ( k i , e i ) and ( k i + 1 , e i + 1 ) (k_{i+1},e_{i+1}) ( k i + 1 , e i + 1 ) . For all intervals ( k i , k i + 1 ) (k_i,k_{i+1}) ( k i , k i + 1 ) , determine the fraction of the interval where e ( k ) ≤ E e(k)\leq E e ( k ) ≤ E . This is given by
f i ( E ) = { 1 if e i < e i + 1 ≤ E E − e i e i + 1 − e i if e i ≤ E < e i + 1 0 if E < e i < e i + 1 (101) f_i(E)=
\begin{cases}
1 & \text{if } e_i<e_{i+1}\leq E\\
\frac{E-e_i}{e_{i+1}-e_i} & \text{if } e_i\leq E<e_{i+1}\\
0 & \text{if } E<e_i<e_{i+1}
\end{cases} \tag*{(101)} f i ( E ) = ⎩ ⎨ ⎧ 1 e i + 1 − e i E − e i 0 if e i < e i + 1 ≤ E if e i ≤ E < e i + 1 if E < e i < e i + 1 (101)
where we have assumed (without loss of generality) that e i < e i + 1 e_i<e_{i+1} e i < e i + 1 . See Figure 7 for an illustration. This step is done by linear_idos_element(), which does this for all energies E E E in the energy range simultaneously, by clever use of NumPy arrays.
Figure 7. Calculation of the integrated density of states (IDOS) for a single band. The band energies at momenta k i k_i k i are extracted from DiagData as the values e i e_i e i . Interpolate linearly to find a continuous function e ( k ) e(k) e ( k ) . For each interval ( i , i + 1 ) (i,i+1) ( i , i + 1 ) , find the fraction f i ( E ) f_i(E) f i ( E ) of the interval for which e ( k ) < E e(k)<E e ( k ) < E . Iterate this procedure over many values of E E E . For holes, subtract 1 from each f i f_i f i ; in this example, this would yield f i − 1 = ( 0 , − 1 4 , − 1 ) f_i-1=(0,-\frac{1}{4},-1) f i − 1 = ( 0 , − 4 1 , − 1 ) .
If the band is hole-like (band index b < 0 b<0 b < 0 ), subtract 1 from all f i f_i f i . Thus, the volume below the Fermi energy is counted as 0 and the volume above it as − 1 -1 − 1 . In this way, hole-like densities are automatically counted as being negative.
Integrate over momentum. For all intervals ( k i , k i + 1 ) (k_i,k_{i+1}) ( k i , k i + 1 ) , calculate the integration volume element d k i d k_i d k i . In one dimension, the volume element would be d k i = k i + 1 − k i d k_i=k_{i+1}-k_i d k i = k i + 1 − k i in cartesian coordinates and d k i = π ( k i + 1 2 − k i 2 ) d k_i=\pi(k_{i+1}^2-k_i^2) d k i = π ( k i + 1 2 − k i 2 ) if k k k is a radial coordinate in polar coordinates. The IDOS contribution for band b b b is thus
n ( b ) ( E ) = 1 ( 2 π ) d ∑ i = 1 n k − 1 f i ( E ) d k i , (102) n^{(b)}(E)=\frac{1}{(2\pi)^d}\sum_{i=1}^{n_k-1}f_i(E)d k_i, \tag*{(102)} n ( b ) ( E ) = ( 2 π ) d 1 i = 1 ∑ n k − 1 f i ( E ) d k i , (102)
where we note that the f i ( E ) f_i(E) f i ( E ) are still functions of the Fermi energy E E E , implemented as one-dimensional NumPy array. The result is thus also a function of E E E .
To find the total density as function of E E E , we sum over all bands. If desired, the sum may also be restricted to either electron-like or hole-like bands.
The function loc_int_dos_by_band() in density/base.py takes care of obtaining the f i f_i f i , where Eq. (101) is implemented in density/elements.py. The integration over momentum is done by int_dos_by_band() in density/base.py. The result is a one-dimensional array, where the elements encode the IDOS values n ( E i ) n(E_i) n ( E i ) , where E i E_i E i are the values in the energy range. The summation over bands may also be skipped in order to find the contributions by band; this result is represented by a dict instance where the keys are the band labels b b b and the values are the one-dimensional arrays n ( b ) ( E i ) n^{(b)}(E_i) n ( b ) ( E i ) .
For higher dimensions, an additional intermediate step is required. In order to calculate f i f_i f i in two or three dimensions, we need to divide the space into triangular or tetrahedral simplices. In two dimensions, for an elementary square [ k x , i , k x , i + 1 ] × [ k y , j , k y , j + 1 ] [k_{x,i}, k_{x,i+1}] \times[k_{y,j}, k_{y,j+1}] [ k x , i , k x , i + 1 ] × [ k y , j , k y , j + 1 ] , take the centre point k 5 , i , j = ( 1 2 ( k x , i + k x , i + 1 ) , 1 2 ( k y , j + k y , j + 1 ) ) k_{5,i,j} = (\frac{1}{2}(k_{x,i}+k_{x,i+1}), \frac{1}{2}(k_{y,j}+k_{y,j+1})) k 5 , i , j = ( 2 1 ( k x , i + k x , i + 1 ) , 2 1 ( k y , j + k y , j + 1 )) and divide the plaquette into four triangles with k 5 , i , j k_{5,i,j} k 5 , i , j as one of its vertices, see Figure 8 (a). The band energy at k 5 , i , j k_{5,i,j} k 5 , i , j is determined by interpolation,
Figure 8. Division of momentum space for two and three dimensions. (a) In two dimensions, the momentum space is triangulated into triangular simplices. To this end, a fifth point is inserted in each elementary square (red) by setting e 5 , i , j e_{5,i,j} e 5 , i , j as the average over the four corner points. The four simplices for each square are 125, 135, 245, and 345. (b) In three dimensions, the space is divided into tetrahedral simplices. A ninth point is inserted in the centre of each elementary cube, by setting e 9 , i , j , l e_{9,i,j,l} e 9 , i , j , l as the average over the eight corner points. The illustrated division is the set of twelve tetrahedra 1239, 2349, 1259, 2569, 2489, 2689, 1359, 3579, 5689, 5789, 3489, and 3789. Another choice can be obtained by spatial inversion.
e 5 , i , j = 1 4 ( E ( b ) ( k x , i , k y , j ) + E ( b ) ( k x , i + 1 , k y , j ) + E ( b ) ( k x , i , k y , j + 1 ) + E ( b ) ( k x , i + 1 , k y , j + 1 ) ) . (103) e_{5,i,j} = \frac{1}{4}\left(E^{(b)}(k_{x,i},k_{y,j}) + E^{(b)}(k_{x,i+1},k_{y,j}) + E^{(b)}(k_{x,i},k_{y,j+1}) + E^{(b)}(k_{x,i+1},k_{y,j+1})\right). \tag*{(103)} e 5 , i , j = 4 1 ( E ( b ) ( k x , i , k y , j ) + E ( b ) ( k x , i + 1 , k y , j ) + E ( b ) ( k x , i , k y , j + 1 ) + E ( b ) ( k x , i + 1 , k y , j + 1 ) ) . (103)
Labelling each simplex shape as t = 1 , 2 , 3 , 4 t = 1, 2, 3, 4 t = 1 , 2 , 3 , 4 (corresponding to the four colours in Figure 8 (a)), we find all f t , i , j ( E ) f_{t,i,j}(E) f t , i , j ( E ) with a function analogous to Eq. (101) , given as Eq. (A.2) in Appendix § 10 .2 and implemented in triangular_idos_element(). The integral over momentum involves volume elements d k t , i , j dk_{t,i,j} d k t , i , j for all simplices,
n ( b ) ( E ) = 1 ( 2 π ) d ∑ t = 1 4 ∑ i = 1 n k x − 1 ∑ j = 1 n k y − 1 f t , i , j ( E ) d k t , i , j . (104) n^{(b)}(E) = \frac{1}{(2\pi)^d}\sum_{t=1}^{4}\sum_{i=1}^{n_{k_x}-1}\sum_{j=1}^{n_{k_y}-1} f_{t,i,j}(E)dk_{t,i,j}. \tag*{(104)} n ( b ) ( E ) = ( 2 π ) d 1 t = 1 ∑ 4 i = 1 ∑ n k x − 1 j = 1 ∑ n k y − 1 f t , i , j ( E ) d k t , i , j . (104)
For cartesian coordinates, d k t , i , j = 1 4 Δ k x Δ k y dk_{t,i,j} = \frac{1}{4}\Delta k_x\Delta k_y d k t , i , j = 4 1 Δ k x Δ k y . For polar coordinates, we take the approximate expression d k t , i , j = 1 4 k ‾ r Δ k r Δ k ϕ dk_{t,i,j} = \frac{1}{4}\overline{k}_r\Delta k_r\Delta k_\phi d k t , i , j = 4 1 k r Δ k r Δ k ϕ , where k ‾ r \overline{k}_r k r is the average of the radial coordinates of the three vertices of the triangle defined by t , i , j t,i,j t , i , j and Δ k ϕ \Delta k_\phi Δ k ϕ is measured in radians.
For three dimensions, an analogous method is used, with each elementary cube [ k x , i , k x , i + 1 ] × [ k y , j , k y , j + 1 ] × [ k z , l , k z , l + 1 ] [k_{x,i}, k_{x,i+1}] \times[k_{y,j}, k_{y,j+1}] \times[k_{z,l}, k_{z,l+1}] [ k x , i , k x , i + 1 ] × [ k y , j , k y , j + 1 ] × [ k z , l , k z , l + 1 ] being divided into 12 tetrahedra with the body-centred point k 9 , i , j , l = ( 1 2 ( k x , i + k x , i + 1 ) , 1 2 ( k y , j + k y , j + 1 ) , 1 2 ( k z , l + k z , l + 1 ) ) k_{9,i,j,l} = (\frac{1}{2}(k_{x,i}+k_{x,i+1}), \frac{1}{2}(k_{y,j}+k_{y,j+1}), \frac{1}{2}(k_{z,l}+k_{z,l+1})) k 9 , i , j , l = ( 2 1 ( k x , i + k x , i + 1 ) , 2 1 ( k y , j + k y , j + 1 ) , 2 1 ( k z , l + k z , l + 1 )) as one of its vertices, see Figure 8 (b). The energy value e 9 , i , j , l e_{9,i,j,l} e 9 , i , j , l is calculated as the average over all eight vertices of the elementary cube. The method for finding value f t , i , j , l ( E ) f_{t,i,j,l}(E) f t , i , j , l ( E ) with a function analogous to Eq. (101) is given as Eq. (A.3) in Appendix § 10 .2 and is implemented in tetrahedral_idos_element(). The volume elements are d k t , i , j , l = 1 12 Δ k x Δ k y Δ k z d k_{t,i,j,l} = \frac{1}{12}\Delta k_x\Delta k_y\Delta k_z d k t , i , j , l = 12 1 Δ k x Δ k y Δ k z for cartesian coordinates, d k t , i , j , l = 1 12 k r Δ k r Δ k ϕ Δ k z d k_{t,i,j,l} = \frac{1}{12}k_r\Delta k_r\Delta k_\phi\Delta k_z d k t , i , j , l = 12 1 k r Δ k r Δ k ϕ Δ k z for cylindrical coordinates, and d k t , i , j , l = 1 12 k r 2 sin k θ Δ k r Δ k θ Δ k ϕ d k_{t,i,j,l} = \frac{1}{12}k_r^2\sin k_\theta\ \Delta k_r\Delta k_\theta\Delta k_\phi d k t , i , j , l = 12 1 k r 2 sin k θ Δ k r Δ k θ Δ k ϕ for spherical coordinates, where the overlines denote averages over all four vertices of each tetrahedron.
Density in Landau level mode
In Landau level mode, the calculation of IDOS is much simpler due to the absence of the momentum coordinates. For each magnetic field value B = B z B = B_z B = B z , apply the following recipe.
For each band labelled b b b (full LL mode) or ( n , b ) (n,b) ( n , b ) (symbolic LL mode), extract the energy values E ( b ) ( B ) E^{(b)}(B) E ( b ) ( B ) from DiagData.
Determine the charge neutrality point E C N P ( B ) E_{\mathrm{CNP}}(B) E CNP ( B ) . For full LL mode, this is simply the centre of the gap between bands − 1 -1 − 1 and 1 1 1 . For symbolic LL mode, the band labels ( n , b ) (n,b) ( n , b ) are first converted to a single universal band index u u u ; E C N P ( B ) E_{\mathrm{CNP}}(B) E CNP ( B ) then lies between the states with u = − 1 u=-1 u = − 1 and u = 1 u=1 u = 1 . (Details on the universal band index in Appendix § 10 .§ 3 .)
This algorithm is applied for each magnetic field value independently, and yields a function of energy E E E (represented by an array) for each B B B . The result can be interpreted as ‘local’ integrated density of states. The function that takes care of this calculation is loc_int_dos(), with the determination of the charge neutrality points being handled by the member function DiagData.get_e_neutral() of the DiagData class.
Data structure
The IDOS data is stored in an instance of the class DensityData. This class has three important array-like attributes:
The shape of densdata must match those of xval and ee, i.e., the condition
densdata.shape == (*xval.shape, *ee.shape)
must evaluate to True, with xval.shape being replaced by () if xval is None. The class also remembers the dimensionality (as kdim) and whether or not Landau levels are considered (as the boolean value ll).
The class has several member functions for common operations on the integrated density of states. The most important ones are:
get_validity_range(): Estimate the energy range where the IDOS is valid, i.e., in which energy range we can be reasonably sure that no states have been overlooked due to the finite momentum range. This is done by considering the dispersion energies and their derivatives at the edge of the momentum range. For example, if the momentum range is [ k min , k max ] [k_{\min}, k_{\max}] [ k m i n , k m a x ] and the dispersion E ( k ) E(k) E ( k ) approaches E ( k max ) E(k_{\max}) E ( k m a x ) from below (with d E / d k > 0 \mathrm{d}E/\mathrm{d}k > 0 d E / d k > 0 ), then we can infer that there are states at E > E ( k max ) E > E(k_{\max}) E > E ( k m a x ) for k > k max k > k_{\max} k > k m a x , which are not considered for the DOS calculation. Thus, the upper bound of the validity range must be ≤ E ( k max ) \le E(k_{\max}) ≤ E ( k m a x ) . The upper and lower limits of the validity range are determined by iterating this algorithm over all bands. The validity range may be empty or ‘negative’ (when the upper bound lies below the lower bound) in some cases. The result is printed on the terminal and is visualized in the DOS and IDOS plots by shading of the regions outside the validity range.
energy_at_idos(): Get the energy value at a given IDOS n t a r g e t n_{\mathrm{target}} n target (carrier density). This is done by solving E E E from the equation n ( E ) = n t a r g e t n(E) = n_{\mathrm{target}} n ( E ) = n target , where n ( E ) n(E) n ( E ) is a linearly interpolated function from the IDOS data (densdata versus ee) stored in the DensityData instance.
There are several additional attributes and member functions related to special energies , for example the Fermi level at zero density and at the desired density, and the charge neutrality point.
Units and scaling
The internal density units for DensityData.densdata are always n m − d \mathrm{nm}^{-d} nm − d , where d d d is the dimensionality. In order to be able to extract quantities proportional to DOS and IDOS values expressed in a user-preferred set of units, the DensityData.scale may be set. If this attribute is set as an instance of the DensityScale class, functions like DensityData.get_idos() and DensityData.get_dos() automatically return the values in the appropriate units.
The role of the DensityScale class is to store the desired quantity and unit, and to scale the exponent p p p automatically, such that the values can be written as x × 10 p x \times10^p x × 1 0 p with x x x having a ‘convenient’ magnitude. The default quantity is simply the IDOS as defined before. The area or volume in momentum space is related by a factor of ( 2 π ) d (2\pi)^d ( 2 π ) d . Charge density has the same value as IDOS, but with units of e n m − d \mathrm{e}\,\mathrm{nm}^{-d} e nm − d instead of n m − d \mathrm{nm}^{-d} nm − d . For the units, one may choose nm, cm, or m as the units for length. For the extracted IDOS, the values are expressed in units of 10 p n m − d 10^p\ \mathrm{nm}^{-d} 1 0 p nm − d , 10 p c m − d 10^p\ \mathrm{cm}^{-d} 1 0 p cm − d , or 10 p m − d 10^p\ \mathrm{m}^{-d} 1 0 p m − d , with p p p set to a reasonable value for the chosen units. For DOS, the appropriate unit is obtained by multiplying with m e V − 1 \mathrm{meV}^{-1} meV − 1 . The DensityScale class provides the functions DensityScale.qstr() and DensityScale.unitstr() for formatting the quantity and unit as a string for use in output files (text and graphics). For convenience, DensityData provides these member functions as well.
Integrated observables
A special application of the density functions is the notion of integrated observable. In the summation over the bands [similar to Eq. (102) ], we include the value of an observable O O O as an additional factor. The integrated observable is defined by the sum O ( E ) = ∑ b O ( b ) ( E ) O(E) = \sum_b O^{(b)}(E) O ( E ) = ∑ b O ( b ) ( E ) for the contributions from all bands,
O ( b ) ( E ) = 1 ( 2 π ) d ∑ i = 1 n k f i ( E ) O ( b ) ( k i ) d k i , (105) O^{(b)}(E) = \frac{1}{(2\pi)^d} \sum_{i=1}^{n_k} f_i(E) O^{(b)}(k_i)\,\mathrm{d}k_i, \tag*{(105)} O ( b ) ( E ) = ( 2 π ) d 1 i = 1 ∑ n k f i ( E ) O ( b ) ( k i ) d k i , (105)
where k i k_i k i are the momentum values of the grid and O ( b ) ( k i ) O^{(b)}(k_i) O ( b ) ( k i ) is the observable value of band b b b at k i k_i k i . Note that unlike the IDOS calculation, we sum over the momentum values themselves, not the intervals between them. The implementation (function integrated_observable()) returns an IntegratedObservable class derived from the DensityData class.
The integrated observable O ( E ) O(E) O ( E ) as function of energy can be transformed into the corresponding function O ~ ( n ) \tilde{O}(n) O ~ ( n ) as function of density by means of a pushforward transformation over the function defining density N ( E ) N(E) N ( E ) as function of energy. The result is O ~ = O ∘ N − 1 \tilde{O} = O \circ N^{-1} O ~ = O ∘ N − 1 , where ∘ \circ ∘ denotes composition of functions and N − 1 N^{-1} N − 1 is the inverse function of N N N . The function N − 1 N^{-1} N − 1 takes a density value n n n and calculates the corresponding energy E E E . Then, O O O acting on E E E yields O ( E ) O(E) O ( E ) . Thus, one may think of O ~ \tilde{O} O ~ as the function n ↦ O ( E ( n ) ) n \mapsto O(E(n)) n ↦ O ( E ( n )) , with E ( n ) = N − 1 ( n ) E(n) = N^{-1}(n) E ( n ) = N − 1 ( n ) .
This transformation is implemented as IntegratedObservable.pushforward(), which determines O ~ \widetilde{O} O by inverse interpolation using O ( n ) \boldsymbol{O}(n) O ( n ) defined from the class instance itself and the function N ( E ) \boldsymbol{N}(E) N ( E ) (a DensityData instance) as the first argument. The second argument is the array of density values n n n at which O ~ ( n ) = O ( N − 1 ( n ) ) \widetilde{O}(n)=O(N^{-1}(n)) O ( n ) = O ( N − 1 ( n )) is evaluated. In the most simplified form, the essence of the implementation is3
def pushforward(self, other, values):
return np.interp(values, other.densdata, self.densdata)
where self represents O ( E ) O(E) O ( E ) and other represents N ( E ) N(E) N ( E ) . In this example, we assume that self and other are defined on the same array of energies and that the attribute xval is None for both.
Broadening
In essence, the density of states (DOS) is defined as the size (length, area, volume) of the level sets of the dispersion E ( k ) E(\boldsymbol{k}) E ( k ) . From the principles of minimal energy and Pauli exclusion, electronic states fill up to the Fermi energy, such that the number of carriers equals the integral over the DOS up to the Fermi energy. This picture assumes zero temperature, so that the occupation function F ( E ) F(E) F ( E ) has a hard cutoff at the Fermi energy.
For finite temperature T T T , the occupation function smoothly goes from 1 to 0 in an energy window of width proportional to k B T k_{\mathrm{B}}T k B T . The effective density of carriers is the product of the DOS g ( E ) g(E) g ( E ) and the smooth occupation function F ( E ) F(E) F ( E ) . Due to the smoothness of this function, an electron in quantum state E E E can also be found at energies nearby. The probability distribution for finding the particle at energy E E E is f ( E ) = d F ( E ) / d E f(E)=dF(E)/dE f ( E ) = d F ( E ) / d E , which is centred around the eigenenergy of the state. The fact that this distribution is somewhat spread out explains the term broadening . Other probabilistic phenomena such as disorder can broaden also the density of states. These can be treated on the same footing as the broadening due to finite temperature.
Broadening is applied essentially as the convolution of the density of states g ( E ) g(E) g ( E ) with the broadening function f ( E ) f(E) f ( E ) .
d ( E ) = ( f ∗ g ) ( E ) = ∫ E 0 E f ( E − E ′ ) g ( E ′ ) d E ′ (106) d(E)=(f*g)(E)=\int_{E_0}^{E}f(E-E')g(E')\,\mathrm{d}E' \tag*{(106)} d ( E ) = ( f ∗ g ) ( E ) = ∫ E 0 E f ( E − E ′ ) g ( E ′ ) d E ′ (106)
In kdotpy, the central quantity is the integrated density of states G ( E ) = n ( E ) G(E)=n(E) G ( E ) = n ( E ) . The broadened version D ( E ) D(E) D ( E ) is similarly obtained as the convolution
D ( E ) = ( f ∗ G ) ( E ) = ∫ E 0 E f ( E − E ′ ) G ( E ′ ) d E ′ = ( F ∗ g ) ( E ) , (107) D(E)=(f*G)(E)=\int_{E_0}^{E}f(E-E')G(E')\,\mathrm{d}E'=(F*g)(E), \tag*{(107)} D ( E ) = ( f ∗ G ) ( E ) = ∫ E 0 E f ( E − E ′ ) G ( E ′ ) d E ′ = ( F ∗ g ) ( E ) , (107)
where the latter equality is a property of convolution in general.
Since the energy values are defined on a grid, we need to take special care of numerical inaccuracies. In particular, we need to make sure that the integral over the broadening function equals 1 exactly. Note that if we simply take some values f ( E j ) f(E_j) f ( E j ) (E j = j δ E E_j=j\delta E E j = j δ E with j j j being integers) the (Riemann) sum ∑ j f ( E j ) δ E \sum_j f(E_j)\delta E ∑ j f ( E j ) δ E that approximates the integral ∫ f ( E ) d E \int f(E)\,\mathrm{d}E ∫ f ( E ) d E may deviate from 1, especially if the broadening parameter is comparable in size to δ E \delta E δ E . In order to prevent this from happening we rather use the discrete derivative of F ( E ) = 1 − ∫ f ( E ′ ) d E ′ F(E)=1-\int f(E')\,\mathrm{d}E' F ( E ) = 1 − ∫ f ( E ′ ) d E ′ . The reason for ‘1 minus’ is to make the interpretation of F ( E ) F(E) F ( E ) to be the occupation functions associated with the broadening kernel f ( E ) f(E) f ( E ) .
The broadening functions and their occupation functions implemented in kdotpy are listed in Appendix B.6. In general, the command line argument is of the form broadening w0 type dep, where w0 is the width parameter and type determines the type (shape of the broadening function), i.e., fermi, thermal, gauss, or lorentz). The dependency argument dep determines the dependence of the width parameter on k k k or B B B ; for example, when sqrt is used with a magnetic-field dependence, the broadening width applied to the IDOS is w ( B ) = w 0 B w(B)=w_0\sqrt{B} w ( B ) = w 0 B with B B B in T.
Generally, some of the arguments after broadening may be omitted, in which case the following defaults are used:
Finally, compound broadening might be achieved with multiple broadening arguments. The broadening arguments are iteratively applied to the density of states. For example, if one gives broadening gauss 1.0 broadening thermal 0.5, first the Gaussian broadening is applied to the DOS, then the thermal broadening. If the broadening kernels are denoted f 1 f_1 f 1 and f 2 f_2 f 2 , then the result is
d ( E ) = ( f 2 ∗ ( f 1 ∗ g ) ) ( E ) = ( ( f 2 ∗ f 1 ) ∗ g ) ( E ) (108) d(E) = (f_2 * (f_1 * g))(E) = ((f_2 * f_1) * g)(E) \tag*{(108)} d ( E ) = ( f 2 ∗ ( f 1 ∗ g )) ( E ) = (( f 2 ∗ f 1 ) ∗ g ) ( E ) (108)
By virtue of associativity of convolution, the combined broadening kernel is f 2 ∗ f 1 f_2 * f_1 f 2 ∗ f 1 , which generalizes to f n ∗ ⋯ ∗ f 1 f_n * \cdots* f_1 f n ∗ ⋯ ∗ f 1 if one combines n n n broadening kernels.
Since convolution is commutative, f 2 ∗ f 1 = f 1 ∗ f 2 f_2 * f_1 = f_1 * f_2 f 2 ∗ f 1 = f 1 ∗ f 2 , the order of applying the broadening kernels is irrelevant in principle . Due to limitations of the numerics—convolution is calculated by numerical integration on a finite interval with finite resolution—changing the order might lead to small numerical differences. Some combinations of broadening may be simplified analytically, for example the convolution of two Gaussian distribution functions with standard deviations σ 1 \sigma_1 σ 1 and σ 2 \sigma_2 σ 2 is a Gaussian distribution function with standard deviation σ = σ 1 2 + σ 2 2 \sigma= \sqrt{\sigma_1^2 + \sigma_2^2} σ = σ 1 2 + σ 2 2 . (For Lorentzians, the widths add up, γ = γ 1 + γ 2 \gamma= \gamma_1 + \gamma_2 γ = γ 1 + γ 2 , and a combination of Fermi distributions cannot be simplified analytically.) These simplifications may be useful to perform manually prior to input, as to avoid unnecessary numerical errors.
Density as function of z
Knowledge of the spatial distribution of charge ρ ( z ) \rho(z) ρ ( z ) given a certain carrier density can aid significantly in understanding the observable behaviour of a device. It is also essential for the self-consistent Hartree algorithm (see § 6.1 ) in order to find the electric potential induced by the charges in the material.
The idea of calculating ρ ( z ) \rho(z) ρ ( z ) is analogous to the methods for the IDOS and the integrated observable. We insert the probability density appropriate for the interval [ k i , k i + 1 ] [k_i,k_{i+1}] [ k i , k i + 1 ] into Eq. (102) : for each band, we calculate
ρ ( b ) ( z , E ) = 1 ( 2 π ) d ∑ i = 1 n k − 1 1 2 ( ∣ ψ k i ( b ) ( z ) ∣ 2 + ∣ ψ k i + 1 ( b ) ( z ) ∣ 2 ) f i ( E ) d k i . (109) \rho^{(b)}(z,E) = \frac{1}{(2\pi)^d} \sum_{i=1}^{n_k-1} \frac{1}{2} \left( \left|\psi_{k_i}^{(b)}(z)\right|^2 + \left|\psi_{k_{i+1}}^{(b)}(z)\right|^2 \right) f_i(E)\,d k_i. \tag*{(109)} ρ ( b ) ( z , E ) = ( 2 π ) d 1 i = 1 ∑ n k − 1 2 1 ( ψ k i ( b ) ( z ) 2 + ψ k i + 1 ( b ) ( z ) 2 ) f i ( E ) d k i . (109)
and we sum over all bands, ρ ( z , E ) = ∑ b ρ ( b ) ( z , E ) \rho(z,E) = \sum_b \rho^{(b)}(z,E) ρ ( z , E ) = ∑ b ρ ( b ) ( z , E ) (or if desired, over either electrons or holes only). In the implementation of density_energy(), the probability densities ∣ ψ k i ( b ) ( z ) ∣ 2 \left|\psi_{k_i}^{(b)}(z)\right|^2 ψ k i ( b ) ( z ) 2 are extracted from the eigenvectors, summed over the orbital degree of freedom, and supplied as an argument to int_dos_by_band(). The result is a two-dimensional array that encodes ρ ( z , E ) \rho(z,E) ρ ( z , E ) over an array of z z z values and an array of energy values E E E . The function densityz() evaluates ρ ( z , E ) \rho(z,E) ρ ( z , E ) for a specific energy E E E and returns a one-dimensional array. The latter function is used by the self-consistent Hartree method, discussed in § 6.1 .
In two dimensions, the algorithm is analogous, but the interpolated probability density in (109) is replaced by a weighted sum over the four corner points of each momentum space plaquette,
∑ ν = 1 4 c ν ∣ ψ k i ν ( b ) ( z ) ∣ 2 , (110) \sum_{\nu=1}^{4} c_\nu\left|\psi_{k_{i_\nu}}^{(b)}(z)\right|^2, \tag*{(110)} ν = 1 ∑ 4 c ν ψ k i ν ( b ) ( z ) 2 , (110)
and the sum over momenta is replaced by the simplices over triangles in the triangulated lattice [cf. Eq. (104) ]. One can choose between equal weights c ν = ( 1 4 , 1 4 , 1 4 , 1 4 ) c_\nu= \left(\frac{1}{4}, \frac{1}{4}, \frac{1}{4}, \frac{1}{4}\right) c ν = ( 4 1 , 4 1 , 4 1 , 4 1 ) for all triangles or adjusted weights taking into account the shape of the triangle, i.e., c ν = ( 5 12 , 5 12 , 1 12 , 1 12 ) c_\nu= \left(\frac{5}{12}, \frac{5}{12}, \frac{1}{12}, \frac{1}{12}\right) c ν = ( 12 5 , 12 5 , 12 1 , 12 1 ) for the triangle with vertices 125, etc.
In Landau level mode, the summation over momentum is absent, and we sum all contributions ∣ ψ B ( b ) ( z ) ∣ 2 \left|\psi_B^{(b)}(z)\right|^2 ψ B ( b ) ( z ) 2 for all states with eigenvalues E ( b ) E^{(b)} E ( b ) between the charge neutrality point and the Fermi level. Like the IDOS calculation, the Landau level degeneracy factor e B / 2 π ℏ eB/2\pi\hbar e B /2 π ℏ is taken into account as well.
The z z z -dependent density ρ ( z ) \rho(z) ρ ( z ) is always calculated such, that ∫ ρ ( z ) d z \int\rho(z)\,dz ∫ ρ ( z ) d z is equal to the IDOS n n n at the same energy. We note that until here, we have assumed that ρ ( z ) \rho(z) ρ ( z ) is uniformly zero at the charge neutrality point, but this is not necessarily the case: In fact, at zero total density (n = 0 n=0 n = 0 ), the system need only be neutral on average (∫ ρ ( z ) d z = 0 \int\rho(z)\,dz=0 ∫ ρ ( z ) d z = 0 ), but the local charge density ρ ( z ) \rho(z) ρ ( z ) may vary. In kdotpy, one can define a density offset ρ o f f s e t ( z ) \rho_{\mathrm{offset}}(z) ρ offset ( z ) at zero density, or use a different reference point. An in-depth analysis of physically sensible choices of the reference density is outside the scope of this work and will be presented elsewhere.
Optical transitions
Background
Optical spectroscopy is a powerful experimental technique for characterization and investigation of band structures of semiconductors. By analysing the optical transitions between two states, conclusions about e.g. the band gap, the band order, etc. can be drawn. Simulating these transitions and their dependence on e.g. magnetic field in kdotpy and, thus, being able to easily compare them to experimental data, provides a great tool to improve the modelling capabilities of kdotpy and to validate which approximations/symmetries suffice for specific system configurations. Ultimately, this refines the predictions that can be made with kdotpy with regards to band structure engineering, etc.
We achieve this by including the contributions of the electromagnetic (EM) field, that drives optical transitions, as a separate vector potential A E M \mathbf{A}_{\mathrm{EM}} A EM in the Hamiltonian
H p e r t = ( p + e A 0 + e A E M ) 2 2 m + V ≡ H + H E M (111) H_{\mathrm{pert}} = \frac{(\mathbf{p}+e\mathbf{A}_0+e\mathbf{A}_{\mathrm{EM}})^2}{2m}+V \equiv H+H_{\mathrm{EM}} \tag*{(111)} H pert = 2 m ( p + e A 0 + e A EM ) 2 + V ≡ H + H EM (111)
with
H = ( p + e A 0 ) 2 2 m + V and H E M = e A E M ⋅ p m . (112) H=\frac{(\mathbf{p}+e\mathbf{A}_0)^2}{2m}+V
\qquad\text{and}\qquad
H_{\mathrm{EM}}=\frac{e\mathbf{A}_{\mathrm{EM}}\cdot\mathbf{p}}{m}. \tag*{(112)} H = 2 m ( p + e A 0 ) 2 + V and H EM = m e A EM ⋅ p . (112)
The identity p ⋅ A = A ⋅ p \mathbf{p}\cdot\mathbf{A}=\mathbf{A}\cdot\mathbf{p} p ⋅ A = A ⋅ p , which is always valid for divergence free fields of EM waves, was used and the energy offset terms A E M 2 + 2 A 0 ⋅ A E M \mathbf{A}_{\mathrm{EM}}^2+2\mathbf{A}_0\cdot\mathbf{A}_{\mathrm{EM}} A EM 2 + 2 A 0 ⋅ A EM were neglected to get to the second line. Using the dipole approximation q → 0 \mathbf{q}\to0 q → 0 , neglecting any spatial contribution to the phase factor, the vector potential of EM waves can be expressed as
A E M = E 2 ω ( e i ω t + c . c . ) (113) \mathbf{A}_{\mathrm{EM}}=\frac{\mathbf{E}}{2\omega}\left(e^{i\omega t}+\mathrm{c.c.}\right) \tag*{(113)} A EM = 2 ω E ( e iω t + c.c. ) (113)
For the sake of simplicity, we drop the time varying phase factors (these will become relevant in Fermi’s Golden Rule) and we assume an EM wave travelling in z z z direction. The operator product can then be written as
A E M ⋅ p ∝ E ⋅ p = E x p x + E y p y = 1 2 ( E + p + + E − p − ) (114) \mathbf{A}_{\mathrm{EM}}\cdot\mathbf{p}\propto\mathbf{E}\cdot\mathbf{p}=E_xp_x+E_yp_y=\frac{1}{\sqrt{2}}\left(E_+p_++E_-p_-\right) \tag*{(114)} A EM ⋅ p ∝ E ⋅ p = E x p x + E y p y = 2 1 ( E + p + + E − p − ) (114)
where E ± = 1 2 ( E x ∓ i E y ) E_{\pm}=\frac{1}{\sqrt{2}}(E_x\mp iE_y) E ± = 2 1 ( E x ∓ i E y ) and p ± = p x ± i p y p_{\pm}=p_x\pm ip_y p ± = p x ± i p y as circular polarization basis. The optical transition rate Γ i → f \Gamma_{i\to f} Γ i → f from initial state ∣ ψ i ⟩ \lvert\psi_i\rangle ∣ ψ i ⟩ to final state ∣ ψ f ⟩ \lvert\psi_f\rangle ∣ ψ f ⟩ can be calculated using Fermi’s Golden Rule
Γ i → f = 2 π ℏ ∣ M ( f i ) ∣ 2 δ ( ℏ ω f i − ℏ ω ) (115) \Gamma_{i\to f}=\frac{2\pi}{\hbar}\left|M^{(fi)}\right|^2\delta\left(\hbar\omega_{fi}-\hbar\omega\right) \tag*{(115)} Γ i → f = ℏ 2 π M ( f i ) 2 δ ( ℏ ω f i − ℏ ω ) (115)
with transition matrix element
M ( f i ) = ⟨ ψ f ∣ H E M ∣ ψ i ⟩ = e E 2 ω ⟨ ψ f ∣ v ∣ ψ i ⟩ (116) M^{(fi)}=\langle\psi_f\mid H_{\mathrm{EM}}\mid\psi_i\rangle=\frac{eE}{2\omega}\langle\psi_f\mid v\mid\psi_i\rangle \tag*{(116)} M ( f i ) = ⟨ ψ f ∣ H EM ∣ ψ i ⟩ = 2 ω e E ⟨ ψ f ∣ v ∣ ψ i ⟩ (116)
The omitted time dependence of the electric fields is responsible for the δ \delta δ distribution, assuring energy conservation for absorption and emission of photons.
Evaluation of transition matrix elements
The transition matrix elements given by (116) are calculated by get_transitions() (symbolic mode) and get_transitions_full() (full mode) in transitions.py. This calculation requires the eigenvectors, and therefore this is done immediately after diagonalization of the Hamiltonian, before the eigenvectors are discarded from memory.
The velocity operator is evaluated by using the Ehrenfest theorem
v x = − i ℏ [ x , H p e r t ] ≈ − i ℏ [ x , H ] = d H d p x = 1 ℏ d H d k x (117) v_x=-\frac{i}{\hbar}[x,H_{\mathrm{pert}}]\approx-\frac{i}{\hbar}[x,H]=\frac{\mathrm{d}H}{\mathrm{d}p_x}=\frac{1}{\hbar}\frac{\mathrm{d}H}{\mathrm{d}k_x} \tag*{(117)} v x = − ℏ i [ x , H pert ] ≈ − ℏ i [ x , H ] = d p x d H = ℏ 1 d k x d H (117)
and similar for v y v_y v y . Let us relabel this operator O x / y = v x / y O_{x/y}=v_{x/y} O x / y = v x / y and define the corresponding operators in circular basis
O ± = O x ± i O y = 2 ℏ d H d k ∓ (118) O_{\pm}=O_x\pm iO_y=\frac{2}{\hbar}\frac{\mathrm{d}H}{\mathrm{d}k_{\mp}} \tag*{(118)} O ± = O x ± i O y = ℏ 2 d k ∓ d H (118)
using k ± = k x ± i k y k_{\pm}=k_x\pm ik_y k ± = k x ± i k y and d d k ± = 1 2 ( d d k x ∓ i d d k y ) \frac{\mathrm{d}}{\mathrm{d}k_{\pm}}=\frac{1}{2}\left(\frac{\mathrm{d}}{\mathrm{d}k_x}\mp i\frac{\mathrm{d}}{\mathrm{d}k_y}\right) d k ± d = 2 1 ( d k x d ∓ i d k y d ) . Independent of the used LL mode, the derivation of the basic LL Hamiltonian H H H in k ∓ k_{\mp} k ∓ is performed in its symbolic representation. After derivation, the numerical values of the operator are evaluated for LLs n n n and n + 1 n+1 n + 1 . Then, the matrix product
∣ O ± f i ∣ 2 = ∣ ⟨ ψ f ∣ O ± ∣ ψ i ⟩ ∣ 2 (119) \left|O_{\pm}^{fi}\right|^2=\left|\langle\psi_f|O_{\pm}|\psi_i\rangle\right|^2 \tag*{(119)} O ± f i 2 = ∣ ⟨ ψ f ∣ O ± ∣ ψ i ⟩ ∣ 2 (119)
is evaluated for all combinations of ⟨ ψ f ∣ \langle\psi_f| ⟨ ψ f ∣ and ∣ ψ i ⟩ |\psi_i\rangle ∣ ψ i ⟩ . This evaluation is done efficiently as a sequence of two matrix multiplications on NumPy matrices
opeivec1T = op @ eivec1T
ov = eivec2T_H @ opeivec1T
ov2 = np.real(np.abs(ov)**2)
where op represents O ± O_{\pm} O ± , eivec1T holds the eigenvectors ∣ ψ i ⟩ |\psi_i\rangle ∣ ψ i ⟩ as columns, and eivec2T_H holds the conjugate eigenvectors ⟨ ψ f ∣ \langle\psi_f| ⟨ ψ f ∣ as rows. The result is filtered, by discarding all transitions with an amplitude below a threshold ampmin, schematically
sel = (ov2 >= ampmin)
ov2_filtered = ov2[sel]
which yields the filtered transitions as the one-dimensional array ov2_filtered. In the same manner, one-dimensional arrays containing the energies and Landau level index of initial and final state are constructed. These arrays are stored together in a TransitionsData instance (class definition in transitions.py) inside DiagDataPoint.transitions, see ModelLL._post_solve() in models.py, for further analysis later on.
Note that we only calculate ∣ O + f i ∣ 2 \left|O_{+}^{fi}\right|^2 O + f i 2 in kdotpy, to reduce calculation time. Because of the relation ⟨ ψ f ∣ O + ∣ ψ i ⟩ = ⟨ ψ i ∣ O − ∣ ψ f ⟩ † \langle\psi_f|O_{+}|\psi_i\rangle=\langle\psi_i|O_{-}|\psi_f\rangle^\dagger ⟨ ψ f ∣ O + ∣ ψ i ⟩ = ⟨ ψ i ∣ O − ∣ ψ f ⟩ † and the fact that we only keep the absolute square of these matrix elements, we can reinterpret the emission matrix elements of the ∣ O + f i ∣ 2 \left|O_{+}^{fi}\right|^2 O + f i 2 matrix (negative energy difference from final to initial state) as absorption matrix elements of ∣ O − f i ∣ 2 \left|O_{-}^{fi}\right|^2 O − f i 2 .
Postprocessing and filtering
In postprocess.py the function transitions() is responsible for any further analysis of optical transitions and corresponding spectra. Depending on input parameters (e.g. using cardens) the calculated transitions are filtered by the method filter_transitions() of a DiagData instance. If no filtering is performed, all transitions are plotted and written into a table. For filtered data, plotting can be suppressed to speed up code execution, but the data will always be written into a table. Further, also only for filtered transitions, other quantities related to optical transitions can be optionally calculated, e.g., rotation and ellipticity. This heavily impacts calculation time.
To filter transitions the TransitionsData instance method at_energy() is called, which only returns transitions that cross the given energy level, i.e., the initial state is (partially) occupied while the final state is (partially) unoccupied, as a new TransitionsData instance. If no broadening is used (delta-peak shaped energy states), every transition is checked if and only if one of the two involved states is above while the other is below the given energy. Otherwise, the implemented occupation function for the type of broadening is used to filter transitions (e.g., Fermi distribution for thermal broadening). The occupation factor is
P i → f = ∣ f ( E i ) − f ( E f ) ∣ (120) P_{i\to f}=\left|f(E_i)-f(E_f)\right| \tag*{(120)} P i → f = ∣ f ( E i ) − f ( E f ) ∣ (120)
where f ( E i / f ) f(E_{i/f}) f ( E i / f ) is the occupation function for the given broadening type evaluated at the energy of the initial/final state, respectively. Only transitions for which ∣ ⟨ ψ f ∣ O ± ∣ ψ i ⟩ ∣ 2 ⋅ P i → f ≥ A min \left|\langle\psi_f|O_{\pm}|\psi_i\rangle\right|^2\cdot P_{i\to f}\geq A_{\min} ∣ ⟨ ψ f ∣ O ± ∣ ψ i ⟩ ∣ 2 ⋅ P i → f ≥ A m i n will be kept as filtered transition, where A min A_{\min} A m i n can be adjusted by the command line argument transitions followed by a floating point value or by the configuration option transitions_min_amplitude (default value is 0.01).
Output (tables and plots)
Plotting and saving of transition data is performed with the same routines for both unfiltered and filtered transition data, using different file names (transitions-all... vs. transitions-filtered...). These functions can be found in ploto/auxil.py and tableo/auxil.py and are both called transitions().
Only a single quantity is plotted as transition plot. By using the configuration option plot_transitions_quantity (valid choices see below) the user can choose which quantity is plotted, the default is rate. Independent of choice, the amplitude of the chosen quantity is colour-coded and plotted onto a B B B vs. Δ E \Delta E Δ E grid.
Contrary to the plot output, as many quantities as possible are saved into the csv file. Depending on input and material parameters, some may not be possible to calculate. Additional quantities that will always be saved to the csv, but are not available for plotting, are magnetic field values, initial/final LL indices and initial/final band indices. The remaining quantities mostly overlap with the plot quantities and are given in the following list:
deltae: The energy difference Δ E \Delta E Δ E between initial and final state in meV.
freq: The corresponding frequency for the energy difference Δ E \Delta E Δ E in THz.
lambda: The corresponding wavelength for the energy difference Δ E \Delta E Δ E in μ m \mu\mathrm{m} μ m .
amplitude: The absolute-squared transition matrix element ∣ O ± f i ∣ 2 δ ( ℏ ω f i − ℏ ω ) \lvert O_{\pm}^{fi}\rvert^2 \delta(\hbar\omega_{fi}-\hbar\omega) ∣ O ± f i ∣ 2 δ ( ℏ ω f i − ℏ ω ) [see Eq. (119)]; including delta distribution from Fermi’s Golden Rule in n m 2 n s − 2 m e V − 1 \mathrm{nm}^2\,\mathrm{ns}^{-2}\,\mathrm{meV}^{-1} nm 2 ns − 2 meV − 1 .
occupancy: The occupation factor P i → f P_{i\to f} P i → f [see Eq. (120)], dimensionless. (Only included if occupancies can be calculated. In this case, also the LL degeneracy factor G = e B / ( 2 π ℏ ) G=eB/(2\pi\hbar) G = e B / ( 2 π ℏ ) is included.)
rate: Calculates a transition rate density per electric field intensity,
R = π 4 ℏ ω f i 2 ∣ O ± f i ∣ 2 ⋅ G ⋅ P i → f (121) R=\frac{\pi}{4\hbar\omega_{fi}^{2}}\lvert O_{\pm}^{fi}\rvert^2\cdot G\cdot P_{i\to f} \tag*{(121)} R = 4ℏ ω f i 2 π ∣ O ± f i ∣ 2 ⋅ G ⋅ P i → f (121)
in n s − 1 m V − 2 \mathrm{ns}^{-1}\,\mathrm{mV}^{-2} ns − 1 mV − 2 , taking LL degeneracy G G G and occupancy into account.
α = 1 ε 0 2 c n ℏ ω f i R (122) \alpha=\frac{1}{\varepsilon_0}\frac{2}{cn}\hbar\omega_{fi}R \tag*{(122)} α = ε 0 1 c n 2 ℏ ω f i R (122)
in ‰, where R R R is the transition rate per electric field intensity, with velocity of light c c c and refractive index n n n . (Only included if the refractive index of the QW layer is known. In this case, also a signed absorption coefficient is included, where the sign indicates which circular polarization basis is absorbed.)
Outlook on polarimetry spectra
Expanding on optical absorption spectroscopy, polarimetry experiments investigate the polarization state of the EM wave after interaction with a sample. The generally elliptic polarization can be described in terms of a complex angle. For the above mentioned applications, the imaginary part of this complex angle is of great interest, which can be translated into an ellipticity ϵ F \epsilon_F ϵ F . The ellipticity describes the ratio of minor b b b to major axis a a a by tan ϵ F = b / a \tan\epsilon_F=b/a tan ϵ F = b / a and is a measure for the shape of the ellipse, where the sign indicates the pseudo-spin of the EM wave. Therefore, it not only carries information on the absorption amplitude but also on the relative absorption difference between both circular polarization modes, which allows observing a change in orbital composition of states and thus, achieving further insight into the band structure.
Knowledge of the relative absorption A ± A_{\pm} A ± allows direct access to the ellipticity ε F \varepsilon_{\mathrm{F}} ε F , by tan ( ε F ) = E + − E − E + + E − \tan(\varepsilon_{\mathrm{F}})=\frac{E_{+}-E_{-}}{E_{+}+E_{-}} tan ( ε F ) = E + + E − E + − E − , where E ± ∝ I ± ( d ) E_{\pm}\propto I_{\pm}(d) E ± ∝ I ± ( d ) . Assuming I + ( 0 ) = I − ( 0 ) I_{+}(0)=I_{-}(0) I + ( 0 ) = I − ( 0 ) and using A ± = I ± ( d ) I ± ( 0 ) = exp ( − α ± ) A_{\pm}=\frac{I_{\pm}(d)}{I_{\pm}(0)}=\exp(-\alpha_{\pm}) A ± = I ± ( 0 ) I ± ( d ) = exp ( − α ± ) we get
ε F = arctan ( A + − A − A + + A − ) = arctan ( exp ( − α + / 2 ) − exp ( − α − / 2 ) exp ( − α + / 2 ) + exp ( − α − / 2 ) ) (123) \varepsilon_{\mathrm{F}}=\arctan\left(\frac{\sqrt{A_{+}}-\sqrt{A_{-}}}{\sqrt{A_{+}}+\sqrt{A_{-}}}\right)=\arctan\left(\frac{\exp(-\alpha_{+}/2)-\exp(-\alpha_{-}/2)}{\exp(-\alpha_{+}/2)+\exp(-\alpha_{-}/2)}\right) \tag*{(123)} ε F = arctan ( A + + A − A + − A − ) = arctan ( exp ( − α + /2 ) + exp ( − α − /2 ) exp ( − α + /2 ) − exp ( − α − /2 ) ) (123)
At the time of publication of this article, only the absorption coefficients are calculated by kdotpy, ellipticity may be added at a later stage in development. Until then, users may use the csv output to calculated the ellipticity on their own. Note that these calculated ellipticity spectra are delta peak transitions. In experimental data these transitions always have finite linewidth. This can be accounted for by broadening all transitions by Cauchy-Lorentz distributions, after calculating them with kdotpy.
Other postprocessing functions
Extrema
Local extrema in the band dispersions are important features for characterizing the band structure. In kdotpy, extrema analysis is performed if the command-line argument extrema is given. The algorithm relies on the notion of bands, hence the band indices are essential. The extrema analysis does not just find the local extrema in the calculated eigenvalues, but also does a quadratic interpolation to localize each extremum more precisely, and to determine the effective mass as the inverse of the second derivative. Each band extremum is stored in a light-weight class BandExtremum that contains the momentum value, energy value, whether minimum or maximum, and the effective mass. The results are displayed as standard output and written to a csv file. The extrema are also shown in two-dimensional dispersion plots.
In one dimension, the following algorithm is applied to each band b b b :
Extract the dispersion e i = E ( b ) ( k i ) e_i=E^{(b)}(k_i) e i = E ( b ) ( k i ) as function of the momenta k i k_i k i on the grid.
Scan over all i = 2 , … , n k − 1 i=2,\ldots,n_k-1 i = 2 , … , n k − 1 . If a triplet ( e i − 1 , e i , e i + 1 ) (e_{i-1},e_i,e_{i+1}) ( e i − 1 , e i , e i + 1 ) satisfies e i − 1 > e i e_{i-1}>e_i e i − 1 > e i and e i + 1 > e i e_{i+1}>e_i e i + 1 > e i , label it as a minimum; if e i − 1 < e i e_{i-1}<e_i e i − 1 < e i and e i + 1 < e i e_{i+1}<e_i e i + 1 < e i , label it as a maximum.
For each minimum and maximum, apply three_point_extremum_solver(). This function takes the points ( k i − 1 , e i − 1 ) (k_{i-1},e_{i-1}) ( k i − 1 , e i − 1 ) , ( k i , e i ) (k_i,e_i) ( k i , e i ) , and ( k i + 1 , e i + 1 ) (k_{i+1},e_{i+1}) ( k i + 1 , e i + 1 ) , and calculates the coefficients f 0 f_0 f 0 , k 0 k_0 k 0 , and
c c c of the quadratic function f ( k ) = f 0 + c ( k − k 0 ) 2 f(\mathbf{k})=f_0+c(\mathbf{k}-\mathbf{k}_0)^2 f ( k ) = f 0 + c ( k − k 0 ) 2 that passes through these points. Assuming that the momentum values are spaced evenly, k i + 1 − k i = k i − k i − 1 k_{i+1}-k_i=k_i-k_{i-1} k i + 1 − k i = k i − k i − 1 , we have
c = e i + 1 − 2 e i + e i − 1 2 ( k i − k i − 1 ) 2 , k 0 = k i − e i + 1 − e i − 1 2 ( k i + 1 − k i − 1 ) c , f 0 = e i − c ( k i − k 0 ) 2 . (124) c=\frac{e_{i+1}-2e_i+e_{i-1}}{2(k_i-k_{i-1})^2},
\qquad
k_0=k_i-\frac{e_{i+1}-e_{i-1}}{2(k_{i+1}-k_{i-1})c},
\qquad
f_0=e_i-c(k_i-k_0)^2. \tag*{(124)} c = 2 ( k i − k i − 1 ) 2 e i + 1 − 2 e i + e i − 1 , k 0 = k i − 2 ( k i + 1 − k i − 1 ) c e i + 1 − e i − 1 , f 0 = e i − c ( k i − k 0 ) 2 . (124)
The coefficient k 0 k_0 k 0 is the momentum position of the extremum and f 0 f_0 f 0 is the energy value, see Figure 9 (a) for an illustration. The second derivative is equal to 2 c 2c 2 c , from which we determine the effective mass m e f f = − ℏ / m 0 c m_{\mathrm{eff}}=-\hbar/m_0c m eff = − ℏ/ m 0 c , where m 0 m_0 m 0 is the bare electron mass.
Figure 9. Extrema solvers in 1, 2, and 3 dimensions. (a) The three-point extrema solver for one dimension fits the function f ( k ) = f 0 + c ( k − k 0 ) 2 f(k)=f_0+c(k-k_0)^2 f ( k ) = f 0 + c ( k − k 0 ) 2 to three consecutive data points. The location of the minimum in momentum space is k 0 k_0 k 0 , which may be between the grid points. The local minimum has energy f 0 f_0 f 0 . (b) In two dimensions, a nine-point extrema solver is used. The fit function [Eq. (125) ] considers the energy values at the five red points [central point ( k x , i , k y , j ) (k_{x,i}, k_{y,j}) ( k x , i , k y , j ) highlighted with larger size]. The four pink points are considered partially, i.e., only some linear combinations of the dispersion values, see Appendix § 10 .§ 8 . The location ( k x , 0 , k y , 0 ) (k_{x,0}, k_{y,0}) ( k x , 0 , k y , 0 ) of the minimum is generally between the grid points. (c) In three dimensions a nineteen-point extrema solver is used. Seven points (red) are considered fully, twelve more points (pink) are treated partially. The corner points (black) are not considered at all.
If the momentum range starts or ends at k = 0 \mathbf{k}=0 k = 0 , it is automatically extended by reflection, so that extrema at zero are found as well.
In two dimensions, we use a similar method to detect extrema at the grid points ( k x , i , k y , j ) (k_{x,i},k_{y,j}) ( k x , i , k y , j ) . The location, energy, and band mass of the extremum are determined with the nine_point_extremum_solver(), that tries to fit the quadratic equation
f ( k x , k y ) = f 0 + a ( k x − k x , 0 ) 2 + b ( k y − k y , 0 ) 2 + c ( k x − k x , 0 ) ( k y − k y , 0 ) (125) f(k_x,k_y)=f_0+a(k_x-k_{x,0})^2+b(k_y-k_{y,0})^2+c(k_x-k_{x,0})(k_y-k_{y,0}) \tag*{(125)} f ( k x , k y ) = f 0 + a ( k x − k x , 0 ) 2 + b ( k y − k y , 0 ) 2 + c ( k x − k x , 0 ) ( k y − k y , 0 ) (125)
to the energies at the nine points defined by indices { i − 1 , i , i + 1 } \{i-1,i,i+1\} { i − 1 , i , i + 1 } and { j − 1 , j , j + 1 } \{j-1,j,j+1\} { j − 1 , j , j + 1 } in the k x k_x k x and k y k_y k y direction, respectively. There are only six unknowns, namely f 0 f_0 f 0 , ( k x , 0 , k y , 0 ) (k_{x,0},k_{y,0}) ( k x , 0 , k y , 0 ) , and ( a , b , c ) (a,b,c) ( a , b , c ) , for nine input variables. Of the four corner point values e i ± 1 , j ± 1 e_{i\pm1,j\pm1} e i ± 1 , j ± 1 , only the linear combination e i + 1 , j + 1 − e i − 1 , j + 1 − e i + 1 , j − 1 + e i − 1 , j − 1 e_{i+1,j+1}-e_{i-1,j+1}-e_{i+1,j-1}+e_{i-1,j-1} e i + 1 , j + 1 − e i − 1 , j + 1 − e i + 1 , j − 1 + e i − 1 , j − 1 is considered see Figure 9 (b) and Appendix § 10 .§ 8 . The extremum energy is f 0 f_0 f 0 , its location ( k x , 0 , k y , 0 ) (k_{x,0},k_{y,0}) ( k x , 0 , k y , 0 ) , and the band mass follows from the eigenvalues λ 1 , 2 \lambda_{1,2} λ 1 , 2 of the Hessian matrix
( 2 a c c 2 b ) (126) \begin{pmatrix}
2a & c\\
c & 2b \tag*{(126)}
\end{pmatrix} ( 2 a c c 2 b ) (126)
as m e f f , α = − ℏ / m 0 λ α m_{\mathrm{eff},\alpha}=-\hbar/m_0\lambda_\alpha m eff , α = − ℏ/ m 0 λ α . Momentum space extension is also used if the range of k x k_x k x and/or k y k_y k y values ends at zero. For polar coordinates, we use the same algorithm as for cartesian coordinates, except for k = 0 k=0 k = 0 , where we use a special version of the one-dimensional solver. The band masses are coordinate-system independent in principle: prior to obtaining the eigenvalues, the Hessian matrix is transformed to cartesian coordinates (see Appendix § 10 .§ 8 ). If one compares the results from dispersion calculations in cartesian and polar coordinates, they are equal up to some numerical differences from the coordinate conversion and from the grid point interpolation.
For three dimensions, we use a nineteen_point_extremum_solver(). The inputs are arranged on a 3 × 3 × 3 3\times3\times3 3 × 3 × 3 grid, but the eight corner points are ignored. The fitted function is
f ( k x , k y , k z ) = f 0 + ( k x ′ k y ′ k z ′ ) ( 2 a d e d 2 b f e f 2 c ) ( k x ′ k y ′ k z ′ ) , (127) f(k_x,k_y,k_z)=f_0+
\begin{pmatrix}
k_x' & k_y' & k_z'
\end{pmatrix}
\begin{pmatrix}
2a & d & e\\
d & 2b & f\\
e & f & 2c
\end{pmatrix}
\begin{pmatrix}
k_x'\\
k_y'\\
k_z'
\end{pmatrix}, \tag*{(127)} f ( k x , k y , k z ) = f 0 + ( k x ′ k y ′ k z ′ ) 2 a d e d 2 b f e f 2 c k x ′ k y ′ k z ′ , (127)
where ( k x ′ , k y ′ , k z ′ ) = ( k x , k y , k z ) − ( k x , 0 , k y , 0 , k z , 0 ) (k_x',k_y',k_z')=(k_x,k_y,k_z)-(k_{x,0},k_{y,0},k_{z,0}) ( k x ′ , k y ′ , k z ′ ) = ( k x , k y , k z ) − ( k x , 0 , k y , 0 , k z , 0 ) . The number of unknowns is ten, i.e., the energy f 0 f_0 f 0 , the location ( k x , 0 , k y , 0 , k z , 0 ) (k_{x,0},k_{y,0},k_{z,0}) ( k x , 0 , k y , 0 , k z , 0 ) and the six independent entries ( a , b , c , d , e , f ) (a,b,c,d,e,f) ( a , b , c , d , e , f ) of the Hessian matrix. Like with the nine-point extrema solver, some points are considered partially, see Figure 9 (c) and Appendix § 10 .§ 8 . The band masses are derived from the eigenvalues of the Hessian matrix, with coordinate transformations applied for cylindrical and spherical coordinate systems.
Wave functions
The band structure scripts (kdotpy 1d, kdotpy 2d, etc.) have the option to plot the wave functions. This is done with the command line argument plotwf and further arguments that determine the plot style and the locations (momenta or magnetic fields) at which the plots are made.
In most cases, plotwf will output data files in csv format together with the plots. The csv files typically contain the same data as the plot in the plot PDF. For styles where multiple plots are collected in a single PDF, there will be a separate csv file for each page in the PDF (i.e., for each state), where the file name labels the state by band index, LL index, character, and/or energy. If the configuration
option table_wf_files is set to tar, targz, zip, or zipnozip the files are collected into a single archive file.
For the two-dimensional geometry, there are two main plot styles:
separate: As function of z z z , with different curves for each orbital. For each state, the wave function is expanded into its orbital components ψ i ( z ) \psi_i(z) ψ i ( z ) . Each orbital is represented by a separate colour and solid and dashed lines indicate the real and imaginary parts, respectively. Orbitals for which the amplitude is small, are not drawn. The plot is saved as a multi-page PDF, with each eigenstate on a separate page, see Figure 10 .
together: Absolute-squared, as function of z z z , together in one plot, see Figure 11 .
Figure 10. Examples of wave function plots from kdotpy 2d with plotwf separate. The output is a multipage PDF; here, six pages are shown as panels (a)–(f), each representing a different eigenstate.
Figure 11. Example of a wave function plot from kdotpy 1d with plotwf together. The output is a single page PDF.
For plot style separate, the phase for each orbital wave function is normalized to the orbital with largest amplitude (over z z z , not integrated): The maximum value is set to a positive real number, with relative phases being preserved. If the orbital have a definite complex phase, i.e., ψ i ( z ) = f i ( z ) e i ϕ i \psi_i(z) = f_i(z)e^{i\phi_i} ψ i ( z ) = f i ( z ) e i ϕ i for some real function f i ( z ) f_i(z) f i ( z ) and phase value ϕ i \phi_i ϕ i , the phases ϕ i \phi_i ϕ i are listed as angles in degrees as additional inset on the right side of the plot. The behaviour can be adjusted with the configuration option plot_wf_orbitals_realshift.
In LL mode kdotpy ll, one can use the same plot styles separate and together. In symbolic LL mode, the wave function ψ ( z ) \psi(z) ψ ( z ) is plotted for the corresponding LL index n n n . In full LL mode, plot only the largest contribution, i.e., ψ n ( z ) \psi_n(z) ψ n ( z ) for which ∫ ∣ ψ n ( z ) ∣ 2 d z \int|\psi_n(z)|^2 dz ∫ ∣ ψ n ( z ) ∣ 2 d z is maximal over n n n ; in this case, the probability density ∫ ∣ ψ n ( z ) ∣ 2 d z \int|\psi_n(z)|^2 dz ∫ ∣ ψ n ( z ) ∣ 2 d z may be smaller than 1. For plot style separate, this LL index n n n and the probability density are displayed as LL = n n n and ∣ ψ L L ∣ 2 = value |\psi_{\mathrm{LL}}|^2 = \text{value} ∣ ψ LL ∣ 2 = value , respectively, for each state.
For the one-dimensional geometry, the wave functions ψ i ( z , y ) \psi_i(z,y) ψ i ( z , y ) depend on two spatial coordinates. The following plot styles can be used:
z: As function of z z z , at y = 0 y = 0 y = 0 (at the middle of the sample), i.e., ψ ( z , 0 ) \psi(z,0) ψ ( z , 0 ) . Like separate for 2D, the wave function is decomposed into orbitals.
y: Absolute-squared, as function of y y y , integrated over the z z z coordinate, i.e., ∣ ψ ∣ 2 ( y ) = ∫ ∣ ψ ( z , y ) ∣ 2 d z |\psi|^2(y) = \int|\psi(z,y)|^2 dz ∣ ψ ∣ 2 ( y ) = ∫ ∣ ψ ( z , y ) ∣ 2 d z . The wave function is decomposed into orbitals or subbands.
zy: Absolute-squared, as function of ( z , y ) (z,y) ( z , y ) , i.e., ∣ ψ ( z , y ) ∣ 2 |\psi(z,y)|^2 ∣ ψ ( z , y ) ∣ 2 , summed over all orbitals. The values ∣ ψ ( z , y ) ∣ 2 |\psi(z,y)|^2 ∣ ψ ( z , y ) ∣ 2 are represented as colours from a colour map.
color: Absolute-squared, with different colours for the orbitals, as function of ( z , y ) (z,y) ( z , y ) .
Examples are shown in Figure 12 . With kdotpy 1d, wave function output is possible only if the grid contains a single point. This restriction has been imposed to avoid problems with the large memory footprint needed given two spatial coordinates.
Figure 12. Examples of wave function plots from kdotpy 1d with (a) plotwf z, (b) plotwf y, (c) plotwf zy, and (d) plotwf color. These examples are based on the same eigenstate. The actual output contains the wave functions for multiple eigenstates.
Symmetry analysis and symmetrization
The point group symmetry of the crystal structure imposes symmetry constraints on the Hamiltonian. The band structure exhibits the symmetries of the Hamiltonian, and kdotpy provides a way to verify the symmetry properties, known as symmetry analysis .
In kdotpy, symmetry analysis is implemented as the member function DiagData.symmetry_test(). This function applies the following algorithm:
Define a symmetry transformation T T T , being a reflection, rotation, or roto-reflection of the point group. This object is implemented as instance of the VectorTransformation class.
If the eigenvalues are the same, compare the observables at k \mathbf{k} k and T k T\mathbf{k} T k . For scalar observables O O O , verify if O k = ± O T k O_{\mathbf{k}}=\pm O_{T\mathbf{k}} O k = ± O T k for all eigenstates. (Special consideration is given to degenerate states.) For vector observables O = ( O x , O y , O z ) O=(O_x,O_y,O_z) O = ( O x , O y , O z ) , for example ( j x , j y , j z ) (j_x,j_y,j_z) ( j x , j y , j z ) , verify if it transforms as one of the vector representations from the point group O h O_h O h .
In version 1.0 of kdotpy, the implementation is experimental, and may be improved in a future version.
The symmetrization feature of kdotpy works in the opposite direction: Knowing that the dispersion satisfies a set of symmetries, the dispersion can be calculated on some range of momentum space and be extended to a larger range of momenta, thus saving time compared to doing a calculation on the full range. For the momenta T k T\mathbf{k} T k obtained by symmetrization from the original grid points k \mathbf{k} k , the eigenvalues are copied from k \mathbf{k} k , and the observable values are calculated from those at k \mathbf{k} k with the appropriate transformation applied, given by a representation of the point group.
A common use case is the reflection around zero for a one-dimensional momentum scan in a two-dimensional geometry (kdotpy 2d),
kdotpy 2d 8o noax msubst CdZnTe 4% player HgCdTe 68% HgTe HgCdTe 68%
1layer 10 7 10 zres 0.25 k 0 0.6 / 60 kphi 45 erange -80 0 split 0.01
splittype isopz obs jz legend char out -jz outdir data-qw localminmax
symmetrize
where the eigenvalues and observable values for negative k \mathbf{k} k are obtained from those at − k -\mathbf{k} − k , see Figure 13 (a). (The observable O = ⟨ J z ⟩ O=\langle J_z\rangle O = ⟨ J z ⟩ is symmetric under this transformation.) A similar construct works for two-dimensional dispersions: The dispersion is calculated in the first quadrant (k x > 0 k_x>0 k x > 0 , k y > 0 k_y>0 k y > 0 in cartesian coordinates or k ϕ ∈ [ 0 ∘ , 90 ∘ ] k_\phi\in[0^\circ,90^\circ] k ϕ ∈ [ 0 ∘ , 9 0 ∘ ] for polar coordinates) and extended to all four quadrants, see Figure 13 (b).
Figure 13. (a) Symmetrization of a one-dimensional momentum scan. The data for k < 0 k < 0 k < 0 are obtained by symmetrization from those at k > 0 k > 0 k > 0 . (b) Symmetrization of a two-dimensional dispersion in polar coordinates. The data has been calculated explicitly for angles k ϕ ∈ [ 0 ∘ , 90 ∘ ] k_{\phi} \in[0^\circ, 90^\circ] k ϕ ∈ [ 0 ∘ , 9 0 ∘ ] . Symmetrization extends it to the full circle.
Löwdin perturbation theory (BHZ-like models)
A substantial number of works in the field relies on the simplified model made famous by Bernevig, Hughes, and Zhang (BHZ) [39 ] . This effective model takes the four subband degrees of freedom ∣ E 1 ± ⟩ |E1\pm\rangle ∣ E 1 ± ⟩ , ∣ H 1 ± ⟩ |H1\pm\rangle ∣ H 1 ± ⟩ as its basis. This model is adequate for describing the topological phase transition in quantum wells as function of the well thickness d d d : At the critical thickness d c d_{\mathrm{c}} d c , the energetic positions of the electron-like subbands ∣ E 1 ± ⟩ |E1\pm\rangle ∣ E 1 ± ⟩ and the heavy-hole-like ∣ H 1 ± ⟩ |H1\pm\rangle ∣ H 1 ± ⟩ change. For d < d c d < d_{\mathrm{c}} d < d c , the device is trivially insulating and for d > d c d > d_{\mathrm{c}} d > d c , the device is a two-dimensional topological insulator that hosts the quantum spin Hall effect [39 ] that can be measured in a Hall bar geometry [12 ] .
Outside of the context of HgTe quantum wells with d ≈ d c d \approx d_{\mathrm{c}} d ≈ d c , the four-band BHZ model is often inadequate to describe the essential physics. However, similar models with a modified or extended basis may be useful in order to gain useful insight, in some cases. Although we do not advocate the use of these simplified models in subband basis, we have included the functionality to derive them so that they can be compared against the more accurate k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p models.
The method of projecting the k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p Hamiltonian onto a basis of subband states is known as Löwdin perturbation theory or quasi-degenerate perturbation theory [15 , 40 ] . The basis is a set of subband states at k = 0 \mathbf{k} = 0 k = 0 . The contributions from the other subband states (outside of the basis) and from k ≠ 0 \mathbf{k} \ne0 k = 0 are treated by perturbation theory. The result is an effective Hamiltonian in the chosen subband basis that is valid near k = 0 \mathbf{k} = 0 k = 0 .
In kdotpy, Löwdin perturbation theory is implemented up to second order in momentum. We use the framework of symbolic Hamiltonians (class SymbolicHamiltonian) that we also use for deriving Landau level Hamiltonians. The recipe is as follows:
Select the subband states that are treated perturbatively. The amount can optionally be specified from the command line. If it is not specified, all states confined in the quantum well are taken by default. (Deconfined states are not considered, because including them leads to unpredictable and unphysical results.) We label these states the ‘B states’. For the selection procedure, they are separated into ‘lower’ and ‘upper’ B states, i.e., with energies below and above those of the A states.
H ( 0 ) = diag ( E m ) . (128) H^{(0)} = \operatorname{diag}(E_m). \tag*{(128)} H ( 0 ) = diag ( E m ) . (128)
The matrix size is n A × n A n_{\mathrm{A}} \times n_{\mathrm{A}} n A × n A .
H m m ′ ( 1 ) = ⟨ ψ m ∣ H ∣ ψ m ′ ⟩ , (129) H^{(1)}_{mm'} = \langle\psi_m|H|\psi_{m'}\rangle, \tag*{(129)} H m m ′ ( 1 ) = ⟨ ψ m ∣ H ∣ ψ m ′ ⟩ , (129)
where H H H is the symbolic Hamiltonian. The resulting matrix H ( 1 ) H^{(1)} H ( 1 ) is an n A × n A n_A \times n_A n A × n A matrix containing the operators k ^ ± \hat{k}_{\pm} k ^ ± up to second order. The function SymbolicHamiltonian.hper1() returns a list of lists of SymbolicObject instances, representing the matrix elements H m m ′ ( 1 ) H^{(1)}_{mm'} H m m ′ ( 1 ) .
The construction of the second order perturbation term H ( 2 ) H^{(2)} H ( 2 ) is implemented in SymbolicHamiltonian.hper2(). As arguments, it takes the eigenvalues { E m } \{E_m\} { E m } and { E l } \{E_l\} { E l } of the A and B states, respectively, as well as the associated eigenvectors ∣ ψ m ⟩ \lvert\psi_m\rangle ∣ ψ m ⟩ and ∣ ϕ l ⟩ \lvert\phi_l\rangle ∣ ϕ l ⟩ . The second-order term is [15 ]
H m m ′ ( 2 ) = 1 2 ∑ l ⟨ ψ m ∣ H ∣ ϕ l ⟩ ⟨ ϕ l ∣ H ∣ ψ m ′ ⟩ ( 1 E m − E l + 1 E m ′ − E l ) , (130) H^{(2)}_{mm'} = \frac{1}{2}\sum_l \langle\psi_m|H|\phi_l\rangle\langle\phi_l|H|\psi_{m'}\rangle\left(\frac{1}{E_m-E_l}+\frac{1}{E_{m'}-E_l}\right), \tag*{(130)} H m m ′ ( 2 ) = 2 1 l ∑ ⟨ ψ m ∣ H ∣ ϕ l ⟩ ⟨ ϕ l ∣ H ∣ ψ m ′ ⟩ ( E m − E l 1 + E m ′ − E l 1 ) , (130)
where the index l l l of the sum runs over all B states. The result H ( 2 ) H^{(2)} H ( 2 ) is once more an n A × n A n_A \times n_A n A × n A matrix involving the operators k ^ ± \hat{k}_{\pm} k ^ ± . The function SymbolicHamiltonian.hper2() returns the matrix elements H m m ′ ( 2 ) H^{(2)}_{mm'} H m m ′ ( 2 ) , as a list of lists of SymbolicObject instances.
The result of this method is a SymbolicHamiltonian object, that encodes the operator sum
H L = H 0 L + H 0 , + L k ^ + + H 0 , − L k ^ − + H + + L k ^ + 2 + H − − L k ^ − 2 + H + − L k ^ + k ^ − + H − + L k ^ − k ^ + , (131) H^L = H^L_0 + H^L_{0,+}\hat{k}_+ + H^L_{0,-}\hat{k}_- + H^L_{++}\hat{k}_+^2 + H^L_{--}\hat{k}_-^2 + H^L_{+-}\hat{k}_+\hat{k}_- + H^L_{-+}\hat{k}_-\hat{k}_+, \tag*{(131)} H L = H 0 L + H 0 , + L k ^ + + H 0 , − L k ^ − + H ++ L k ^ + 2 + H −− L k ^ − 2 + H +− L k ^ + k ^ − + H −+ L k ^ − k ^ + , (131)
where the factors H 0 L H^L_0 H 0 L , H 0 , ± L H^L_{0,\pm} H 0 , ± L , etc. are n A × n A n_A \times n_A n A × n A matrices.
The submodule bhzprint outputs the result as a matrix in \LaTeX notation and compiles it if PDFLaTeX is available. An example result is shown in Figure 14 . The result is expressed in a notation that generalizes the notation of Ref. [39 ] . For a Löwdin perturbation similar to the BHZ model, i.e., two blocks of two subbands each, the configuration setting bhz_abcdm=true may be used in order to express the result in the canonical BHZ notation with coefficients A A A , B B B , C C C , D D D , and M M M . In verbose mode, kdotpy also writes the matrix elements H m m ′ L H^L_{mm'} H m m ′ L , and several intermediate results to standard output.
Figure 14. Example output of kdotpy with the bhz command line argument. This calculation is done for a quantum well of 11 nm thick H g 1 − x M n x T e \mathrm{Hg}_{1-x}\mathrm{Mn}_x\mathrm{Te} Hg 1 − x Mn x Te (x = 0.024 x=0.024 x = 0.024 ). This Löwdin perturbation uses the same basis as the canonical BHZ model of Ref. [39 ] . In the plot, the solid curves indicate the k ⋅ p \mathbf{k}\cdot\mathbf{p} k ⋅ p dispersion. The dotted curves are the bands calculated from the Löwdin Hamiltonian H L H^{\mathrm{L}} H L (here, equivalent to the BHZ Hamiltonian). The red and blue colours of the dotted curves separate the two blocks; here, they are degenerate. (The layout has been adjusted for reasons of illustration. The actual kdotpy output appears on two landscape A4 pages.)
Data output
Types of data
Output is produced by kdotpy in various formats that serve various (in part complementary) purposes.
Long-time storage: Scientific data must be maximally reproducible and is expected to be kept for a longer period of time. For this purpose, we use an XML-based data format, which contains both data and metadata.
Plots and CSV files are typically produced in pairs, with the CSV file containing exactly the data that is shown in the figure.
BHZ model
Basis: ∣ E 1 , + ⟩ , ∣ H 1 , + ⟩ , ∣ E 1 , − ⟩ , ∣ H 1 , − ⟩ \lvert E1,+\rangle,\lvert H1,+\rangle,\lvert E1,-\rangle,\lvert H1,-\rangle ∣ E 1 , + ⟩ , ∣ H 1 , + ⟩ , ∣ E 1 , − ⟩ , ∣ H 1 , − ⟩
Hamiltonian:
( E 1 + B 1 k 2 + G 1 B − i A 1 , 2 k + 0 0 i A 1 , 2 k − E 2 + B 2 k 2 + G 2 B 0 0 0 0 E 3 + B 3 k 2 + G 3 B i A 3 , 4 k − 0 0 − i A 3 , 4 k + E 4 + B 4 k 2 + G 4 B ) (132) \begin{pmatrix}
E_1+B_1k^2+G_1B & -iA_{1,2}k_+ & 0 & 0 \\
iA_{1,2}k_- & E_2+B_2k^2+G_2B & 0 & 0 \\
0 & 0 & E_3+B_3k^2+G_3B & iA_{3,4}k_- \\
0 & 0 & -iA_{3,4}k_+ & E_4+B_4k^2+G_4B \tag*{(132)}
\end{pmatrix} E 1 + B 1 k 2 + G 1 B i A 1 , 2 k − 0 0 − i A 1 , 2 k + E 2 + B 2 k 2 + G 2 B 0 0 0 0 E 3 + B 3 k 2 + G 3 B − i A 3 , 4 k + 0 0 i A 3 , 4 k − E 4 + B 4 k 2 + G 4 B (132)
with:
A 1 , 2 = 373 m e V n m A_{1,2}=373\ \mathrm{meV\,nm} A 1 , 2 = 373 meV nm , A 3 , 4 = 373 m e V n m A_{3,4}=373\ \mathrm{meV\,nm} A 3 , 4 = 373 meV nm , B 1 = 1794 m e V n m 2 B_1=1794\ \mathrm{meV\,nm^2} B 1 = 1794 meV n m 2 , B 2 = 502 m e V n m 2 B_2=502\ \mathrm{meV\,nm^2} B 2 = 502 meV n m 2 , B 3 = 1795 m e V n m 2 B_3=1795\ \mathrm{meV\,nm^2} B 3 = 1795 meV n m 2 , B 4 = 502 m e V n m 2 B_4=502\ \mathrm{meV\,nm^2} B 4 = 502 meV n m 2 ,
E 1 = − 49.34 m e V E_1=-49.34\ \mathrm{meV} E 1 = − 49.34 meV , E 2 = − 45.73 m e V E_2=-45.73\ \mathrm{meV} E 2 = − 45.73 meV , E 3 = − 49.36 m e V E_3=-49.36\ \mathrm{meV} E 3 = − 49.36 meV , E 4 = − 45.75 m e V E_4=-45.75\ \mathrm{meV} E 4 = − 45.75 meV ,
G 1 = 1.551 m e V / T G_1=1.551\ \mathrm{meV/T} G 1 = 1.551 meV/T , G 2 = 1.028 m e V / T G_2=1.028\ \mathrm{meV/T} G 2 = 1.028 meV/T , G 3 = − 1.553 m e V / T G_3=-1.553\ \mathrm{meV/T} G 3 = − 1.553 meV/T , G 4 = − 1.028 m e V / T G_4=-1.028\ \mathrm{meV/T} G 4 = − 1.028 meV/T .
Note: G G G factors are orbital contributions only.
Dispersion
XML files
The XML-format produced by kdotpy is a hierarchical data format originally designed for communication between different sessions of kdotpy, in particular for combining data sets with kdotpy merge. An important design principle to make this possible is maximum compatibility between different versions of kdotpy. The hierarchical nature of the XML format is well suited to achieve this goal. Reading the XML data is done by means of extracting the relevant tags. When a new type of data is added to the XML file (e.g., by a newer version of kdotpy), the new tag is simply ignored by older versions, and the XML file remains compatible.
The format includes a large number of metadata attributes, which is an important asset for reproducibility. The data file contains the following tags with metadata:
<info>: Information on the program. This tag contains the command line, information on the host (computer) and its operating system, and the version numbers of kdotpy (including the Git hash if available), Python, and the installed modules.
<configuration>: Configuration values.
<parameters>: All information in the PhysParams object, including the evaluated material parameters.
<options>: Options set on the command line. These are the values stored in the dict instance opts, which affects the calculations.
Especially the command line arguments and version numbers are essential for repeating a calculation. The metadata can also be used for filtering a large collection of data files by a certain attribute. The metadata are placed at the top of the file to allow for human inspection.
The actual data follows the metadata. The data in the DiagData object is serialized into the tag <dispersion> or <dependence variable="b">, in case of a dispersion and a magnetic-field dependence, respectively. In both cases, it contains the <vectorgrid> tag for the VectorGrid object. All data points (DiagDataPoint instances) are serialized as <momentum> (for dispersion) or variabledata (for magnetic-field dependence); they contain lists of the eigenenergies, band indices, Landau level indices, and observables.
Finally, the <extrema> tag is included for serialization of the BandExtremum. The serialization of further data container objects (e.g., DensityData) is scheduled for future versions of kdotpy.
CSV files
Data for further processing is saved in CSV files. The CSV (comma separated value) format is a universally understood lightweight format for storing one- or two-dimensional arrays of data. The workflow in kdotpy separates the composition (or preparation) of the data and writing it to a file. In the composition stage, kdotpy prepares a list or a dict instance, which contains a set of one-dimensional arrays of values, representing the columns. This data is passed to the writer function, together with formatting information and labels for each column. In some cases, a post-write function adds extra data to the file, e.g., extra rows with band labels.
We use a small number of common layouts of the data. The uniformity is a boon to both users and developers. Fewer layouts means less effort for external processing of the data. On the development side, there is less code to maintain. The following layouts are the most common ones:
Column-wise data: Each column in the table represents a property or quantity and each row represents another item. For example, in extrema.csv, there are columns for band index, band character, minimum or maximum, momentum, energy, and band mass; see Figure 15 (a) for an illustration. The column headers on the first row indicate the quantity, and units are included (optionally) on the second row.
Functions of one dimension: A set of functions f i ( x ) f_i(x) f i ( x ) is represented column-wise. The x x x values appear in the first column, and the subsequent columns represent f i ( x ) f_i(x) f i ( x ) . Examples: dos.csv [Figure 15 (b)], with DOS and IDOS as function of energy E E E (first column); dispersion-byband.csv [Figure 15 (c)], with the dispersion E i ( k ) E_i(k) E i ( k ) of many bands i i i as function of momentum k k k . The latter uses two columns, here with k k k and ϕ \phi ϕ in the polar coordinate system. The band indices and characters appear in two extra rows at the top; the position is configurable.
Figure 15. Examples of CSV output, as imported by a spreadsheet program. Some rows and columns have been hidden for clarity. (a) extrema.csv: Column-wise data, where each row lists the properties of a band extremum. The first and second row label the quantities and units. (b) dos.csv: The DOS and the IDOS as function of energy E E E . (c) dispersion-byband.csv: Dispersions E i ( k ) E_i(k) E i ( k ) , i.e., band energies as function of momentum. Each column represents a band. The bands are labelled by band index and character in the first and second row. (d) dispersion.bi.csv: Two-dimensional dispersion E ( k , ϕ ) E(k,\phi) E ( k , ϕ ) of a single subband.
Two-dimensional array: The data represents a function f ( x , y ) f(x,y) f ( x , y ) . The first row contains the values x x x and the first column contains the values y y y . The data f ( x , y ) f(x,y) f ( x , y ) starts at the second row and second column. The quantities and units for x x x are printed at the end of the first row and those for y y y at the end of the first column. The quantity and unit for f f f are at the end of the second row, i.e., the first data row. The first row and first column provides an extra label for the data. Examples: dispersion.bi.csv Figure 15 (d), which provides the dispersion E i ( k , ϕ ) E_i(k,\phi) E i ( k , ϕ ) for a single subband. The file is labelled with the band index i i i . This layout is also used frequently in LL mode for functions f ( B , E ) f(B,E) f ( B , E ) or f ( B , n ) f(B,n) f ( B , n ) , i.e., quantities as function of magnetic field B B B and energy or carrier density.
Three-dimensional array: Used for bulk dispersions E ( k x , k y , k z ) E(k_x,k_y,k_z) E ( k x , k y , k z ) (as well as for cylindrical and spherical coordinates). The third coordinate is inserted as the first column. The result is arranged as a stack of two-dimensional arrays.
At the time of composition, the data is arranged in columns. The composition functions also determines the formatting for the data, i.e., how numerical values are converted to strings. For several quantities X, the number of digits for numerical values can be set by configuration values table_X_precision. The composition function also takes care of the formatting of quantities and units in the headers. The result depends on the configuration settings table_X_style, with the following choices:
The composition functions call the general writer function tableo.write.write(). This function delegates the actual work to one of the following functions, depending on the value of the configuration value csv_style:
csvwrite(): Uses the csv module provided with Python. The default dialect is to use , as delimiter (separator between values), and " as quoting character. This writer is used if csv_style=csvinternal or if csv_style=csv and the Pandas package is not installed.
alignwrite(): Aligns the formatted strings in columns, using spaces as column separators and fill characters. The result is well suited for direct viewing in a text editor (with a monospace font). Importing it into a spreadsheet program is more tedious than with the other writers. This writer is slightly slower than csvwrite() due to the extra step needed for determination of the column widths. To use this writer, set csv_style=align.
pdwrite(): Uses the Pandas package to produce a CSV file. The data is first converted into a Pandas DataFrame object. The file is then produced by DataFrame.to_csv(). The result is very similar to csvwrite(), but slightly less flexible in terms of setting the numerical precision of floating-point values. This writer is used if csv_style=csvpandas or csv_style=csv, when Pandas is available.
More writers may be added in the future, depending on user request. After the work done by one of these three writers, tableo.write.write() may call the post-write functions write_axislabels(), for the quantities and units in the two- and three-dimensional array layout, and/or write_extraheader(), for the band labels (see Figure 15 (c), for example).
Graphics
For graphics, kdotpy uses the Matplotlib package with the pdf backend. This backend produces vector graphics, which delivers the highest quality with reasonable file sizes. (Rasterization is used with some
two-dimensional colour maps, which would lead to large files and long rendering times as pure vector graphics.)
The results are highly configurable. First of all, command-line arguments can be used to enable or disable plot elements, for example, legends, plot titles, and band character labels. Secondly, configuration options determine the plot geometry (sizes and margins), the colour scale being used, and the style of the axis labels, for example. Finally, Matplotlib provides a variety of customization options, named rcParams, that can be manipulated with style sheets. Matplotlib style sheets are supported by kdotpy, and can be loaded with the configuration value fig_matplotlib_style. The default style file kdotpy.mplstyle is provided with kdotpy and is copied to the ~/.kdotpy directory. The user may edit the default style file or provide additional style files.
We provide several representative examples of plots generated by kdotpy. Like with the CSV output, we use a small number of generic layouts for uniformity of the output and for maintainability. Commonly used plots are:
One-dimensional dispersion or magnetic-field-dependence plot: The function ploto.bands_1d() produces the typical visualization of a band structure or Landau level fan, as illustrated by Figure 16 (a) and (Figure 16 b) in the Introduction. The horizontal axis is a momentum or magnetic field component, and the vertical axis is energy E E E . When an observable is specified with the command line argument obs, it is used to colour the bands; depending on whether the observable is constant or variable, the band is plotted as a single line object with a flat colour or as a collection of line segments with variable colours. Optionally, the energy axis may be transformed to density n n n .
Figure 16. Examples of graphical output of kdotpy . (a) A one-dimensional dispersion plot for a quantum well device with 7 nm HgTe as the active layer. The plot visualizes the dispersions of many bands E ( i ) ( k ) E^{(i)}(k) E ( i ) ( k ) as function of momentum k k k . The colours encode the values of the observable ⟨ J z ⟩ \langle J_z\rangle ⟨ J z ⟩ . (b) Magnetic-field dependence of Landau levels, for the same system as in (a). (c) A two-dimensional dispersion plot E ( i ) ( k x , k y ) E^{(i)}(k_x,k_y) E ( i ) ( k x , k y ) for one of the surface states of a 3D topological insulator device (70 nm HgTe). The colour scale refers to energy E E E and the red value − 2 -2 − 2 at k = 0 k=0 k = 0 indicates a local minimum at that energy. (d) A dispersion plot in polar coordinates for the highest valence band state of the same system as (c). The colour scale refers to the observable ⟨ J z ⟩ \langle J_z\rangle ⟨ J z ⟩ . (e) Integrated density of states (also known as carrier density n n n ) corresponding to (a). The vertical axis is energy and aligns with the vertical axis of (a). (f) Landau fan with carrier density on the vertical axis, corresponding to the magnetic field dependence in (b). The colour scale is given by the Hall conductance σ H \sigma_{\mathrm{H}} σ H in units of e 2 / h e^2/h e 2 / h .
Two-dimensional dispersion: The function ploto.bands_2d() implements the visualization of dispersions E ( k x , k y ) E(k_x,k_y) E ( k x , k y ) or E ( k , ϕ ) E(k,\phi) E ( k , ϕ ) in cartesian or polar coordinates, respectively; see Figure 16 (c) and (Figure 16 d). The dispersions are represented as contour plots in a cartesian or polar coordinate system. The result is a multi-page PDF file, with one page for each band within the energy range. The colouring is done based on the observable given by the command-line argument obs; if this argument is omitted, the colour is based on energy.
Total (integrated) density of states: The functions ploto.dos() and ploto.integrated_dos() plot the DOS and IDOS, respectively, as stored in a DensityData instance. By default, the energy axis is vertical, and aligns with the vertical axis of dispersion plots. See Figure 16 (e) for an example.
Generic two-dimensional colour maps: The function ploto.density2d() provides the framework for generic two-dimensional density plots, where a function f ( x , y ) f(x,y) f ( x , y ) is represented by a colour map. The horizontal axis is typically momentum or magnetic field and the vertical axis is energy or density. The function ploto.density2d() is used for many quantities in the postprocess module, e.g., optical transitions and Hall plots, see Figure 16 (f).
Self-consistent Hartree method
The self-consistent Hartree method is an iterative solver of the Schrödinger equation and the one-dimensional Poisson equation4 . A simultaneous solution of the Schrödinger and Poisson equation cannot be found analytically. The iterative method aims at finding a self-consistent solution, solving the Schrödinger equation and the Poisson equation alternatingly. The physical picture is that the occupied eigenstates of the Hamiltonian induce a carrier density, leading to an electrostatic potential that in turn affects the Hamiltonian. We emphasize that this method applies to the 2D geometry only. The self-consistent Hartree method can be invoked by using selfcon on the command line for kdotpy 2d and kdotpy 1d.
Program Flow
The program flow of the iterative SelfConSolver is sketched in Figure 17 . After initializing the starting conditions of the solver, a starting potential is initialized. If no initial potential is provided and the user did not request to initialize the potential based on a uniform charge density or fixed background density, the first iteration starts with a flat potential. Next, the Hamiltonian including the Hartree potential is
Figure 17. Flowchart for the self-consistent Hartree part of kdotpy.
diagonalized and the resulting charge carrier density ρ ( z ) \rho(z) ρ ( z ) along the growth direction z z z is evaluated (see § 3.7.8 ). The Hartree potential V H ( z ) V_{\mathrm{H}}(z) V H ( z ) is then solved from the Poisson equation,
∂ z [ ε ( z ) ∂ z V H ( z ) ] = e ε 0 ρ ( z ) , (133) \partial_z\left[\varepsilon(z)\,\partial_z V_{\mathrm{H}}(z)\right] = \frac{e}{\varepsilon_0}\rho(z), \tag*{(133)} ∂ z [ ε ( z ) ∂ z V H ( z ) ] = ε 0 e ρ ( z ) , (133)
where ε ( z ) \varepsilon(z) ε ( z ) is the relative dielectric constant of the layers and ε 0 \varepsilon_0 ε 0 is the permittivity of the vacuum. The electric-field or potential boundary conditions can be specified for solving Eq. (133) , see Appendix § 10 .§ 7 for details. It is also possible to specify a fixed background density which is added to ρ ( z ) \rho(z) ρ ( z ) to model for example ionic cores from modulating doping.
In order to ensure better convergence, the solution of Eq. (133) is not directly used as a new potential in the next iteration. Instead, the potential V H ( i + 1 ) ( z ) V_{\mathrm{H}}^{(i+1)}(z) V H ( i + 1 ) ( z ) of iteration i + 1 i+1 i + 1 is calculated from the old potential V H ( i ) ( z ) V_{\mathrm{H}}^{(i)}(z) V H ( i ) ( z ) as
V H ( i + 1 ) ( z ) = V H ( i ) ( z ) + τ ( S [ V H ( i ) ] ( z ) − V H ( i ) ( z ) ) , (134) V_{\mathrm{H}}^{(i+1)}(z) = V_{\mathrm{H}}^{(i)}(z) + \tau\left(S[V_{\mathrm{H}}^{(i)}](z) - V_{\mathrm{H}}^{(i)}(z)\right), \tag*{(134)} V H ( i + 1 ) ( z ) = V H ( i ) ( z ) + τ ( S [ V H ( i ) ] ( z ) − V H ( i ) ( z ) ) , (134)
where S [ V H ( i ) ] S[V_{\mathrm{H}}^{(i)}] S [ V H ( i ) ] is the potential obtained from solving Eq. (133) with the eigenstates of H + V H ( i ) ( z ) H + V_{\mathrm{H}}^{(i)}(z) H + V H ( i ) ( z ) , and τ \tau τ is a number between 0 and 1. Viewing Eq. (134) as a discrete step in solving a differential equation, we can interpret the value τ \tau τ as a ‘virtual time step’. The initial time step is 0.9 by default, and can be adjusted by an additional numerical argument after selfcon.
Next, the history of potential differences V H ( i + 1 ) ( z ) − V H ( i ) ( z ) V_{\mathrm{H}}^{(i+1)}(z)-V_{\mathrm{H}}^{(i)}(z) V H ( i + 1 ) ( z ) − V H ( i ) ( z ) between iterations is checked for periodic orbits or chaotic oscillations. If either are detected, kdotpy can automatically reduce the time step in an attempt to ‘escape’ the periodic orbit or chaos and to reach convergence. An large initial time step leads to faster convergences but makes the solver more vulnerable to developing periodic orbits or chaotic oscillations.
Finally, the convergence criterion is checked by comparing the last potential difference to a predefined convergence threshold. If a satisfactory convergence has not yet been achieved, the above process loops again. Once convergence is accomplished, kdotpy continues with the rest of the program as if the selfcon options was not given but using the self-consistently calculated Hartree potential In case the maximum number of specified iterations is reached or an error occurs in the above process, kdotpy either exits with an error (by default) or continues with the rest of the program ignoring the error (if configured to do so).
The source file selfcon.py defines two separate classes SelfConSolver and selfConSolverLL for momentum and Landau level mode, respectively. The latter is derived from the former, where the differences lie in how the charge carrier densities are calculated (cf. § 3.7 ) and the fact that in the Landau level mode, a separate Hartree potential is calculated for each magnetic field value. Furthermore, as it is not possible to calculate the density up to arbitrarily low magnetic fields in a Landau level picture with a finite number of Landau levels, the potentials at the smallest fields are set equal to the first potential that can be calculated.
Two alternatives for calculating the density as function of z z z
kdotpy implements two different algorithms for calculating the charge carrier distribution ρ ( z ) \rho(z) ρ ( z ) along the growth axis z z z . The first method is the one sketched in Sec. 3.7.8, with the ‘naive’ assumption that ρ ( z ) \rho(z) ρ ( z ) is identically zero at the charge neutrality point. All states in a given band are either counted as pure holes or as pure electrons based on the position of the band relative to the charge neutrality point, i.e., whether the band index is negative or positive. This method was applied successfully to model modulation doping in thin HgTe quantum wells [3 ] . For larger thicknesses or strong Hartree potentials this method can fail, as it becomes difficult to clearly separate electron-like and hole-like states.
The second method avoids this problem: One applies full diagonalization, where one calculates all eigenstates of the Hamiltonian, and takes the top or bottom end of the energy spectrum as a reference for ρ ( z ) \rho(z) ρ ( z ) . In other words, all states are treated as a single carrier type and a suitable background density is subtracted (full-band envelope approach) [41 ] . It suffices to consider only the top of the spectrum and to calculate all conduction band eigenstates down to the charge neutrality point, plus a few valence band states in addition. (Taking the conduction band is computationally more efficient than the valence band, in view of the smaller number of states.) The subtracted density offset is
n o f f s e t = 2 n z Ω g r i d ( 2 π ) 2 Δ z , (135) n_{\mathrm{offset}} = 2n_z\frac{\Omega_{\mathrm{grid}}}{(2\pi)^2\Delta z}, \tag*{(135)} n offset = 2 n z ( 2 π ) 2 Δ z Ω grid , (135)
where n z n_z n z is the total number of z z z points and Ω g r i d \Omega_{\mathrm{grid}} Ω grid is the volume of the grid in k \mathbf{k} k -space over which the calculation is performed. For the Landau-level mode, the volumetric offset density is instead given by
n o f f s e t = n z [ ( n max + 1 ) + ( n max + 2 ) ] e B h 1 n z Δ z , (136) n_{\mathrm{offset}} = n_z \left[(n_{\max}+1)+(n_{\max}+2)\right]\frac{eB}{h}\frac{1}{n_z\Delta z}, \tag*{(136)} n offset = n z [ ( n m a x + 1 ) + ( n m a x + 2 ) ] h e B n z Δ z 1 , (136)
where n max n_{\max} n m a x is the maximum Landau level index (set by the command line argument llmax) and B B B is the magnetic field.
The full-band envelope approach not only considers the active carriers in the quantum well but also results in interface dipoles and side bumps at the model edges (see Figure 18 ). Note that the algorithm described in 3.11.1 keeps the total carrier density in the system constant, which includes these features. Hence the carrier density inside the quantum well will be different from the one specified by the argument cardens.
Figure 18. (a) Self-consistently calculated Hartree potential for a structure with 70 nm thick HgTe layer and (Hg,Cd)Te barriers. The total carrier density has been set as 0.004 nm− 2 ^{-2} − 2 . The boundary conditions are determined by imposing an electric field strength of 0.48 mV nm− 1 ^{-1} − 1 inside the bottom barrier. This calculation has been performed with the default setting selfcon_full_diag=true.
The implementation of the full-band approach is done by the SelfConSolver derived classes SelfConSolverFullDiag and SelfConSolverLLFullDiag for dispersion and Landau-level mode, respectively. By default, the full-band approached is used for the self-consistent Hartree method. To use the naive method, for gaining speed at the expense of becoming less physically sound, one may set the configuration value selfcon_full_diag=false.
Interpretation of the results
Due to the combination of diagonalization and integration (in the steps solving the Schrödinger and the Poisson equation, respectively), the iterative dynamics of V H ( i ) V_{\mathrm{H}}^{(i)} V H ( i ) as function of iteration step i i i is difficult to characterize and to predict. The convergence behaviour can depend sensitively on input parameters such as boundary conditions and the initial time step. If the solver converges, the result only represents a single solution, out of possibly many solutions. Whether the result is the most natural solution can only be determined by critical scrutiny.
When one relies on the self-consistent method, it is advisable to run the calculation multiple times with slightly different settings, in order to see if the algorithm is stable against such variations. The terminal output from kdotpy can also be a useful information source, especially for tracking convergence behaviour. To allow for systematic analysis of the iterative dynamics, the self-consistent solvers can provide debug output, with the internal state (carrier density ρ ( z ) \rho(z) ρ ( z ) and Hartree potential V H ( z ) V_{\mathrm{H}}(z) V H ( z ) ) being written to a CSV file at each iteration. A thorough systematic analysis of the self-consistent Hartree method is beyond the scope of this work and will be addressed elsewhere.
Installation
Prerequisites
kdotpy is packaged as a Python package that is intended to be installed using PIP. For installing kdotpy, you must have a working Python installation (version 3.9.0 or above) and an up-to-date version of PIP. When PIP installs kdotpy, it automatically checks if the packages numpy, scipy, and matplotlib are installed and have compatible versions. Packages that kdotpy depends on optionally may be installed manually with PIP.
If your Python installation already contains a variety of packages, the dependencies of the installed packages could potentially conflict with those of kdotpy. This problem may be avoided by installing kdotpy in a virtual environment, which is like a ‘sandbox’ where kdotpy and its dependencies do not interfere with other packages. The virtual environment can be created with python3 -m venv directoryname. After activating the virtual environment, you may now install kdotpy following any of the installation methods below. Consult the documentation of the Python venv module for more information5 .
Installation methods 2 and 3 below rely on git, which you must have installed in order for these methods to work. If you do not wish to use git, you may wish to use one of the other methods.
Download and installation
We list four methods for installing kdotpy. You can choose any one of them, but combining them is not recommended.
Using PIP, from the Python Package Index (PyPI):
python3 -m pip install kdotpy
Using PIP, from our Gitlab repository:
python3 -m pip install git+ssh://git@git.physik.uni-wuerzburg.de/kdotpy/kdotpy.git
Using git clone and installing it from your local copy:
git clone https://git.physik.uni-wuerzburg.de/kdotpy/kdotpy.git
python3 -m pip install ./kdotpy
Note that this clones the files into the subdirectory kdotpy of your current working directory.
Using a manual download and installing it from your local copy:
If you prefer to avoid the PyPI and git, then you can download a .zip or .tar.gz file from our Gitlab repository at https://git.physik.uni-wuerzburg.de/kdotpy/kdotpy [42 ] . Download the preferred file format from the dropdown menu under the ‘Code’ button. Unpack the files into an empty directory. Then use
python3 -m pip install ./directoryname
to install kdotpy, replacing ./directoryname by the appropriate directory name where you unpacked the files.
You may obtain version 1.0.0, the exact version discussed in this article, also from the Gitlab repository of this journal.
Installation for active developers
If you wish to make modifications to the kdotpy code, then it is recommended to use PIP’s -e option (short for –editable). This option dynamically links the package installation directory to the source files. If you change the source, you thus do not have to re-install the package. To use an editable install, use
git clone https://git.physik.uni-wuerzburg.de/kdotpy/kdotpy.git
python3 -m pip install -e ./kdotpy
If you intend to actively contribute to the project, you must change to a non-protected branch in order to be able to push your changes to the repository. (Where you are allowed to push depends on your membership role in our Gitlab project. The master branch is protected for all except the project owner. The journal repository shall not be used for development purposes.)
Testing the installation
If the install was successful, then entering
kdotpy version
on the command line should return the version number. If not, then something went wrong during the installation and you may wish to try one of the other methods. (This assumes that if you use a virtual environment, it has been set up and activated correctly.)
For testing the functionality of kdotpy, you can use
kdotpy test
for running the standardized tests. Note that the tests may take a few minutes to complete. They will generate output in the subdirectory test relative to where you start kdotpy test.
Usage
General remarks
kdotpy is designed as a standalone application. If you have followed the installation instructions above, you can simply run kdotpy from the command line, followed by the ‘subprogram’ label and further arguments. The first argument is always the subprogram, but the order of the following arguments is usually unimportant. (For an overview of the subprograms, see § 3.1.2 .) You can run kdotpy from any folder.
Alternatively, you can also use python3 -m kdotpy followed by the subprogram and further arguments. You can also import specific functions or submodules of kdotpy from other Python scripts or the interactive interpreter using from kdotpy import function. As we have designed kdotpy primarily as a command-line tool, such imports are not recommended for normal use.
Below, we provide detailed tutorials that describe how to set up a calculation in kdotpy step by step, and how to interpret the output. The curious user may also find the tests defined by kdotpy test useful; the command lines for these standardized tests can be extracted using kdotpy test showcmd.
Example calculation: Basic dispersion
Introduction
This basic tutorial describes a systematic manner to compose the command line from scratch, adding the necessary arguments step by step. As an example, we will calculate the dispersion of a 7 nm HgTe quantum well: We assume the substrate is Cd0.96 _{0.96} 0.96 Zn0.04 _{0.04} 0.04 Te and the barriers are Hg0.32 _{0.32} 0.32 Cd0.68 _{0.68} 0.68 Te. We will calculate the dispersion along the diagonal axis (110) and try to answer the following questions about the maxima of the dispersion at finite momentum in the valence band (also known as camel back ):
Where is the finite-momentum maximum in momentum and energy?
Do we have a direct or an indirect gap?
What is the orbital character at the finite-momentum maximum?
Setting it up step by step
We first have to determine the geometry and/or mode, defined by the number of translationally invariant dimensions. In this example, we have a ‘2D’ geometry, with momentum coordinates (k x k_x k x , k y k_y k y ). Thus, the appropriate subprogram to use here is kdotpy 2d.
kdotpy 2d
Next, we determine the number of orbitals in the model. This is usually eight orbitals, for which we use the option 8o. Alternatively 6o for six orbitals may be used. Let us also specify that we do not want to use the axial approximation by entering noax.
kdotpy 2d 8o noax
Let us now enter the substrate material and ‘layer stack’. We use msubst for the substrate material, mlayer for the layer materials and llayer for the layer thicknesses. We also enter the resolution of the discretization in the z z z direction with zres; 0.25 nm is a good value to start with.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68% llayer 10 7 10 zres 0.25
Note that we have taken the barriers to be 10 nm thick. Usually, even if the barriers are much larger in reality, setting the thickness to 10 nm gives an accurate representation of the dispersion while reducing calculation time. Note also how the materials are entered.
We define the parametrization of the momentum. Here, we take 60 points along the chosen momentum axis, symmetric around zero, with k -0.6 0.6 / 120. The (110) axis has a 45 degree angle with the k x k_x k x axis, hence we enter kphi 45.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45
If we would run this command, we already get a result, dispersion.pdf. It looks promising, but kdotpy indicates that there are a few problems:
Calculating bands (k=0)...
Warning (band_type): Unable to determine band character and/or number of
nodes for 50 eigenstates.
Possible causes: spin degeneracy not broken, nonzero potential,
one-dimensional geometry, etc.
1 / 1
ERROR (estimate_charge_neutrality_point): Failed, because E+ and/or E-
bands are missing
The assignment of band characters has failed because the spin degeneracy has not being broken. The band characters are used to determine the position of the charge neutrality point and the band indices, and if this fails this can lead to subsequent problems, especially with post-processing functions that rely on the band indices, like density of states. We avoid these problems by splitting the degeneracy with split 0.01. The value 0.01 (in meV) hardly ever needs to be changed.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45 split 0.01
With erange -80 0 we zoom in on the energy range of our interest. Moreover, let us choose a colour scale representing the orbital degree of freedom of the eigenstates. We set this by obs orbitalrgb. We also include the figure legend with legend. We add subband character labels with char.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45 split 0.01 erange -80 0
obs orbitalrgb legend char
We choose a label for the filenames with out -7nm and the target folder with outdir data-qw.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45 split 0.01 erange -80 0
obs orbitalrgb legend char out -7nm outdir data-qw
Note that if outdir is omitted, the files will end up in the subfolder data if it exists, and in the current folder otherwise.
Finally, we add the post-processing option extrema, which will gives us useful information about the extrema.
kdotpy 2d 8o noax msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 k -0.6 0.6 / 120 kphi 45 split 0.01 erange -80 0
obs orbitalrgb legend char out -7nm outdir data-qw extrema
Other than the subprogram kdotpy 2d, which must be at the beginning of the command line, the other command-line arguments may be added in any order.
Results and interpretation
After running this command, we will find the following files in the target output folder data-qw:
dispersion-7nm.pdf: The dispersions E ( k ) E(k) E ( k ) for all calculated eigenstates, see Figure 19 (a). The colours visualize the values of the observable(s) chosen with the option obs.
dispersion-7nm.csv: A csv file where all data points (momentum, energy) are given with the values of the observables. The points are ordered by momentum.
dispersion-7nm.byband.csv: A csv file with the band energies for each curve of dispersion-7nm.pdf, i.e., ordered by band.
extrema-7nm.csv: A csv file listing all the extremal values.
output-7nm.xml: The XML data file (see § 6.0.1 ) that can be read again by the subprograms kdotpy merge and kdotpy compare for the purpose of replotting and comparing data sets and that contains a large amount of metadata that can be used for diagnostics and reproducing the results later. Discarding this file is strongly discouraged.
Figure 19. (a) Dispersion of a 7 nm HgTe quantum well as shown by dispersion-7nm.pdf. The colours indicate orbital character, see the legend. At k = 0 k = 0 k = 0 , the band character labels are shown, where ‘±’ indicates that the states are approximately two-fold degenerate. (b) The properties of the extrema in extrema-7nm.csv. The maxima of the band with bindex = -1 are highlighted (highlighting added manually, for illustration). (c) In dispersion-7nm.csv, we find the observable values for all eigenstates that kdotpy has calculated. The state closest to the maximum at finite momentum has been highlighted. We read off the expectation values for the observables gamma6, gamma8h, and gamma8l to gain information on the orbital character at this point.
With these results, we can answer the questions above:
Where is the finite-momentum maximum in momentum and energy? — In the plot, we see that these maxima appear in the band with character E 1 ± E1\pm E 1 ± at k = 0 k = 0 k = 0 . We find the following data in extrema.csv, see Figure 19 (b). We find three maxima of the E 1 + E1+ E 1 + band, one at k = 0 k = 0 k = 0 (highlighted in blue) and two at finite k k k (highlighted in red), namely, at k = ± 0.463 n m − 1 k = \pm0.463\ \mathrm{nm}^{-1} k = ± 0.463 nm − 1 and E = − 40.1 m e V E = -40.1\ \mathrm{meV} E = − 40.1 meV . Since we have calculated along the (110) axis, with kphi 45, these points are located at k = ± 0.463 n m − 1 × ( cos 45 ∘ , sin 45 ∘ ) = ± ( 0.327 , 0.327 ) n m − 1 k = \pm0.463\ \mathrm{nm}^{-1} \times(\cos45^\circ, \sin45^\circ) = \pm(0.327, 0.327)\ \mathrm{nm}^{-1} k = ± 0.463 nm − 1 × ( cos 4 5 ∘ , sin 4 5 ∘ ) = ± ( 0.327 , 0.327 ) nm − 1 .
Do we have a direct or an indirect gap? — The maximum of the E 1 + E1+ E 1 + band at k = 0 k = 0 k = 0 lies at E = − 37.2 m e V E = -37.2\ \mathrm{meV} E = − 37.2 meV . The maxima at finite k k k are lower, so the global maximum is at k = 0 k = 0 k = 0 . The value bindex = -1 confirms that this is the highest valence band state. The H1− state with bindex
= 1 = 1 = 1 is the lowest conduction band state. It only has one minimum, at k = 0 k = 0 k = 0 and E = − 19.7 E = -19.7 E = − 19.7 meV. We find that the gap is direct (at k = 0 k = 0 k = 0 ) and its size is ∣ Δ ∣ = 17.5 |\Delta| = 17.5 ∣Δ∣ = 17.5 meV.
What is the orbital character at the finite-momentum maximum? — We extract this information from dispersion-7nm.csv that contains the values of the observables. The maximum is located at k = ± 0.463 n m − 1 k = \pm0.463\ \mathrm{nm}^{-1} k = ± 0.463 nm − 1 , so we check the states at the nearest value k = 0.46 n m − 1 k = 0.46\ \mathrm{nm}^{-1} k = 0.46 nm − 1 (as a first approximation). The band with bindex = -1 is the correct one. We could also identify it by energy. The orbital character is determined by the probability densities in the ∣ Γ 6 , ± 1 2 ⟩ |\Gamma_{6}, \pm\frac{1}{2}\rangle ∣ Γ 6 , ± 2 1 ⟩ , ∣ Γ 8 , ± 3 2 ⟩ |\Gamma_{8}, \pm\frac{3}{2}\rangle ∣ Γ 8 , ± 2 3 ⟩ , and ∣ Γ 8 , ± 1 2 ⟩ |\Gamma_{8}, \pm\frac{1}{2}\rangle ∣ Γ 8 , ± 2 1 ⟩ states, which is encoded by the observables gamma6, gamma8h and gamma8l, respectively. We thus find 0.8% Γ 6 \Gamma_{6} Γ 6 (‘electron or s orbital’), 50.4% Γ 8 H \Gamma_{8H} Γ 8 H (‘heavy hole’), and 48.7% Γ 8 L \Gamma_{8L} Γ 8 L (‘light hole’). We confirm in the dispersion plot that the colour at this position is approximately cyan, a mixture of 50% green and 50% blue.
Example calculation: Landau levels
Introduction
We set up a Landau-level calculation for the same structure as in Sec. 5.2. We aim to calculate the Landau levels up to B = 10 T B = 10\ \mathrm{T} B = 10 T and to answer the following questions, centred around the properties of the ‘lowest Landau levels’, i.e., those that border the band gap:
Which Landau levels are the ‘lowest’ ones?
What is the critical field B c B_c B c where the inversion of the lowest LLs is undone?
What orbital character do the states have at this crossing?
We set up the calculation step by step, reusing some of the steps of Sec. 5.2.
Setting it up step by step
First, we determine the subprogram. The geometry is 2D, and we use the Landau level formalism. We thus use
kdotpy ll
As before, we use the eight-orbital model. In order to speed up the calculation, let us use the axial approximation. For kdotpy ll, this is achieved by omitting noax.
kdotpy ll 8o
The layer stack parameters are the same as in Sec. 5.2.
kdotpy ll 8o msub st CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%\
llayer 10 7 10 zres 0.25
Next, we specify the grid for the magnetic field values. Let is choose 100 points with the upper limit 10 T. We could choose evenly spaced points (every 0.1 T with b 0 10 / 100, but for LL calculations, quadratic stepping is recommended. This is achieved by the ‘double slash’ notation
b 0 10 // 100
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%\
llayer 10 7 10 zres 0.25 b 0 10 // 100
Like in Sec. 5.2, we zoom in at the energy range erange -80 0 and we use split 0.01. This time, we also enter the diagonalization parameters explicitly. We choose the maximum LL index to be 20 using nll 20. For each LL index, we aim to get approximately 12 (subband) states. For this we need about 240 eigenvalues: neig 240. We also put the target energy for the diagonalization somewhere near the gap, which we know is at approximately −30 meV. Note, however, that if we put the target energy at that value, the E2± subbands might be out of range. These subbands are required for the determination of the charge neutrality point to work properly, so we put the target energy higher up, i.e., we put targetenergy 0. (For the same reason, we aim for 12 subband states instead of the minimally required number of 8.)
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 0 nll 20
neig 240 targetenergy 0
For colouring the states, let us choose a combination of Landau level index and total angular momentum. We set this by obs llindex.jz. Again, we include the figure legend with legend and the band characters with char.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 0 nll 20
neig 240 targetenergy 0 obs llindex.jz legend char
We choose a label for the filenames out -7nm-landau and the folder where the files should go outdir data-landau.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 0 nll 20
neig 240 targetenergy 0 obs llindex.jz legend char out -7nm-landau
outdir data-landau
Results and interpretation
After running this command, we get the following files in the folder data-landau:
bdependence-7nm-landau.pdf: A plot of the Landau level spectrum, i.e., the eigenenergies of the states ∣ n , b ⟩ |n,b\rangle ∣ n , b ⟩ as function of the magnetic field, see Figure 20 (a).
Figure 20. (a) The Landau level spectrum, bdependence-7nm-landau.pdf. The colours indicate the Landau level index n n n and the shade (brighter/darker) indicates the sign of ⟨ J z ⟩ \langle J_z\rangle ⟨ J z ⟩ , see the colour legend. (b) Screenshot of bdependence-7nm-landau.byband.csv which provides the energies of the ‘lowest’ Landau levels ∣ n , b ⟩ |n,b\rangle ∣ n , b ⟩ with ( n , b ) = ( − 2 , 1 ) (n,b)=(-2,1) ( n , b ) = ( − 2 , 1 ) and ( 0 , − 1 ) (0,-1) ( 0 , − 1 ) as a function of the magnetic field B B B (column A, labelled bz). (c) Screenshot of bdependence-7nm-landau.csv which contains the expectation values for all relevant observables for all states. In (b) and (c), some columns were hidden and the coloured highlights were added manually to lay emphasis on the lowest Landau level states near the crossing.
We can extract sufficient information to answer the questions above:
Which Landau levels are the ‘lowest’ ones? — Let us examine the plot of Figure 20 (a). The lowest LL index formally is − 2 -2 − 2 , but the actual lowest index differs by subband character. Let us focus on the H1± \pm ± and E1± \pm ± subbands, as these are the most relevant for the physics. The ‘± \pm ± ’ indicates the expectation value ⟨ J z ⟩ \langle J_z\rangle ⟨ J z ⟩ at zero momentum and zero magnetic field. This degree of freedom is encoded in the colour shading, see the legend: dark colours represent the + + + states (⟨ J z ⟩ > 0 \langle J_z\rangle> 0 ⟨ J z ⟩ > 0 ) and bright colours the − - − states (⟨ J z ⟩ < 0 \langle J_z\rangle< 0 ⟨ J z ⟩ < 0 ).
For H1+, dark colours emanating from ‘H1±’, we find that the lowest index is 1 (red colour); 0, −1, and −2 are missing.
For H1−, bright colours emanating from ‘H1±’, the baby-blue LL can be identified as index −2, so all indices are present for H1−.
For E1+, dark colours emanating from ‘E1±’, the lowest index is 0 (dark green).
For E1−, bright colours emanating from ‘E1±’, the lowest index is −1 (bright orange green).
These observations can be confirmed from the data in the csv files. The lowest LLs near the gap are thus (E1+, n = 0 n = 0 n = 0 ) and (H1−, n = − 2 n = -2 n = − 2 ).
What is the critical field B c B_{\mathrm{c}} B c where the inversion of the lowest LLs is undone? — In principle we could estimate this from Figure 20 (a), but we use one of the csv files in order to answer this question more precisely: In bdependence-7nm-landau.byband.csv, see Figure 20 (b), the bands are ordered in columns labelled by ( n , b ) (n,b) ( n , b ) in the first row, where n n n is the LL index and b b b is the band index. The band indices are counted for each LL separately, which makes intuition a bit tricky for the lowest LLs (n = − 2 , − 1 , 0 n = -2,-1,0 n = − 2 , − 1 , 0 ), but it is guaranteed that the LLs at the crossing have ( n , b ) = ( 0 , − 1 ) (n,b) = (0,-1) ( n , b ) = ( 0 , − 1 ) and ( − 2 , 1 ) (-2,1) ( − 2 , 1 ) respectively. The respective columns are highlighted. We find the crossing between 4.624 T and 4.761 T. Linear interpolation may be used as to obtain a more accurate value.
What orbital character do the states have at this crossing? — From bdependence-7nm-landau.csv, depicted in Figure 20 (c), we extract the orbital character from the respective states at B = 4.624 B = 4.624 B = 4.624 T (which lies closer to the actual crossing than B = 4.761 B = 4.761 B = 4.761 T. The desired information is encoded in the observables gamma6, gamma8h, and gamma8l for the two respective states there. The lowest LL coming from the E1+ band, ( n , b ) = ( 0 , − 1 ) (n,b) = (0,-1) ( n , b ) = ( 0 , − 1 ) , is a mixture of 49.4% Γ 6 \Gamma_6 Γ 6 , 46.7% Γ 8 L \Gamma_{8L} Γ 8 L , and 3.3% Γ 8 H \Gamma_{8H} Γ 8 H . We thus find that it is predominantly a J z = ± 1 2 J_z = \pm\frac{1}{2} J z = ± 2 1 state. The one from the H1− band is purely Γ 8 H \Gamma_{8H} Γ 8 H , and has ⟨ J z ⟩ = − 3 2 \langle J_z\rangle= -\frac{3}{2} ⟨ J z ⟩ = − 2 3 exactly.
Example calculation: Magneto-transport
Introduction
In the previous example calculation, we have set up a basic LL calculation. With some postprocessing in kdopy, we are able to extract much more useful information and simulate magneto-transport experiments. The key ingredients here are density of states (DOS) and Chern numbers (or Berry curvature). We will set up an example simulation, where we will address the following questions:
Which Landau levels are filled at the constant carrier density 2 × 10 11 c m − 2 2 \times10^{11}\ \mathrm{cm}^{-2} 2 × 1 0 11 cm − 2 ?
Do we see plateaus in the Hall resistance R x y R_{xy} R x y ?
Are there Shubnikov-de Haas (SdH) oscillations at low magnetic fields?
Can we simulate a Landau fan such that it resembles experimental data?
Setting up the simulation step by step
We take the the command line from § 8.3 as a starting point:
kdopy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange −80 0 nll 20
neig 240 targetenergy 0 obs llindex.jz legend char out −7nm-landau
outdir data-landau
We modify and add command line arguments as follows:
We change some parameters slightly for this calculation. We choose erange -60 40 instead of erange -80 0, in order to give a better view of the data. We increase the number of eigenvalues from neig 240 to neig 300, so that we obtain a sufficient number of states to view this energy range. We also change the output filenames and output folder.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -60 40 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char out -7nm-hall
outdir data-hall
In order to calculate the density of states, we add the options dos and localdos for calculating the total and local density of states, respectively. For the DOS, we use Gaussian broadening as in Ref. [3 ] , with a broadening width (standard deviation) σ ( B ) = σ 1 B [ T ] \sigma(B) = \sigma_1\sqrt{B}\,[\mathrm{T}] σ ( B ) = σ 1 B [ T ] with σ 1 = 0.5 m e V \sigma_1 = 0.5\,\mathrm{meV} σ 1 = 0.5 meV (see also Appendix § 11 .§ 9 ). The appropriate command is broadening gauss 0.5 sqrt, but this may be shortened to broadening 0.5; for kdotpy ll, gauss and sqrt are default settings for the broadening.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -60 40 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char out -7nm-hall
outdir data-hall dos localdos broadening 0.5
For calculating the Hall conductance, we need to calculate the Chern numbers and set its broadening correctly. We add chern to calculate the Chern numbers.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -60 40 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char out -7nm-hall
outdir data-hall chern dos localdos broadening 0.5
We replace broadening 0.5 by broadening 0.5 10% to set the broadening of the Hall conductance as function of energy to 10% of that of the carrier density (integrated density of states).
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -60 40 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char out -7nm-hall
outdir data-hall chern dos localdos broadening 0.5 10%
For convenience, one may also use the command shortcut hall, which is equivalent to chern dos localdos broadening 0.5 10%.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -60 40 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char out -7nm-hall
outdir data-hall hall
This command line is equivalent to the one in step 4.
For this calculation, the following configuration options are relevant:
Figure 21. (a) In the file bdependence-density.pdf, equal-density contours are overlaid on top of the magnetic field dependence plot, cf. Figure 20 (a). The thick line near − 20 m e V -20\,\mathrm{meV} − 20 meV is the charge neutral point n = 0 n = 0 n = 0 . Contours are drawn for each multiple of 1 × 10 11 c m − 2 1 \times10^{11}\,\mathrm{cm}^{-2} 1 × 1 0 11 cm − 2 for ∣ n ∣ ≤ 15 × 10 11 c m − 2 |n| \le15 \times10^{11}\,\mathrm{cm}^{-2} ∣ n ∣ ≤ 15 × 1 0 11 cm − 2 . The medium-thick lines are at odd multiples of 5 × 10 11 c m − 2 5 \times10^{11}\,\mathrm{cm}^{-2} 5 × 1 0 11 cm − 2 and the very thick lines are at multiples of 10 × 10 11 c m − 2 10 \times10^{11}\,\mathrm{cm}^{-2} 10 × 1 0 11 cm − 2 . (b) The plot in rxy-constdens-7nm-hall.pdf shows the simulated Hall resistance R x y ≡ 1 / σ H R_{xy} \equiv1/\sigma_H R x y ≡ 1/ σ H as function of magnetic field B B B for the constant density 2 × 10 11 c m − 2 2 \times10^{11}\,\mathrm{cm}^{-2} 2 × 1 0 11 cm − 2 . The dashed line indicates the classical Hall slope given by R x y = B / n e R_{xy} = B/ne R x y = B / n e . (c) The file dos-constdens-7nm-hall.pdf visualizes the density of states as function of magnetic field for a constant carrier density. (d) In dsigmah-dn-7nm-hall.pdf, we plot the derivative d σ H / d n d\sigma_H/dn d σ H / d n of the Hall conductance with respect to the carrier density n n n . This type of plot can easily be compared to plots obtained from experiments which measure Hall conductance as function of magnetic field and gate voltage. The figures (b) and (c) are single pages in a multipage PDF unless cardens has been used in order to specify a single density. For this figure, we have used the configuration settings dos_unit=cm, dos_energy_points=1000, and berry_ll_simulate=false.
dos_energy_points: The default energy resolution used for DOS calculations (etc.) is dos_energy_points=1000, which is usually is a good compromise between accuracy and computation time. If the value is insufficiently large, one may see visible artifacts, like jagged equal-density lines where one would expect smooth curves. If that is the case, one should increase this value.
berry_ll_simulate: By default (berry_ll_simulate=false), the plots related to Hall conductance are extracted from the calculated Chern numbers (Berry curvature), stored as the observable chern. When the number of states, set by command-line argument neig, is not sufficient, some values are inaccurate or incorrect; see § 3.5.3 for a detailed discussion. In bad cases, this renders the data to be partially or completely unusable. One can mitigate this problem by setting berry_ll_simulate=true. In this case, the output functions use a simulated Chern number, which is exactly 1 for all Landau-level eigenstates and is stored as the observable chernsim. This value coincides with the calculated Chern number (up to numerical error) for almost all states, except for states the edges if the spectrum, which should usually be mistrusted anyway. If berry_ll_simulate=true, the output file names will be changed by insertion of sim or simul in order to be able to easily spot whether the calculated or simulated Chern numbers have been used. It is recommended to run kdotpy with both settings and to compare the results at least once in order to get an intuition for the implications of this setting and for the physics behind it.
The configuration values may be set permanently with
kdotpy config ’dos_unit=cm;dos_energy_points=1000;berry_ll_simulate=true’
or used once by appending
config ’dos_unit=cm;dos_energy_points=1000;berry_ll_simulate=true’
to the command line that starts kdotpy ll.
Results and interpretation
The above commands produce many pdf and csv files, and here we shall only discuss the ones relevant for answering the questions above. In most cases, the pdf is accompanied by a csv file which contains exactly the data shown in the figure.
Which Landau levels are filled at the constant carrier density 2 × 10 11 c m − 2 2 \times10^{11}\ \mathrm{cm}^{-2} 2 × 1 0 11 cm − 2 ? — The answer to this question of course depends on the magnetic field. It is encoded in the file bdependence-density.pdf, see Figure 21 (a), which is generated when kdotpy ll is used with the dos option. Equal-density contours are overlaid onto the magnetic-field dependence plot, (LL energies as function of magnetic field B B B ). In Figure 21 (a), we find the equal-density curve for n = 2 × 10 11 c m − 2 n = 2 \times10^{11}\ \mathrm{cm}^{-2} n = 2 × 1 0 11 cm − 2 to be at approximately 20 m e V 20\ \mathrm{meV} 20 meV for low magnetic fields. A different visualization may be obtained by adding cardens 0.002 to the command line, in which case only the contour line for the given carrier density (0.002 n m − 2 = 2 × 10 11 c m − 2 0.002\ \mathrm{nm}^{-2} = 2 \times10^{11}\ \mathrm{cm}^{-2} 0.002 nm − 2 = 2 × 1 0 11 cm − 2 ) is shown.
Do we see plateaus in the Hall resistance R x y R_{xy} R x y ? — The Hall resistance is shown in the plot rxy-contsdens-7nm-hall.pdf, see Figure 21 (b). We find plateaus corresponding to the filling factors ν = 1 , 2 , … \nu= 1,2,\ldots ν = 1 , 2 , … . At higher filling fractions (lower magnetic fields), the plateau transitions are more washed out due to the broadening. Here, the curve tends more towards the classical value R x y = B / n e R_{xy} = B/ne R x y = B / n e , indicated by the dashed line. This type of visualization can be compared directly to experimental results. For completeness, kdotpy also generates the plot sigmaH-contsdens-7nm-hall.pdf, which shows the Hall conductance σ H \sigma_H σ H as function of magnetic field for constant carrier density. In both cases, these output files correspond to the density specified by cardens, if this argument is provided on the command-line. Otherwise, the output will be multi-page PDFs with multiple densities, namely integer multiples of 1 × 10 11 c m − 2 1 \times10^{11}\ \mathrm{cm}^{-2} 1 × 1 0 11 cm − 2 .
Are there Shubnikov-de Haas (SdH) oscillations at low magnetic fields? — The constant-carrier-density curves in Figure 21 (c) clearly show oscillations with magnetic field. The plot shows density of states, which is thought to correlate with the longitudinal resistance R x x R_{xx} R xx . The red markers at the bottom indicate the values of 1 / B 1/B 1/ B equal to integer multiples of e / h n e/h n e / hn , where n n n is the carrier density. The minima of the density of states thus align well with the multiples of e / h n e/h n e / hn for B ≳ 1 T B \gtrsim1\ \mathrm{T} B ≳ 1 T . At lower fields, the resolution of B B B values is insufficient to make any conclusive statement. This may easily be mitigated by an additional calculation at lower fields, for example with b 0 1 / / 100.
Can we simulate a Landau fan such that it resembles experimental data? — In magneto-transport experiments, Landau fans are obtained by measuring R x y \mathrm{R}_{xy} R x y while sweeping the gate voltage for many values of the magnetic field. This yields R x y \mathrm{R}_{xy} R x y as function of magnetic field B \mathbf{B} B and gate voltage V g V_{\mathrm{g}} V g . In simulations, however, the natural quantity on the ‘vertical axis’ is energy. The DOS calculation in kdotpy bridges this gap: The relation of carrier density n n n as function of energy E E E can be reversed as to obtain a spectrum as function of density. The latter often correlates approximately linearly with gate voltage V V V , so that comparison between the two is physically meaningful. In Figure 21 (d), we visualize the plateau transitions by taking the derivative d σ H / d n \mathrm{d}\sigma_{\mathrm{H}}/\mathrm{d}n d σ H / d n in order to highlight the plateau transitions. This method is also customarily applied to experimental data.
Example calculation: Optical transitions
Introduction
Instead of extracting information on magneto-transport experiments in postprocessing, we can also simulate magneto-optical transition spectra in kdotpy. We will use an example simulation to answer the following questions:
Setting up the simulation step by step
Again, we take the the command line from § 8.3 as a starting point:
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 0 nll 20
neig 240 targetenergy 0 obs llindex.jz legend char out -7nm-landau
outdir data-landau
We modify and add command line arguments as follows:
As for the magneto-transport analysis, we slightly adjust some parameters. We choose erange -80 50 for a better view of the data. We increase the number of eigenvalues from neig 240 to neig 300 to get a sufficient number of states to view in this energy range. We also change the output filenames and output folder.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 50 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char
out -7nm-optical-transitions outdir data-optical-transitions
In order to calculate all optical transitions, we add the option transitions.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 50 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char
out -7nm-optical-transitions outdir data-optical-transitions transitions
It is also advisable to filter transitions by state occupancy, since a transition can only be observed if the initial state is (partially) occupied while the final state is (partially) unoccupied. Thus, we add the option cardens 0, assuming a charge neutral sample. (There is also the option to calculate filtered transitions for multiple carrier densities at once by using the input cardens # # / #, analogous to the range input for b.) Additionally, we also use the options dos and broadening 0.5. dos enables calculation of the (electro-)chemical potential, which is used to determine the occupation of states, while broadening applies a Gaussian square-root broadening to the
LL states (shortened, see § 8.4 ). Omitting broadening often leads to abrupt jumps in the (electro-)chemical potential, leading to unphysical gaps along specific transition features. Note, that broadening only is applied to DOS-related quantities, transition spectra will always be delta peaks.
Per default, these options suppress the output of all possible transitions.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25b 0 10 // 100 split 0.01 erange -80 50 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char
out -7nm-optical-transitions outdir data-optical-transitions transitions
cardens 0 dos broadening 0.5
Last, we change some configuration values using config. With transitions_max_deltae=80 we set the upper limit of the energy axis in the transition plot to 80 meV, while transitions_min_amplitude=3e11 filters out all transitions with transition matrix elements smaller than the given threshold, keeping only the most prominent transitions.
kdotpy ll 8o msubst CdZnTe 4% mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 7 10 zres 0.25 b 0 10 // 100 split 0.01 erange -80 50 nll 20
neig 300 targetenergy 0 obs llindex.jz legend char
out _7nm-optical-transitions outdir data-optical-transitions transitions
cardens 0 dos broadening 0.5
config ’transitions_max_deltae=80;transitions_min_amplitude=3e11’
The quantity that will be plotted in the transitions spectrum can be changed by using the configuration option plot_transitions_quantity. We will use the default value rate, plotting the rate density as defined in Eq. (121) . More information on this topic can be found in § 3.8.4 .
Results and interpretation
Using the commands above produces additional output files. This includes bdependence-transitions-7nm-optical-transitions.pdf, where all filtered transitions are drawn as vertical lines into the LL fan chart, and transitions-filtered-7nm-optical-transitions.pdf, together with its csv file, showing the filtered optical transitions spectrum. We will address the question given above by discussing the transitions spectrum in Figure 22 (a).
Figure 22. (a) The filtered transitions spectrum, transitions-filtered-7nm-optical-transitions.pdf. The strength of each individual transition is indicated by the size and colour of its respective symbol. The blue arrow points towards the transition feature that extrapolates to the band gap energy at small magnetic fields, while the black arrow indicates the feature for which we want to find the involved LL states. Both were added in post-production and are normally not include in the plot. The screenshots on the right are taken from the transitions-filtered-7nm-optical-transitions.csv file. In (b) the data is filtered by the band indices B1 and B2, taking the values −1 and 1, respectively. For (c) data was filtered for magnetic fields B x ≥ 6 B_x \geq6 B x ≥ 6 T. The Landau level spectrum corresponding to this figure is the one shown in Figure 21 .
How large is the band gap of the system? — The interband transition between the highest valence and the lowest conduction subband at low magnetic fields extrapolates to the energetic value of the direct band gap, see e.g. Figure 21 (a). We suspect, that the transition feature marked with the blue arrow in Figure 22 (a) is this specific transition. To confirm this, we use the transitions-filtered-7nm-optical-transitions.csv file and filter the initial state B1 by highest valence subband and the final state B2 by lowest conduction subband. Per definition, these subbands, respectively, have the band index −1 and 1. The blue and green columns in Figure 22 (b) show these indices, while the red column shows the transition energies. The lowest calculated magnetic field b x b_x b x is 0.001 T and the corresponding transition energies deltaE are > 17.5 meV, confirming that this feature extrapolates to the same band gap as discussed in § 8.2 . For zero magnetic field all LLs in a subband are degenerate, thus, all transition energies would be identical (up to the artificial offset added by split).
What are the involved LL states for a specific transition? — We analyse the transition marked with the black arrow in Figure 22 (a) regarding which subbands and LL indices are involved. We use the same output file transitions-filtered-7nm-optical-transitions.csv and filter the magnetic field values b x b_x b x to be > 6 T, see Figure 22 (c), so that we can clearly distinguish this transition from other transitions at higher energies than shown in the plot. The marked columns are the initial (blue) and the final (green) LL (light) and band indices (dark). As can be seen, this transition is an intraband transition inside the subband with band index 1, which is the inverted subband H1. The respective LL indices of initial and final state are −2 and −1, hence the polarization of this transition corresponds to O + O_+ O + [see § 3.8 ].
What information regarding band ordering can we extract from the transition spectrum? — Continuing the analysis for the same transition, we discuss why it can only be observed at magnetic fields ≳ 5 \gtrsim5 ≳ 5 T. For that, we use the LL fan chart shown in the previous tutorial section Figure 21 , where the same sample was simulated. The relevant (electro-)chemical potential for the current case is the thick line near −20 meV, the charge neutral point. At magnetic fields slightly below 5 T the lowest LL band of H1 and E1 cross, reverting to a trivial band order, while simultaneously changing from completely unoccupied to fully occupied in the case of the H1 state (vice versa for the E1 state). This enables the corresponding intraband transition in the H1 subband, which we see in the transition spectrum. Consequently, we can indirectly identify the critical magnetic field, where the lowest LL states revert to trivial band order in the magneto-optical transition spectrum. The abruptness of the crossing is a consequence of the axial approximation, which we used here for illustrative purposes. In a more realistic picture, the non-axial and bulk-inversion asymmetric terms lead to an anticrossing instead.
Example calculation: Dispersions and wave functions of a 3D TI
Introduction
In thick layers of a band inverted material like HgTe, so called three-dimensional topological insulators , the transport properties are dominated by topological surface states. At an interface between materials with inverted and normally ordered bands, the band inversion induces eigenstates with a linear (two-dimensional Dirac) dispersion, confined to the interface [43 ] . The physics is markedly different from those of narrow quantum wells (see § 8.2 ), where instead the strong confinement in the z z z direction leads to the inversion of subbands.
In this usage example, we investigate the key features of a 3D topological insulator by analyzing the dispersions and wave functions. We try to answer the following questions:
Setting it up step by step
Despite the system being called ‘3D topological insulator’, the appropriate geometry is still 2D, because there is confinement in the z z z direction. We take the previous example, § 8.2 , and adjust the layer stack parameters msubst and llayer. We also use a different momentum and energy range. We raise the number of eigenvectors with neig 100, because there are more subbands due to weaker confinement in the z z z direction. We choose the observable z z z in order to see whether we can locate the surface states at the top and bottom interface.
kdotpy 2d 8o noax msubst CdTe mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 70 10 zres 0.25 k -0.3 0.3 / 120 kphi 0 split 0.01 erange -100 40
neig 100 obs z legend char out -70nm outdir data-3dti
We obtain the dispersion plot of Figure 23 (a). At E ≈ − 90 m e V E \approx-90\,\mathrm{meV} E ≈ − 90 meV , we observe the linear dispersions characteristic of a Dirac point. Between valence band and conduction bands (negative and positive energies, respectively), there are states bridging the gap. The gray colour indicates that the expectation values ⟨ z ⟩ ≈ 0 \langle z\rangle\approx0 ⟨ z ⟩ ≈ 0 for all states, which seemingly suggests absence of surface character. In order to diagnose this counterintuitive result, let us plot plot the wave functions at k = 0.14 n m − 1 k = 0.14\,\mathrm{nm}^{-1} k = 0.14 nm − 1 using plotwf separate 0.14.
Figure 23. (a) Dispersion of a 70 nm thick HgTe layer on a CdTe substrate, dispersion-70nm.pdf. The colours indicate the expectation value ⟨ z ⟩ \langle z\rangle ⟨ z ⟩ . Due to mirror symmetry z → − z z \to-z z → − z , ⟨ z ⟩ = 0 \langle z\rangle= 0 ⟨ z ⟩ = 0 for all states. (b) A wave function at k = 0.14 n m − 1 k = 0.14\,\mathrm{nm}^{-1} k = 0.14 nm − 1 and E ≈ 13.5 m e V E \approx13.5\,\mathrm{meV} E ≈ 13.5 meV . The solid curves indicate the real parts, the dashed curves the imaginary parts for each orbital component. (c) The dispersion with a degeneracy breaking potential (argument vinner 0.1). The surface character of the states in the gap and near the Dirac point is indicated by red and blue colour. States with bulk character are gray. (d) One of the surface states at k = 0.14 n m − 1 k = 0.14\,\mathrm{nm}^{-1} k = 0.14 nm − 1 and E ≈ 13.5 m e V E \approx13.5\,\mathrm{meV} E ≈ 13.5 meV . Clearly, the degeneracy is resolved. The angles on the right-hand side indicate the complex arguments in each orbital component.
kdotpy 2d 8o noax msubst CdTe mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 70 10 zres 0.25 k -0.3 0.3 / 120 kphi 0 split 0.01 erange -100 40
neig 100 obs z legend char out -70nm outdir data-3dti plotwf separate 0.14
We obtain two files with wave functions, i.e., at k = − 0.14 n m − 1 k = -0.14\,\mathrm{nm}^{-1} k = − 0.14 nm − 1 and at k = 0.14 n m − 1 k = 0.14\,\mathrm{nm}^{-1} k = 0.14 nm − 1 . In the latter file, let us look for one of the states at E ≈ 13.5 m e V E \approx13.5\,\mathrm{meV} E ≈ 13.5 meV , see Figure 23 (b). The wave function contains symmetric and antisymmetric components for different orbitals. In order to break the degeneracy due to the mirror symmetry in z z z direction, let us add a weak potential difference between top and bottom surface with vinner 0.1. This argument leads to an electrostatic potential consistent with a constant displacement field D = ϵ ( z ) E ( z ) \mathbf{D} = \epsilon(z)\mathbf{E}(z) D = ϵ ( z ) E ( z ) , such that the potential difference between top and bottom surface is 0.1 m e V 0.1\,\mathrm{meV} 0.1 meV .
kdotpy 2d 8o noax msubst CdTe mlayer HgCdTe 68% HgTe HgCdTe 68%
llayer 10 70 10 zres 0.25 k -0.3 0.3 / 120 kphi 0 split 0.01 erange -100 40
neig 100 obs z legend char out -70nm outdir data-3dti plotwf separate 0.14
vinner 0.1
Results and interpretation
After applying vinner 0.1 in order to break the mirror symmetry, we obtain dispersion−70nm.pdf and wfs−70nm_0.140_0.pdf as shown in Figure 23 (c) and (d). With these plots and the corresponding csv files, we can answer the questions above:
Can we identify the Dirac point and the surface states in the dispersion? — In Figure 23 (c), we find two pairs of linearly dispersing states, crossing at E ≈ − 89 m e V E \approx-89\,\mathrm{meV} E ≈ − 89 meV at zero momentum. The subband labels are E1± and L1±. The states emanating from the Dirac point have a distinct surface character as indicated by the red and blue colour (where the latter is poorly visible because the dispersions almost coincide).
These four Dirac states can be described by a massless two-dimensional Dirac Hamiltonian. We note that the Dirac model for the surface states is distinct from the BHZ model [39 ] , which has a different set of basis states, namely the E1± and H1± subbands; see also the example in § 8.2 .
The surface states seem to disappear into the bulk valence band for energies − 70 m e V ≤ E ≤ − 10 m e V -70\,\mathrm{meV} \le E \le-10\,\mathrm{meV} − 70 meV ≤ E ≤ − 10 meV approximately, due to hybridization with the bulk valence band. In the bulk gap (0 m e V ≤ E ≤ 20 m e V 0\,\mathrm{meV} \le E \le20\,\mathrm{meV} 0 meV ≤ E ≤ 20 meV approximately), the surface states cross the gap from valence to conduction band.
How well are the surface states confined? — The level of confinement can be extracted from the wave functions. In this example, we investigate one of the surface states in the bulk gap, at k = 0.14 n m − 1 \boldsymbol{k} = 0.14\,\mathrm{nm}^{-1} k = 0.14 nm − 1 and E ≈ 13.5 m e V E \approx13.5\,\mathrm{meV} E ≈ 13.5 meV . From the wave functions shown in Figure 23 (d), we estimate a characteristic ‘size’ of about 10–20 nm.
For a more rigorous value, we can take the file wfs-70nm_0.140_0.1.csv (depending on the configuration settings, this might be inside a tar or zip archive) and calculate ∣ ψ ∣ 2 ( z ) = ∑ i ∣ ψ i ∣ 2 ( z ) \lvert\psi\rvert^{2}(z) = \sum_i\lvert\psi_i\rvert^{2}(z) ∣ ψ ∣ 2 ( z ) = ∑ i ∣ ψ i ∣ 2 ( z ) , where i i i are the orbitals. We determine the characteristic length ξ \xi ξ by fitting ψ ( z ) ∼ e − z / ξ \psi(z) \sim\mathrm{e}^{-z/\xi} ψ ( z ) ∼ e − z / ξ . From approximating ξ − 1 ≈ ∂ z ln ( ∣ ψ ∣ 2 ) \xi^{-1} \approx\partial_z\ln(\lvert\psi\rvert^{2}) ξ − 1 ≈ ∂ z ln (∣ ψ ∣ 2 ) by a discrete derivative around z = 0 z = 0 z = 0 , we find ξ ≈ 7 n m \xi\approx7\,\mathrm{nm} ξ ≈ 7 nm . Note that the apparent discrepancy with the estimate below comes from the difference between ψ i ( z ) \psi_i(z) ψ i ( z ) and ∣ ψ ∣ 2 ( z ) \lvert\psi\rvert^{2}(z) ∣ ψ ∣ 2 ( z ) .
How much is the overlap between the surface states? — In order to estimate the overlap between the surface states at top and bottom surface, we calculate the integral of ∣ ψ ∣ ( z ) \lvert\psi\rvert(z) ∣ ψ ∣ ( z ) for z > 0 z > 0 z > 0 , for one of the surface states. We find ∫ 0 z max ∣ ψ ∣ 2 ( z ) ≈ 0.01 \int_{0}^{z_{\max}}\lvert\psi\rvert^{2}(z) \approx0.01 ∫ 0 z m a x ∣ ψ ∣ 2 ( z ) ≈ 0.01 by summing up the appropriate values in wfs-70nm_0.140_0.1.csv. We finally point out that the overlap and the confinement length are momentum dependent, so that for a complete picture of the physics, this analysis has to be repeated for other momenta.
What is the orbital content of the wave functions? — The data in Figure 23 (d) visualizes the wave function as ψ ( z ) ∑ i ψ i ( z ) ∣ i ⟩ \psi(z)\sum_i\psi_i(z)\lvert i\rangle ψ ( z ) ∑ i ψ i ( z ) ∣ i ⟩ , where ∣ i ⟩ \lvert i\rangle ∣ i ⟩ are the orbital basis functions (see Eq. (10) ). The curves being solid or dashed indicate the ψ i ( z ) \psi_i(z) ψ i ( z ) being real or imaginary. In many cases, the functions ψ i ( z ) \psi_i(z) ψ i ( z ) can be factorized as a complex constant e i ϕ i \mathrm{e}^{\mathrm{i}\phi_i} e i ϕ i times a real function f i ( z ) f_i(z) f i ( z ) . The angles in degrees in the right hand side of Figure 23 (d) indicate the complex arguments ψ i \psi_i ψ i . Thus, the wave function for this state can be written as
ψ ( z ) = f 1 , 2 ( z ) ( − ∣ 1 ⟩ − i ∣ 2 ⟩ ) + f 3 , 6 ( z ) ( ∣ 3 ⟩ − i ∣ 6 ⟩ ) + f 4 , 5 ( z ) ( i ∣ 4 ⟩ − ∣ 5 ⟩ ) + f 7 , 8 ( z ) ( i ∣ 7 ⟩ + ∣ 8 ⟩ ) (137) \psi(z) = f_{1,2}(z)(-\lvert1\rangle- \mathrm{i}\lvert2\rangle) + f_{3,6}(z)(\lvert3\rangle- \mathrm{i}\lvert6\rangle) + f_{4,5}(z)(\mathrm{i}\lvert4\rangle- \lvert5\rangle) + f_{7,8}(z)(\mathrm{i}\lvert7\rangle+ \lvert8\rangle) \tag*{(137)} ψ ( z ) = f 1 , 2 ( z ) ( − ∣ 1 ⟩ − i ∣ 2 ⟩) + f 3 , 6 ( z ) (∣ 3 ⟩ − i ∣ 6 ⟩) + f 4 , 5 ( z ) ( i ∣ 4 ⟩ − ∣ 5 ⟩) + f 7 , 8 ( z ) ( i ∣ 7 ⟩ + ∣ 8 ⟩) (137)
in terms of four real functions f i , i ′ ( z ) f_{i,i'}(z) f i , i ′ ( z ) , where components i i i , i ′ i' i ′ with identical shapes of the envelope function have been taken together pairwise.
Auxiliary scripts
kdotpy merge
The subprogram kdotpy merge imports multiple XML files and merges the result into a single data set and plots the result in a single dispersion or magnetic-field dependence plot. (Further postprocessing is not supported in version 1.0.0 of kdotpy.) The merging is done ‘horizontally’, i.e., data sets with different values of k \boldsymbol{k} k or B \boldsymbol{B} B ) as well as ‘vertically’, i.e., with data at the same values of k \boldsymbol{k} k and B \boldsymbol{B} B , but for example with respect to different target energies. The command-line syntax may be as simple as
kdotpy merge data/output.1.xml data/output.2.xml
Usually, additional options are provided, for example setting the output filenames and directory.
kdotpy merge bandalign -25 2 out .merged
outdir data-merged -- data/output.1.xml data/output.2.xml
The -- (double hyphen) symbol separates the input file names from the other options. It may be omitted if there is no potential confusion between the other options and the input file names. The command line option bandalign can be used to do or redo band alignment on the combined data set. Manually assisted realignment as described in § 3.6.4 is also supported.
For data integrity, kdotpy merge compares the physical parameters associated with the source data files (stored in the <parameter> tag). If values differ, it will show a warning as to inform the user that the data sets might not fit together. There is also a check on whether the grids of the data files are compatible, i.e., whether the combination of the grids can also be represented as a VectorGrid.
One of the important use cases of kdotpy merge is the ability to split up computationally demanding computations into more manageable pieces. For example, strip calculation with kdotpy 1d (which has a high RAM footprint) can be split up across multiple nodes of a high-performance computing cluster. Another boon of kdotpy merge is that incomplete data sets can be completed with just the missing data and using the already existing data to save calculation time. This situation may occur, for example, when one out of many cluster job fails, or when in hindsight the value of n e i g n_{\mathrm{eig}} n eig was set too low to cover the desired certain energy interval. In Refs. [4 ] and [6 ] , we have used this strategy for the strip calculations with kdotpy 1d, (with kdotpy versions v0.42 and v0.64, respectively6 . For the dispersion figures, 3–10 data sets were merged.
kdotpy compare
The subprogram kdotpy compare is similar to kdotpy merge, but it can take an arbitrary number of data files and merge them into multiple data sets, which can then be compared in a single plot. The command-line syntax is similar to kdotpy merge, however data sets must be separated using vs, as in the following example,
kdotpy compare data/output.1a.xml data/output.1b.xml vs data/output.2.xml
In this example, the first data set is constructed by merging the data from data/output.1a.xml and data/output.1b.xml, and the second data set is the single file data/output.2.xml. The two data sets are visualized with different markers and/or colours. It is also possible to enter more than two data sets. The syntax for extra options is similar to that of kdotpy merge.
kdotpy compare only handles one-dimensional dispersions and magnetic field dependence. It is primarily used for quick comparisons between two related systems, for example to study the effect of enabling or disabling a term in the Hamiltonian. It is also useful as a debugging tool.
kdotpy batch
The auxiliary subprogram kdotpy batch is a tool for running any of the calculation subprograms in batch mode, where many calculations are run in sequence, but with a variation in one or more parameters. The philosophy is similar to a shell (bash) script, but kdotpy batch may have a slightly more intuitive way of iterating over the parameters and it can handle runs in parallel.
The behaviour is best illustrated from an example command line,
kdotpy batch [opts] @x 5.0 9.0 / 4 @y [CdTe, HgTe, HgCdTe 68%] do kdotpy 2d 8o noax llayer 10 @x 10 mater HgCdTe 68% @y HgCdTe 68% out -@0of@@ ...
This kdotpy batch command runs iteratively the kdotpy subprogram after the argument do. Here, kdotpy 2d is run fifteen times, with @x replaced by the values 5.0, 6.0, 7.0, 8.0, and 9.0, and @y replaced by CdTe, HgTe, and HgCdTe 68%. The command syntax for ranges is the same as for the grid components, see § 3.2.3 . The special notations @0 and @@ denote a counter and the total value respectively, i.e., @0of@@ yields 1of15, 2of15, etc. All ‘@ variables’ defined before do may appear after do an arbitrary number of times. Curly brackets may be used (e.g., @{x}) if variables appear inside a longer string.
Multiple processes may run in parallel with the cpu and proc arguments, to be specified before do. These options also take into account the number of CPUs of each process, if it is given by the argument cpu after do. Another useful argument is dryrun, which prints the command lines that result from the ‘@ substitutions’, but does not execute the tasks.
In a batch calculation, the console output of the calculation scripts is written to the files stdout.1.txt, stdout.2.txt, etc. and stderr.1.txt, stderr.2.txt, etc., where the extension can be adjusted with the configuration values batch_stdout_extension and batch_stderr_extension. The kdotpy batch subprogram itself writes to the standard stdout and stderr streams. At the end of the batch run, kdotpy batch provides a status message that summarizes how many tasks were completed successfully.
kdotpy config
Whereas the user may edit the configuration file ~/.kdotpy/kdotpyrc directly, we also provide a command line tool kdotpy config, which can do the following simple operations on the configuration:
Multiple key and/or key=value can also be combined with a semicolon ;, for example
kdotpy config ’fig_lmargin=10;fig_rmargin=10;fig_hsize’
(In bash one must use single quotes because of the special meaning of ;.) The syntax is thus analogous to the config argument for the calculation subprograms, for example kdotpy 2d.
kdotpy test
The package includes a set of standardized tests that can be run with the command kdotpy test. The purpose of these tests is to catch errors during code development and to catch performance issues. Each standardized test is defined in kdotpy-test.py by a command line. Success or failure is determined by the exit code. The output (by default written into the subdirectory test relative to the current working directory) is not checked for errors and has to be inspected manually, if desired. After all tests have been attempted, a summary is printed to the terminal indicating success or failure and the time it took to run.
Currently, in kdotpy version 1.0, there are 19 standardized tests, labelled with the following test ids: 1d, 2d_cartesian, 2d_offset, 2d_orient, 2d_polar, 2d_qw, 2d_qw_2, 2d_qw_bia, 2d_selfcon, batch, bulk, bulk_3d, bulk_ll, ll_axial, ll_bia, ll_legacy, compare_2d, compare_ll, and merge. The full test suite may be run by typing
kdotpy test
To run only a selection (of one or more tests), one may add the test ids as arguments, for example
kdotpy test 2d_qw ll_axial
to run the specified ones only. The test suite may be interrupted with Ctrl-C.
The test suite supports the following extra commands:
In these commands, testids may be any sequence of test ids, or it may be omitted to apply the command to all 19 tests.
The tests are defined in kdotpy-test.py in a way that is compatible with the pytest package for automated testing. We have included automated testing with pytest into the CI/CD workflow in our Gitlab project.
Conclusion and outlook
This publication marks the public release of kdotpy as an open source software project. We release it with the expectation that kdotpy is beneficial to the research community. Conversely, the open source nature encourages input from the community as to improve and extend the project even further. It is our hope that interaction with the community will lead to new insights and new directions for the future development of kdotpy. We encourage our users to actively participate in the discussions in our Gitlab repository [42 ] or via other channels.
At the time of writing, we are already in the process of designing new features for future releases. Improved strain handling is scheduled to be included in an upcoming release in the near future. The treatment of electrostatics is currently undergoing continuous improvement, where in particular we are reconsidering the boundary conditions appropriate for several experimental setups. We will also add the necessary infrastructure for treatment of dopants in the material. We also expect to gain more experience with materials other than the built-in ones. In general, the future directions of kdotpy will also be influenced by input from new experimental results from transport and spectroscopy and by feedback and suggestions from our users.
Acknowledgements
We thank Domenico Di Sante, Giorgio Sangiovanni, Björn Trauzettel, Florian Goth, and Fakher Assaad for feedback and support at various stages of the project.
Author contributions W.B. designed the software package. W.B., F.B., C.B., and M.H. developed the source code, with W.B. acting as lead developer. W.B., F.B., C.B., L.B., M.H., and M.S. performed code review and benchmarks. W.B., C.F., S.S., L.-X.W., H.B., and L.W.M. provided input on the physics of quantum transport. F.B., C.B., L.B., M.H., M.S., and T.K. provided input on the physics of optical spectroscopy. W.B., J.B., and E.M.H. developed the theoretical model at the early stages of the project. W.B., T.K., and L.W.M. managed the project. The writing of the paper was led by W.B. with input from all authors.
Funding information We acknowledge financial support from the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) in the project SFB 1170 ToCoTronics (Project ID 258499086) and in the Würzburg-Dresden Cluster of Excellence on Complexity and Topology in Quantum Matter ct.qmat (EXC 2147, Project ID 39085490).
Implementation details
Parallelization
Basic method
The Python programming language was not designed with parallelization in mind. The global interpreter lock (GIL) is often considered (see, e.g., Ref. [44 ] ) as a major obstacle for running parallelized Python code. However, the multiprocessing module avoids this obstacle by running Python code in separate parallel subprocesses, such that each process is affected only by its own GIL.
In kdotpy, the multiprocessing module is used to parallelize iterative tasks of the form
data = [f(x, *f_args, **f_kwds) for x in vals]
where each call to the function f is an independent task. The main loop in kdotpy is the iterated diagonalization of the Hamiltonian over the momentum k k k and magnetic field B B B values of the grid. Due to the uniform nature of these tasks, this iteration lends itself well for parallelization.
In kdotpy, the function parallel_apply() in the parallel submodule facilitates parallelization over the diagonalization function by implementing the necessary boilerplate code around the multiprocessing.Pool object. The following code illustrates the recipe implemented in parallel_apply() (simplified compared to the actual code for the sake of illustration):
pool = multiprocessing.Pool(processes = num_processes)
output = [
pool.apply_async(f, args=(x,) + f_args, kwds = f_kwds) for x in vals
]
while True:
jobsdone = sum(1 for x in output if x.ready())
if jobsdone >= n:
break
print(f"{jobsdone} / {n}")
time.sleep(poll_interval)
data = [r.get() for r in output]
pool.close()
pool.join()
Here, the while loop, that runs in the parent process, is used for process monitoring by printing the number of completed tasks to standard output 7 . This loop runs one iteration every poll_interval seconds in the main process until all tasks are completed. The result data is collected before the pool is joined and closed.
Unfortunately, multiprocessing does not handle keyboard interrupts (pressing Ctrl-C to abort the program) and other signals properly out of the box. Thus, parallel_apply() contains additional code in order to handle these asynchronous events gracefully: Once a worker process is aborted or terminated, the parent process of kdotpy detects it and aborts the full calculation, including the remaining worker processes. If this is not done correctly, worker processes can become orphaned (i.e., detached from the parent process) and continue working even when the parent process no longer exists. These problems are mitigated by using a custom signal handler with parallel_apply().
Advanced method
The Task-Model framework is also built around the process pools of the multiprocessing module, but with a higher level of abstraction, that allows a more fine-grained control of how tasks are run. The kdotpy submodules tasks and models define the following classes that constitute this framework:
ModelX class: This class stores the ‘recipe’, analogous to a diagonalization function. For the different ‘models’ (1D, 2D, LL, etc.), a separate class is derived from the ModelBase class. It stores the steps of the recipe as a list of functions
self.steps = [
self.load_ddp,
self.construct_ham,
self.solve_ham,
self.post_solve
]
where self.load_ddp enables loading of a DiagDataPoint object, and self.construct_ham, self.solve_ham, and self.post_solve apply the construction of the Hamiltonian, application of the eigensolver, and the processing of eigenstates (i.e., the steps listed in § 3.4.2 ).
Task class: This class contains the functions self.worker_func, self.callback, and self.error_callback as well as references to the process or thread pool. The Task.run() method calls pool.apply_async(), where pool is either a process or a thread pool.
TaskManager class: The single instance of this class is responsible for initializing, managing, and joining the process or thread pool, somewhat similar to parallel_apply(). The primary job of the TaskManager is to send the tasks in the queue to the available CPU or GPU workers and to join if all tasks are completed. The handling of asynchronous events is also done by the TaskManager. The TaskManager class is derived from PriorityQueue from the queue module of Python.
The Task-Model framework has several benefits compared to parallel_apply(). Firstly, the ModelX classes can be derived from. The derived class does not need to redefine all steps, but only those one where it differs from its parent class. Secondly, the data points are split into subtasks, so that each subtasks can be executed where this is done most optimally (CPU or GPU). The added flexibility of the Task-Model framework comes with a small price: As a result of more overhead, the Task-Model framework is marginally slower than parallel_apply(), but the difference is often barely noticeable.
Density of states
Triangular IDOS element
In Eq. (101) , we have determined the fraction of the interval [ k i , k i + 1 ] [k_i,k_{i+1}] [ k i , k i + 1 ] where a linear function is below a certain value E E E . For two dimensions, the analogous problem would be considering a linearly interpolated function on a triangle in the two dimensional plane. Let us label the vertices 1, 2, 3, and assume the function values are e 1 , e 2 , e 3 e_1,e_2,e_3 e 1 , e 2 , e 3 with e 1 ≤ e 2 ≤ e 3 e_1 \le e_2 \le e_3 e 1 ≤ e 2 ≤ e 3 (without loss of generality). The momentum coordinates of the vertices are irrelevant. The interpolated function is given by
e ( u , v ) = e 1 + ( e 2 − e 1 ) u + ( e 3 − e 1 ) v = ( 1 − u − v ) e 1 + u e 2 + v e 3 (138) e(u,v)=e_1+(e_2-e_1)u+(e_3-e_1)v=(1-u-v)e_1+u e_2+v e_3 \tag*{(138)} e ( u , v ) = e 1 + ( e 2 − e 1 ) u + ( e 3 − e 1 ) v = ( 1 − u − v ) e 1 + u e 2 + v e 3 (138)
where ( u , v ) (u,v) ( u , v ) are scaled coordinates with 0 ≤ u ≤ 1 0 \le u \le1 0 ≤ u ≤ 1 , 0 ≤ v ≤ 1 0 \le v \le1 0 ≤ v ≤ 1 , and u + v ≤ 1 u+v \le1 u + v ≤ 1 , such that the vertices of the triangle correspond to ( u , v ) = ( 0 , 0 ) (u,v)=(0,0) ( u , v ) = ( 0 , 0 ) , ( 1 , 0 ) (1,0) ( 1 , 0 ) , and ( 0 , 1 ) (0,1) ( 0 , 1 ) . We are interested in the fraction f ( E ) f(E) f ( E ) of the triangle where e ( u , v ) < E e(u,v)<E e ( u , v ) < E . This can be found by finding the intersection points of the line e ( u , v ) = E e(u,v)=E e ( u , v ) = E with the sides of the triangle and calculating the area of the resulting polygon. The fraction f ( E ) f(E) f ( E ) is this area divided by 1 2 \frac{1}{2} 2 1 (the area of the full triangle), and is given by
f ( E ) = { 1 if E ≥ e 3 1 − ( E − e 3 ) 2 ( e 3 − e 2 ) ( e 3 − e 1 ) if e 2 ≤ E < e 3 ( E − e 1 ) 2 ( e 2 − e 1 ) ( e 3 − e 1 ) if e 1 ≤ E < e 2 0 if E < e 1 (139) f(E)=
\begin{cases}
1 & \text{if } E \ge e_3 \\
1-\frac{(E-e_3)^2}{(e_3-e_2)(e_3-e_1)} & \text{if } e_2 \le E < e_3 \\
\frac{(E-e_1)^2}{(e_2-e_1)(e_3-e_1)} & \text{if } e_1 \le E < e_2 \\
0 & \text{if } E < e_1
\end{cases} \tag*{(139)} f ( E ) = ⎩ ⎨ ⎧ 1 1 − ( e 3 − e 2 ) ( e 3 − e 1 ) ( E − e 3 ) 2 ( e 2 − e 1 ) ( e 3 − e 1 ) ( E − e 1 ) 2 0 if E ≥ e 3 if e 2 ≤ E < e 3 if e 1 ≤ E < e 2 if E < e 1 (139)
The conditions are such that the denominators are nonzero; for example, if e 2 = e 1 e_2=e_1 e 2 = e 1 , then the condition e 1 ≤ E < e 2 e_1 \le E < e_2 e 1 ≤ E < e 2 is never fulfilled.
The implementation in triangle_idos_element() takes as input the three-dimensional array e i , j , v e_{i,j,v} e i , j , v , where i , j i,j i , j label the elementary squares in momentum space, and v = 1 , 2 , 3 v=1,2,3 v = 1 , 2 , 3 labels the three vertices. It applies the following recipe.
The momentum space indices ( i , j ) (i,j) ( i , j ) are flattened to I I I . The result is a two-dimensional array e I , ν \mathbf{e}_{I,\nu} e I , ν of shape ( n k , 3 ) (n_k,3) ( n k , 3 ) , where n k = n k x n k y n_k=n_{k_x}n_{k_y} n k = n k x n k y is the number of elementary squares in momentum space.
Sort along the last axis so that e I , 1 ≤ e I , 2 ≤ e I , 3 e_{I,1}\leq e_{I,2}\leq e_{I,3} e I , 1 ≤ e I , 2 ≤ e I , 3 is satisfied for all I I I .
Evaluate f ( 1 ) = ( E − e I , 1 ) 2 / ( e I , 2 − e I , 1 ) ( e I , 3 − e I , 1 ) f^{(1)}=(E-e_{I,1})^2/(e_{I,2}-e_{I,1})(e_{I,3}-e_{I,1}) f ( 1 ) = ( E − e I , 1 ) 2 / ( e I , 2 − e I , 1 ) ( e I , 3 − e I , 1 ) and f ( 2 ) = 1 − ( E − e I , 3 ) 2 / ( e I , 3 − e I , 2 ) ( e I , 3 − e I , 1 ) f^{(2)}=1-(E-e_{I,3})^2/(e_{I,3}-e_{I,2})(e_{I,3}-e_{I,1}) f ( 2 ) = 1 − ( E − e I , 3 ) 2 / ( e I , 3 − e I , 2 ) ( e I , 3 − e I , 1 ) (see Eq. (A.2)) for all I I I and for all E E E in the energy range. At the points where the denominator vanishes, substitute 0. In both cases, the resulting arrays f1 and f2 are two-dimensional arrays of shape ( n k , n E ) (n_k,n_E) ( n k , n E ) , where n E n_E n E is the number of energy values in the energy range.
Evaluate the conditions E < e 1 E<e_1 E < e 1 , E < e 2 E<e_2 E < e 2 , and E < e 3 E<e_3 E < e 3 as the two-dimensional boolean arrays cond0, cond1, and cond2. Then evaluate f I ( E ) f_I(E) f I ( E ) as
f = np.where(cond0, zeros,
np.where(cond1, f1, np.where(cond2, f2, ones))
)
where zeros = np.zeros_like(f1) and ones = np.ones_like(f1). The output is an array of shape ( n k , n E ) (n_k,n_E) ( n k , n E ) , like all input arrays.
For all momenta indices I I I , where any e I , ν e_{I,\nu} e I , ν (ν = 1 , 2 , 3 \nu=1,2,3 ν = 1 , 2 , 3 ) is undefined (NaN), substitute f I ( E ) = 0 f_I(E)=0 f I ( E ) = 0 for all E E E .
Tetrahedral IDOS element
For three dimensions, we follow similar ideas to arrive at an expression for f ( E ) f(E) f ( E ) . Let the energy values at the vertices of an elementary tetrahedron be e 1 , 2 , 3 , 4 e_{1,2,3,4} e 1 , 2 , 3 , 4 , where e 1 ≤ e 2 ≤ e 3 ≤ e 4 e_1\leq e_2\leq e_3\leq e_4 e 1 ≤ e 2 ≤ e 3 ≤ e 4 . The interpolated function is given by e ( u , v , w ) = e 1 + ( e 2 − e 1 ) u + ( e 3 − e 1 ) v + ( e 4 − e 1 ) w e(u,v,w)=e_1+(e_2-e_1)u+(e_3-e_1)v+(e_4-e_1)w e ( u , v , w ) = e 1 + ( e 2 − e 1 ) u + ( e 3 − e 1 ) v + ( e 4 − e 1 ) w , with 0 ≤ u , v , w ≤ 1 0\leq u,v,w\leq1 0 ≤ u , v , w ≤ 1 and u + v + w ≤ 1 u+v+w\leq1 u + v + w ≤ 1 . The fraction of the tetrahedra (with volume 1 6 \frac{1}{6} 6 1 ) that satisfies e ( u , v , w ) < E e(u,v,w)<E e ( u , v , w ) < E is
f ( E ) = { 1 if E ≥ e 4 , 1 − ( E − e 4 ) 3 ( e 4 − e 3 ) ( e 4 − e 2 ) ( e 4 − e 1 ) if e 3 ≤ E < e 4 , ( E − e 1 ) 3 ( e 2 − e 1 ) ( e 3 − e 1 ) ( e 4 − e 1 ) − ( E − e 2 ) 3 ( e 2 − e 1 ) ( e 3 − e 2 ) ( e 4 − e 2 ) if e 2 ≤ E < e 3 and e 1 < e 2 , ( E − e 1 ) 2 ( e 3 − e 1 ) ( e 4 − e 1 ) ( 1 + e 3 − E e 3 − e 1 + e 4 − E e 4 − e 1 ) if e 2 ≤ E < e 3 and e 1 = e 2 , ( E − e 1 ) 3 ( e 2 − e 1 ) ( e 3 − e 1 ) ( e 4 − e 1 ) if e 1 ≤ E < e 2 , 0 if E < e 1 . (140) f(E)=
\begin{cases}
1 & \text{if } E\geq e_4,\\
1-\frac{(E-e_4)^3}{(e_4-e_3)(e_4-e_2)(e_4-e_1)} & \text{if } e_3\leq E<e_4,\\
\frac{(E-e_1)^3}{(e_2-e_1)(e_3-e_1)(e_4-e_1)}
-\frac{(E-e_2)^3}{(e_2-e_1)(e_3-e_2)(e_4-e_2)} & \text{if } e_2\leq E<e_3\text{ and }e_1<e_2,\\
\frac{(E-e_1)^2}{(e_3-e_1)(e_4-e_1)}
\left(1+\frac{e_3-E}{e_3-e_1}+\frac{e_4-E}{e_4-e_1}\right) & \text{if } e_2\leq E<e_3\text{ and }e_1=e_2,\\
\frac{(E-e_1)^3}{(e_2-e_1)(e_3-e_1)(e_4-e_1)} & \text{if } e_1\leq E<e_2,\\
0 & \text{if } E<e_1.
\end{cases} \tag*{(140)} f ( E ) = ⎩ ⎨ ⎧ 1 1 − ( e 4 − e 3 ) ( e 4 − e 2 ) ( e 4 − e 1 ) ( E − e 4 ) 3 ( e 2 − e 1 ) ( e 3 − e 1 ) ( e 4 − e 1 ) ( E − e 1 ) 3 − ( e 2 − e 1 ) ( e 3 − e 2 ) ( e 4 − e 2 ) ( E − e 2 ) 3 ( e 3 − e 1 ) ( e 4 − e 1 ) ( E − e 1 ) 2 ( 1 + e 3 − e 1 e 3 − E + e 4 − e 1 e 4 − E ) ( e 2 − e 1 ) ( e 3 − e 1 ) ( e 4 − e 1 ) ( E − e 1 ) 3 0 if E ≥ e 4 , if e 3 ≤ E < e 4 , if e 2 ≤ E < e 3 and e 1 < e 2 , if e 2 ≤ E < e 3 and e 1 = e 2 , if e 1 ≤ E < e 2 , if E < e 1 . (140)
In tetrahedral_idos_element(), the arrays defining f ( E ) f(E) f ( E ) are calculated analogous to those in triangle_idos_element() but with some additional intermediate steps to avoid recalculation of the products of ( e w − e v ) (e_w-e_v) ( e w − e v ) in the denominators. The conditions E < e 1 E<e_1 E < e 1 , E < e 2 E<e_2 E < e 2 , E < e 3 E<e_3 E < e 3 , and E < e 4 E<e_4 E < e 4 are applied as
f = np.ones_like(f1)
f[cond3] = f3[cond3]
f[cond2] = f2[cond2]
f[cond1] = f1[cond1]
f[cond0] = 0.0
which is equivalent to a sequence of calls to np.where(), but with a better performance for the larger arrays in three momentum dimensions.
NOTE: In the expression for f ( E ) f(E) f ( E ) with e 2 ≤ E < e 3 e_2\leq E<e_3 e 2 ≤ E < e 3 and e 1 < e 2 e_1<e_2 e 1 < e 2 , it is possible to factor out e 2 − e 1 e_2-e_1 e 2 − e 1 . Doing this yields
f ( 2 ) ( E ) = ( e 31 e 41 + e 41 ( e 3 − E ) + e 31 ( e 4 − E ) ) ( E − e 1 ) 2 + e 21 ( E − e 1 ) 3 − 3 e 21 e 31 e 41 ( E − e 1 ) + e 21 2 e 31 e 41 e 32 e 42 e 31 e 41 , (141) f^{(2)}(E)=\frac{(e_{31}e_{41}+e_{41}(e_3-E)+e_{31}(e_4-E))(E-e_1)^2+e_{21}(E-e_1)^3-3e_{21}e_{31}e_{41}(E-e_1)+e_{21}^2e_{31}e_{41}}{e_{32}e_{42}e_{31}e_{41}}, \tag*{(141)} f ( 2 ) ( E ) = e 32 e 42 e 31 e 41 ( e 31 e 41 + e 41 ( e 3 − E ) + e 31 ( e 4 − E )) ( E − e 1 ) 2 + e 21 ( E − e 1 ) 3 − 3 e 21 e 31 e 41 ( E − e 1 ) + e 21 2 e 31 e 41 , (141)
using the short-hand notation e v w = e v − e w e_{vw}=e_v-e_w e v w = e v − e w . Unlike Eq. (A.3), there is no factor e 2 − e 1 e_2-e_1 e 2 − e 1 in the denominator, hence it is valid for e 1 = e 2 e_1=e_2 e 1 = e 2 as well. If we substitute e 1 = e 2 e_1=e_2 e 1 = e 2 , we retrieve the expression for e 2 ≤ E < e 3 e_2\leq E<e_3 e 2 ≤ E < e 3 and e 1 = e 2 e_1=e_2 e 1 = e 2 of Eq. (A.3).
Charge neutrality point in symbolic Landau level mode
In dispersion mode and Landau level mode full, the charge neutrality point always lies between the bands with band indices − 1 -1 − 1 and 1 1 1 , by definition. In the Landau level mode sym, each state is characterized by a pair ( n , b ) (n,b) ( n , b ) of Landau level index n = − 2 , − 1 , 0 , … n=-2,-1,0,\ldots n = − 2 , − 1 , 0 , … and band index b b b , so that finding the charge neutrality point requires an extra step: For each state, we determine a universal band index u u u , equivalent to ordinary band indices in full Landau level mode, with the property that the charge neutrality point lies between the states with u = − 1 u=-1 u = − 1 and u = + 1 u=+1 u = + 1 .
The algorithm for finding the universal band indices is implemented in DiagDataPoint.get_ubindex() and proceeds as follows. The states in DiagDataPoint are sorted by eigenvalue. We define an array with ones for all states with band index b > 0 b>0 b > 0 and an array with ones where b < 0 b<0 b < 0 ,
pos = np.where(
bindex_sort > 0,
np.ones_like(bindex_sort),
np.zeros_like(bindex_sort)
)
neg = 1 - pos
The arrays are summed cumulatively from below and above, respectively,
npos = np.cumsum(pos)
nneg = neg.sum() - np.cumsum(neg)
The array of universal band indices is then simply the difference between the two cumulative sums
ubindex = npos - nneg
ubindex[ubindex <= 0] -= 1
where the nonpositive values have to be decreased by one in order to make sure that the integers u u u are nonzero. By definition, the resulting array is an increasing sequence as function of energy, and identical to that obtained from regular band indices in the Landau level mode full.
Solving Poisson’s equation
As already mentioned in § 3.2.7 , a way to incorporate electrostatic potentials into the Hamiltonian is by parsing a set of boundary conditions. This set is used to solve Poisson’s equation within the function solve_potential() in potential.py, for ‘static’ as well as self-consistent potentials (see § 3.2.7 and § 6.1 , respectively). For the remainder of this section we will refer to this potential as Hartree potential V H V_{\mathrm{H}} V H . It should be emphasized that V H V_{\mathrm{H}} V H parametrizes the potential energy of the carriers in the electrostatic potential, not the electric potential itself8 The Hartree potential V H V_{\mathrm{H}} V H satisfies Poisson’s equation
∂ z [ ε ( z ) ∂ z V H ( z ) ] = e ε 0 ρ ( z ) (142) \partial_z\left[\varepsilon(z)\partial_z V_{\mathrm{H}}(z)\right]=\frac{e}{\varepsilon_0}\rho(z) \tag*{(142)} ∂ z [ ε ( z ) ∂ z V H ( z ) ] = ε 0 e ρ ( z ) (142)
[identical to Eq. (133) ] with dielectric function/constant ε ( z ) \varepsilon(z) ε ( z ) , elementary charge e e e , vacuum permittivity ε 0 \varepsilon_0 ε 0 and spatial charge density ρ ( z ) \rho(z) ρ ( z ) . In the self-consistent case, as described in § 6.1 and § 3.7.8 , ρ ( z ) \rho(z) ρ ( z ) is extracted from all eigenvectors, whereas in the ‘static’ case ρ ( z ) = 0 \rho(z)=0 ρ ( z ) = 0 .
The generalized solution can be calculated by integrating twice over z z z , with generally different lower integration limits z a z_a z a for the first integration and z b z_b z b for the second. The first integral over Eq. (A.5) yields
ε ( z ) ∂ z V H ( z ) − ε ( z a ) ∂ z V H ( z a ) = e ε 0 ∫ z a z d z ′ ρ ( z ′ ) = e ε 0 [ I ρ ( z ) − I ρ ( z a ) ] (143) \varepsilon(z)\partial_z V_{\mathrm{H}}(z)-\varepsilon(z_a)\partial_z V_{\mathrm{H}}(z_a)=\frac{e}{\varepsilon_0}\int_{z_a}^{z} \mathrm{d}z'\,\rho(z')=\frac{e}{\varepsilon_0}\left[\mathcal{I}_{\rho}(z)-\mathcal{I}_{\rho}(z_a)\right] \tag*{(143)} ε ( z ) ∂ z V H ( z ) − ε ( z a ) ∂ z V H ( z a ) = ε 0 e ∫ z a z d z ′ ρ ( z ′ ) = ε 0 e [ I ρ ( z ) − I ρ ( z a ) ] (143)
where we use the shorthand notation I ρ ( z ) = ∫ 0 z d z ′ ρ ( z ′ ) \mathcal{I}_{\rho}(z)=\int_0^z \mathrm{d}z'\rho(z') I ρ ( z ) = ∫ 0 z d z ′ ρ ( z ′ ) . As this equation is valid for all z z z , it follows that
C ( z ) = ε ( z ) ∂ z V H ( z ) − e ε 0 I ρ ( z ) (144) \mathcal{C}(z)=\varepsilon(z)\partial_z V_{\mathrm{H}}(z)-\frac{e}{\varepsilon_0}\mathcal{I}_{\rho}(z) \tag*{(144)} C ( z ) = ε ( z ) ∂ z V H ( z ) − ε 0 e I ρ ( z ) (144)
is constant. We evaluate this constant at z = z a z = z_a z = z a , divide by ε ( z ) \varepsilon(z) ε ( z ) and integrate a second time to find the Hartree potential,
V H ( z ) = V H ( z b ) + e ε 0 ( ∫ 0 z d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z b d z ′ I ρ ( z ′ ) ε ( z ′ ) ) + C ( z a ) ( ∫ 0 z d z ′ 1 ε ( z ′ ) − ∫ 0 z b d z ′ 1 ε ( z ′ ) ) (145) V_{\mathrm{H}}(z) = V_{\mathrm{H}}(z_b) + \frac{e}{\varepsilon_0}\left(\int_0^z dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_b} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}\right) + C(z_a)\left(\int_0^z dz'\,\frac{1}{\varepsilon(z')} - \int_0^{z_b} dz'\,\frac{1}{\varepsilon(z')}\right) \tag*{(145)} V H ( z ) = V H ( z b ) + ε 0 e ( ∫ 0 z d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z b d z ′ ε ( z ′ ) I ρ ( z ′ ) ) + C ( z a ) ( ∫ 0 z d z ′ ε ( z ′ ) 1 − ∫ 0 z b d z ′ ε ( z ′ ) 1 ) (145)
We have written the integrals ∫ z b z \int_{z_b}^{z} ∫ z b z explicitly as ∫ 0 z − ∫ 0 z b \int_0^z-\int_0^{z_b} ∫ 0 z − ∫ 0 z b , which reflects the implementation in the code.
In order to find a unique solution, two boundary conditions need to be given, which fix V H V_{\mathrm{H}} V H or ∂ z V H \partial_z V_{\mathrm{H}} ∂ z V H (which can be interpreted as electric field) at specific z z z coordinates. The function solve_potential() takes the boundary conditions as a set of keyword arguments, namely a subset of values v1, v2, v3, dv1, dv2, and v12 and coordinates z1, z2, and z3. Out of the former set, only certain combinations of values may be set to a numerical value (the other being None); any other combination will cause a ValueError exception to be raised. The following combinations are valid:
dv1 and v1, with z1 as coordinate: ∂ z V H ( z 1 ) = ∂ V 1 \partial_z V_{\mathrm{H}}(z_1) = \partial V_1 ∂ z V H ( z 1 ) = ∂ V 1 and V H ( z 1 ) = V 1 V_{\mathrm{H}}(z_1) = V_1 V H ( z 1 ) = V 1 . The z z z coordinate for both boundary conditions is the same, thus z a = z b = z 1 z_a = z_b = z_1 z a = z b = z 1 .
V H ( z ) = V 1 + e ε 0 ( ∫ 0 z d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z 1 d z ′ I ρ ( z ′ ) ε ( z ′ ) ) + ( ε ( z 1 ) ∂ V 1 − e ε 0 I ρ ( z 1 ) ) ( ∫ 0 z d z ′ 1 ε ( z ′ ) − ∫ 0 z 1 d z ′ 1 ε ( z ′ ) ) . (146) \begin{aligned}
V_{\mathrm{H}}(z) &= V_1 + \frac{e}{\varepsilon_0}\left(\int_0^z dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}\right) \\
&\quad+ \left(\varepsilon(z_1)\,\partial V_1 - \frac{e}{\varepsilon_0}\mathcal{I}_{\rho}(z_1)\right)\left(\int_0^z dz'\,\frac{1}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{1}{\varepsilon(z')}\right). \tag*{(146)}
\end{aligned} V H ( z ) = V 1 + ε 0 e ( ∫ 0 z d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z 1 d z ′ ε ( z ′ ) I ρ ( z ′ ) ) + ( ε ( z 1 ) ∂ V 1 − ε 0 e I ρ ( z 1 ) ) ( ∫ 0 z d z ′ ε ( z ′ ) 1 − ∫ 0 z 1 d z ′ ε ( z ′ ) 1 ) . (146)
dv2 and v2, with z2 as coordinate: Analogous to case 1, using z a = z b = z 2 z_a = z_b = z_2 z a = z b = z 2 instead.
dv1 and v2, with z1 and z2 as coordinates: ∂ z V H ( z 1 ) = ∂ V 1 \partial_z V_{\mathrm{H}}(z_1) = \partial V_1 ∂ z V H ( z 1 ) = ∂ V 1 and V H ( z 2 ) = V 2 V_{\mathrm{H}}(z_2) = V_2 V H ( z 2 ) = V 2 . The z z z coordinates for both boundary conditions are different, thus z a = z 1 z_a = z_1 z a = z 1 and z b = z 2 z_b = z_2 z b = z 2 .
V H ( z ) = V 2 + e ε 0 ( ∫ 0 z d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z 2 d z ′ I ρ ( z ′ ) ε ( z ′ ) ) + ( ε ( z 1 ) ∂ V 1 − e ε 0 I ρ ( z 1 ) ) ( ∫ 0 z d z ′ 1 ε ( z ′ ) − ∫ 0 z 2 d z ′ 1 ε ( z ′ ) ) . (147) \begin{aligned}
V_{\mathrm{H}}(z) &= V_2 + \frac{e}{\varepsilon_0}\left(\int_0^z dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_2} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}\right) \\
&\quad+ \left(\varepsilon(z_1)\,\partial V_1 - \frac{e}{\varepsilon_0}\mathcal{I}_{\rho}(z_1)\right)\left(\int_0^z dz'\,\frac{1}{\varepsilon(z')} - \int_0^{z_2} dz'\,\frac{1}{\varepsilon(z')}\right). \tag*{(147)}
\end{aligned} V H ( z ) = V 2 + ε 0 e ( ∫ 0 z d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z 2 d z ′ ε ( z ′ ) I ρ ( z ′ ) ) + ( ε ( z 1 ) ∂ V 1 − ε 0 e I ρ ( z 1 ) ) ( ∫ 0 z d z ′ ε ( z ′ ) 1 − ∫ 0 z 2 d z ′ ε ( z ′ ) 1 ) . (147)
v1 and dv2, with z1 and z2 as coordinates: Analogous to case 3, using z a = z 2 z_a = z_2 z a = z 2 and z b = z 1 z_b = z_1 z b = z 1 instead.
v1 and v2, with z1 and z2 as coordinates: V H ( z 1 ) = V 1 V_{\mathrm{H}}(z_1) = V_1 V H ( z 1 ) = V 1 and V H ( z 2 ) = V 2 V_{\mathrm{H}}(z_2) = V_2 V H ( z 2 ) = V 2 . Only potential values are given. The solution is given by Eq. (A.8), but we cannot evaluate the constant C ( z a ) C(z_a) C ( z a ) directly, because the derivative ∂ z V H ( z a ) \partial_z V_{\mathrm{H}}(z_a) ∂ z V H ( z a ) is unknown. By setting z b = z 1 z_b = z_1 z b = z 1 and z = z 2 z = z_2 z = z 2 (or vice versa), we find that
C ( z a ) = V H ( z 2 ) − V H ( z 1 ) − e ε 0 ( ∫ 0 z 1 d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z 1 d z ′ I ρ ( z ′ ) ε ( z ′ ) ) ∫ 0 z 2 d z ′ 1 ε ( z ′ ) − ∫ 0 z 1 d z ′ 1 ε ( z ′ ) (148) C(z_a) = \frac{V_{\mathrm{H}}(z_2)-V_{\mathrm{H}}(z_1)-\frac{e}{\varepsilon_0}\left(\int_0^{z_1} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}\right)}{\int_0^{z_2} dz'\,\frac{1}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{1}{\varepsilon(z')}} \tag*{(148)} C ( z a ) = ∫ 0 z 2 d z ′ ε ( z ′ ) 1 − ∫ 0 z 1 d z ′ ε ( z ′ ) 1 V H ( z 2 ) − V H ( z 1 ) − ε 0 e ( ∫ 0 z 1 d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z 1 d z ′ ε ( z ′ ) I ρ ( z ′ ) ) (148)
By substitution of C ( z a ) C(z_a) C ( z a ) into Eq. (A.8), we thus find
V H ( z ) = V 1 + e ε 0 ( ∫ 0 z d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z 1 d z ′ I ρ ( z ′ ) ε ( z ′ ) ) + V 2 − V 1 − e ε 0 ∫ z 1 z 2 d z ′ I ρ ( z ′ ) ε ( z ′ ) ∫ z 1 z 2 d z ′ 1 ε ( z ′ ) ( ∫ 0 z d z ′ 1 ε ( z ′ ) − ∫ 0 z 1 d z ′ 1 ε ( z ′ ) ) . (149) \begin{aligned}
V_{\mathrm{H}}(z) &= V_1 + \frac{e}{\varepsilon_0}\left(\int_0^z dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}\right) \\
&\quad+ \frac{V_2 - V_1 - \frac{e}{\varepsilon_0}\int_{z_1}^{z_2} dz'\,\frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}}{\int_{z_1}^{z_2} dz'\,\frac{1}{\varepsilon(z')}}\left(\int_0^z dz'\,\frac{1}{\varepsilon(z')} - \int_0^{z_1} dz'\,\frac{1}{\varepsilon(z')}\right). \tag*{(149)}
\end{aligned} V H ( z ) = V 1 + ε 0 e ( ∫ 0 z d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z 1 d z ′ ε ( z ′ ) I ρ ( z ′ ) ) + ∫ z 1 z 2 d z ′ ε ( z ′ ) 1 V 2 − V 1 − ε 0 e ∫ z 1 z 2 d z ′ ε ( z ′ ) I ρ ( z ′ ) ( ∫ 0 z d z ′ ε ( z ′ ) 1 − ∫ 0 z 1 d z ′ ε ( z ′ ) 1 ) . (149)
v12 and v3, with z1, z2, and z3 as coordinates: V H ( z 2 ) − V H ( z 1 ) = V 12 V_{\mathrm{H}}(z_2) - V_{\mathrm{H}}(z_1) = V_{12} V H ( z 2 ) − V H ( z 1 ) = V 12 and V H ( z 3 ) = V 3 V_{\mathrm{H}}(z_3) = V_3 V H ( z 3 ) = V 3 . We
substitute C ( z a ) \mathcal{C}(z_a) C ( z a ) from Eq. (A.11) into Eq. (A.8) with z b = z 3 z_b = z_3 z b = z 3 , and obtain
V H ( z ) = V 3 + e ε 0 ( ∫ 0 z d z ′ I ρ ( z ′ ) ε ( z ′ ) − ∫ 0 z 3 d z ′ I ρ ( z ′ ) ε ( z ′ ) ) + V 12 − e ε 0 ∫ z 1 z 2 d z ′ I ρ ( z ′ ) ε ( z ′ ) ∫ z 1 z 2 d z ′ 1 ε ( z ′ ) ( ∫ 0 z d z ′ 1 ε ( z ′ ) − ∫ 0 z 3 d z ′ 1 ε ( z ′ ) ) . (150) V_{\mathrm{H}}(z) = V_3 + \frac{e}{\varepsilon_0} \left( \int_0^z \mathrm{d}z' \frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} - \int_0^{z_3} \mathrm{d}z' \frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')} \right)
+ \frac{V_{12} - \frac{e}{\varepsilon_0} \int_{z_1}^{z_2} \mathrm{d}z' \frac{\mathcal{I}_{\rho}(z')}{\varepsilon(z')}}{\int_{z_1}^{z_2} \mathrm{d}z' \frac{1}{\varepsilon(z')}} \left( \int_0^z \mathrm{d}z' \frac{1}{\varepsilon(z')} - \int_0^{z_3} \mathrm{d}z' \frac{1}{\varepsilon(z')} \right). \tag*{(150)} V H ( z ) = V 3 + ε 0 e ( ∫ 0 z d z ′ ε ( z ′ ) I ρ ( z ′ ) − ∫ 0 z 3 d z ′ ε ( z ′ ) I ρ ( z ′ ) ) + ∫ z 1 z 2 d z ′ ε ( z ′ ) 1 V 12 − ε 0 e ∫ z 1 z 2 d z ′ ε ( z ′ ) I ρ ( z ′ ) ( ∫ 0 z d z ′ ε ( z ′ ) 1 − ∫ 0 z 3 d z ′ ε ( z ′ ) 1 ) . (150)
In solve_potential() the NumPy arrays densz [ρ ( z ) \rho(z) ρ ( z ) ] and epsilonz [ε ( z ) \varepsilon(z) ε ( z ) ] first are integrated incrementally, yielding the arrays
int_densz = integrate_arr(densz) * dz
int_invepsilonz = integrate_arr(1. / epsilonz) * dz
which represent the integrals I ρ ( z ) \mathcal{I}_{\rho}(z) I ρ ( z ) and ∫ 0 z d z ′ 1 / ε ( z ′ ) \int_0^z \mathrm{d}z' 1/\varepsilon(z') ∫ 0 z d z ′ 1/ ε ( z ′ ) for each individual value of z z z . Subsequently, ∫ 0 z d z ′ I ρ ( z ′ ) / ε ( z ′ ) \int_0^z \mathrm{d}z' \mathcal{I}_{\rho}(z')/\varepsilon(z') ∫ 0 z d z ′ I ρ ( z ′ ) / ε ( z ′ ) is calculated as
int_dens_over_epsz = integrate_arr(int_densz / epsilonz) * dz
The value of the integrals at the chosen z z z coordinates (z 1 z_1 z 1 , z 2 z_2 z 2 , z 3 z_3 z 3 ) are evaluated by using np.interp(), e.g.,
int_dens_over_eps_z1, int_dens_over_eps_z2, int_dens_over_eps_z3 = \
np.interp([z1, z2, z3], zval, int_dens_over_epsz)
where zval is the array of z z z coordinates where the other arrays are defined. A similar evaluation is done for epsilonz, int_densz, int_invepsilon, followed by
int_dens_over_epsz_1_2 = int_dens_over_eps_z2 - int_dens_over_eps_z1
int_invepsilonz_1_2 = int_invepsilon_z2 - int_invepsilon_z1
Depending on the combination of boundary conditions, the corresponding solution is selected from the six cases given above. Taking case 1 (dv1 and v1) as example, the Hartree potential is then evaluated as
int_const = epsilon_z1 * dv1 - eovereps0 * int_dens_z1
vz = v1 + eovereps0 * (int_dens_over_epsz - int_dens_over_eps_z1)
+ int_const * (int_invepsilonz - int_invepsilon_z1)
where int_const is the integration constant C ( z a ) \mathcal{C}(z_a) C ( z a ) from Eq. (A.7). The implementations for the other cases are analogous.
The boundary conditions are chosen automatically by parsing command line arguments like vinner, vouter, vsurf or efield. In self-consistent calculations the automatically determined boundary conditions can be manually overwritten by using the command line argument potentialbc.
On a side note, one could also imagine solving the Poisson equation as a matrix equation involving the vector V H ( z i ) V_{\mathrm{H}}(z_i) V H ( z i ) on the grid of coordinates z i z_i z i , obtained by replacing the derivative operator by the appropriate matrix (cf. § 2.2.1 ). This results in a matrix-vector equation, which can be solved by matrix inversion. In the continuum limit (grid resolution Δ z → 0 \Delta z \to0 Δ z → 0 ), this method converges to the same solution as the numerical integration method detailed above. Our benchmarks show that the numerical integration method outperforms the matrix method within the context of kdotpy, with smaller numerical errors at finite resolutions Δ z \Delta z Δ z . We thus decided to include the numerical integration approach only.
Extrema
Nine-point extremum solver
The function nine_point_extremum_solver() takes a 3 × 3 3 \times3 3 × 3 grid of momentum values ( k x i ′ , j ′ , k y i ′ , j ′ ) (k_{x_{i',j'}}, k_{y_{i',j'}}) ( k x i ′ , j ′ , k y i ′ , j ′ ) values and a 3 × 3 3 \times3 3 × 3 grid of energy values e i ′ , j ′ e_{i',j'} e i ′ , j ′ as inputs. The indices i ′ i' i ′ and j ′ j' j ′ are taken as i ′ = i − 1 , i , i + 1 i' = i - 1, i, i + 1 i ′ = i − 1 , i , i + 1 and j ′ = j − 1 , j , j + 1 j' = j - 1, j, j + 1 j ′ = j − 1 , j , j + 1 , where i , j i,j i , j is a location where an extremum is detected: We say there is a minimum (maximum) at i , j i,j i , j if the values
e i + 1 , j , e i − 1 , j , e i , j + 1 , e i , j − 1 , e i + 1 , j + 1 , e i − 1 , j + 1 , e i + 1 , j − 1 , e i − 1 , j − 1 (151) e_{i+1,j}, e_{i-1,j}, e_{i,j+1}, e_{i,j-1}, e_{i+1,j+1}, e_{i-1,j+1}, e_{i+1,j-1}, e_{i-1,j-1} \tag*{(151)} e i + 1 , j , e i − 1 , j , e i , j + 1 , e i , j − 1 , e i + 1 , j + 1 , e i − 1 , j + 1 , e i + 1 , j − 1 , e i − 1 , j − 1 (151)
are all > e i , j > e_{i,j} > e i , j (< e i , j < e_{i,j} < e i , j ). If this is the case, the nine_point_extremum_solver() locates the extremum more precisely by fitting Eq. (125) to the input data. Assume that the momenta are aligned on an equally spaced cartesian grid, and define Δ x = k x , i + 1 − k x , i = k x , i − k x , i − 1 \Delta x = k_{x,i+1}-k_{x,i} = k_{x,i}-k_{x,i-1} Δ x = k x , i + 1 − k x , i = k x , i − k x , i − 1 and Δ y = k y , j + 1 − k y , j = k y , j − k y , j − 1 \Delta y = k_{y,j+1}-k_{y,j} = k_{y,j}-k_{y,j-1} Δ y = k y , j + 1 − k y , j = k y , j − k y , j − 1 . First calculate the coefficients of the Hessian matrix,
a = e i + 1 , j − 2 e i , j + e i − 1 , j 2 ( Δ x ) 2 , c = e i + 1 , j + 1 − e i − 1 , j + 1 − e i + 1 , j − 1 + e i − 1 , j − 1 4 Δ x Δ y , b = e i , j + 1 − 2 e i , j + e i , j − 1 2 ( Δ y ) 2 . (152) \begin{aligned}
a &= \frac{e_{i+1,j}-2e_{i,j}+e_{i-1,j}}{2(\Delta x)^2}, &\qquad
c &= \frac{e_{i+1,j+1}-e_{i-1,j+1}-e_{i+1,j-1}+e_{i-1,j-1}}{4\Delta x\Delta y},\\
b &= \frac{e_{i,j+1}-2e_{i,j}+e_{i,j-1}}{2(\Delta y)^2}. \tag*{(152)}
\end{aligned} a b = 2 ( Δ x ) 2 e i + 1 , j − 2 e i , j + e i − 1 , j , = 2 ( Δ y ) 2 e i , j + 1 − 2 e i , j + e i , j − 1 . c = 4Δ x Δ y e i + 1 , j + 1 − e i − 1 , j + 1 − e i + 1 , j − 1 + e i − 1 , j − 1 , (152)
We note that c c c is the only coefficient where the e i ± 1 , j ± 1 e_{i\pm1,j\pm1} e i ± 1 , j ± 1 appear; the other linear combinations of e i ± 1 , j ± 1 e_{i\pm1,j\pm1} e i ± 1 , j ± 1 are not considered. We calculate the auxiliary variables
X = e i + 1 , j − e i − 1 , j 2 Δ x , Y = e i , j + 1 − e i , j − 1 2 Δ y (153) X = \frac{e_{i+1,j}-e_{i-1,j}}{2\Delta x}, \qquad Y = \frac{e_{i,j+1}-e_{i,j-1}}{2\Delta y} \tag*{(153)} X = 2Δ x e i + 1 , j − e i − 1 , j , Y = 2Δ y e i , j + 1 − e i , j − 1 (153)
and use them to find the location ( k x , 0 , k y , 0 ) (k_{x,0}, k_{y,0}) ( k x , 0 , k y , 0 ) of the extremum in momentum space,
k x , 0 = k x , i + c Y − 2 b X 4 a b − c 2 , k y , 0 = k y , i + c X − 2 a Y 4 a b − c 2 . (154) k_{x,0}=k_{x,i}+\frac{cY-2bX}{4ab-c^2}, \qquad k_{y,0}=k_{y,i}+\frac{cX-2aY}{4ab-c^2}. \tag*{(154)} k x , 0 = k x , i + 4 ab − c 2 c Y − 2 b X , k y , 0 = k y , i + 4 ab − c 2 c X − 2 aY . (154)
The denominator 4 a b − c 2 4ab-c^2 4 ab − c 2 is the determinant of the Hessian matrix. If the location defined by Eq. (A.17) lies outside of the rectangle [ k x , i − 1 , k x , i + 1 ] × [ k y , j − 1 , k y , j + 1 ] [k_{x,i-1},k_{x,i+1}]\times[k_{y,j-1},k_{y,j+1}] [ k x , i − 1 , k x , i + 1 ] × [ k y , j − 1 , k y , j + 1 ] , raise the warning “Poorly defined extremum found” and use the location ( k x , i − X / 2 a , k y , j − Y / 2 b ) (k_{x,i}-X/2a,k_{y,j}-Y/2b) ( k x , i − X /2 a , k y , j − Y /2 b ) instead, i.e., effectively setting c = 0 c=0 c = 0 . The energy value f 0 f_0 f 0 of the extremum is
f 0 = e i , j − a ( k x , i − k x , 0 ) 2 − b ( k y , j − k y , 0 ) 2 − c ( k x , i − k x , 0 ) ( k y , j − k y , 0 ) . (155) f_0=e_{i,j}-a(k_{x,i}-k_{x,0})^2-b(k_{y,j}-k_{y,0})^2-c(k_{x,i}-k_{x,0})(k_{y,j}-k_{y,0}). \tag*{(155)} f 0 = e i , j − a ( k x , i − k x , 0 ) 2 − b ( k y , j − k y , 0 ) 2 − c ( k x , i − k x , 0 ) ( k y , j − k y , 0 ) . (155)
The function nine_point_extremum_solver() returns the result as f 0 f_0 f 0 , ( k x , 0 , k y , 0 ) (k_{x,0},k_{y,0}) ( k x , 0 , k y , 0 ) , ( a , b , c ) (a,b,c) ( a , b , c ) .
The band masses are calculated from the eigenvalues of the Hessian matrix, constructed from ( a , b , c ) (a,b,c) ( a , b , c ) . For cartesian coordinates, the eigenvalues are equal to λ ± = 1 2 ( a + b ± ( a − b ) 2 + c 2 ) \lambda_{\pm}=\frac{1}{2}(a+b\pm\sqrt{(a-b)^2+c^2}) λ ± = 2 1 ( a + b ± ( a − b ) 2 + c 2 ) . For polar coordinates, k x k_x k x and k y k_y k y should be interpreted as k r = ∣ k ∣ k_r=|k| k r = ∣ k ∣ and k ϕ k_\phi k ϕ respectively. In order to obtain band masses for cartesian coordinates, the elements of the Hessian matrix must be rescaled as
h p o l a r = ( 2 a c / k r c / k r 2 b / k r ) . (156) h_{\mathrm{polar}}=\begin{pmatrix} 2a & c/k_r \\ c/k_r & 2b/k_r \end{pmatrix}. \tag*{(156)} h polar = ( 2 a c / k r c / k r 2 b / k r ) . (156)
where the factor 1 / k r 1/k_r 1/ k r comes from the Jacobian of the coordinate transformation between polar and cartesian coordinates (assuming the angular coordinate is in radians). The band masses are then obtained from the eigenvalues of h p o l a r h_{\mathrm{polar}} h polar .
Nineteen-point extremum solver
The function nineteen_point_extremum_solver() for three dimensions effectively applies the method of the nine-point extremum solver in the k x k y k_xk_y k x k y , k x k z k_xk_z k x k z , and k y k z k_yk_z k y k z planes separately. The elements of the Hessian matrix h h h [the 3 × 3 3 \times3 3 × 3 matrix in Eq. (127) ] are calculated as
a = e i + 1 , j , l − 2 e i , j , l + e i − 1 , j , l 2 ( Δ x ) 2 , d = e i + 1 , j + 1 , l − e i − 1 , j + 1 , l − e i + 1 , j − 1 , l + e i − 1 , j − 1 , l 4 Δ x Δ y , b = e i , j + 1 , l − 2 e i , j , l + e i , j − 1 , l 2 ( Δ y ) 2 , e = e i + 1 , j , l + 1 − e i − 1 , j , l + 1 − e i + 1 , j , l − 1 + e i − 1 , j , l − 1 4 Δ x Δ z , c = e i , j , l + 1 − 2 e i , j , l + e i , j , l − 1 2 ( Δ z ) 2 , f = e i , j + 1 , l + 1 − e i , j − 1 , l + 1 − e i , j + 1 , l − 1 + e i , j − 1 , l − 1 4 Δ y Δ z . (157) \begin{aligned}
a &= \frac{e_{i+1,j,l}-2e_{i,j,l}+e_{i-1,j,l}}{2(\Delta x)^2}, &
d &= \frac{e_{i+1,j+1,l}-e_{i-1,j+1,l}-e_{i+1,j-1,l}+e_{i-1,j-1,l}}{4\Delta x\Delta y},\\
b &= \frac{e_{i,j+1,l}-2e_{i,j,l}+e_{i,j-1,l}}{2(\Delta y)^2}, &
e &= \frac{e_{i+1,j,l+1}-e_{i-1,j,l+1}-e_{i+1,j,l-1}+e_{i-1,j,l-1}}{4\Delta x\Delta z},\\
c &= \frac{e_{i,j,l+1}-2e_{i,j,l}+e_{i,j,l-1}}{2(\Delta z)^2}, &
f &= \frac{e_{i,j+1,l+1}-e_{i,j-1,l+1}-e_{i,j+1,l-1}+e_{i,j-1,l-1}}{4\Delta y\Delta z}. \tag*{(157)}
\end{aligned} a b c = 2 ( Δ x ) 2 e i + 1 , j , l − 2 e i , j , l + e i − 1 , j , l , = 2 ( Δ y ) 2 e i , j + 1 , l − 2 e i , j , l + e i , j − 1 , l , = 2 ( Δ z ) 2 e i , j , l + 1 − 2 e i , j , l + e i , j , l − 1 , d e f = 4Δ x Δ y e i + 1 , j + 1 , l − e i − 1 , j + 1 , l − e i + 1 , j − 1 , l + e i − 1 , j − 1 , l , = 4Δ x Δ z e i + 1 , j , l + 1 − e i − 1 , j , l + 1 − e i + 1 , j , l − 1 + e i − 1 , j , l − 1 , = 4Δ y Δ z e i , j + 1 , l + 1 − e i , j − 1 , l + 1 − e i , j + 1 , l − 1 + e i , j − 1 , l − 1 . (157)
The coefficients d d d , e e e , and f f f involve the twelve pink-coloured points in Figure 9 (c), but for each group of four, only one linear combination is considered. We note that the corner points e i ± 1 , j ± 1 , l ± 1 e_{i\pm1,j\pm1,l\pm1} e i ± 1 , j ± 1 , l ± 1 [coloured black in Figure 9 (c)] are included in the input arguments, but not considered.
If the Hessian matrix is non-singular (in nineteen_point_extremum_solver(), we use the condition ∣ det h ∣ > 10 − 6 \lvert\det h\rvert> 10^{-6} ∣ det h ∣ > 1 0 − 6 ), we find the momentum location as
( k x , 0 k y , 0 k z , 0 ) = ( k x , i k y , j k z , l ) + h − 1 ( − X − Y − Z ) (158) \begin{pmatrix} k_{x,0} \\ k_{y,0} \\ k_{z,0} \end{pmatrix}
=
\begin{pmatrix} k_{x,i} \\ k_{y,j} \\ k_{z,l} \end{pmatrix}
+
h^{-1}
\begin{pmatrix} -X \\ -Y \\ -Z \tag*{(158)} \end{pmatrix} k x , 0 k y , 0 k z , 0 = k x , i k y , j k z , l + h − 1 − X − Y − Z (158)
where h − 1 h^{-1} h − 1 is the inverse of the Hessian matrix and X = ( e i + 1 , j , l − e i − 1 , j , l ) / 2 Δ x X=(e_{i+1,j,l}-e_{i-1,j,l})/2\Delta x X = ( e i + 1 , j , l − e i − 1 , j , l ) /2Δ x , Y = ( e i , j + 1 , l − e i , j − 1 , l ) / 2 Δ y Y=(e_{i,j+1,l}-e_{i,j-1,l})/2\Delta y Y = ( e i , j + 1 , l − e i , j − 1 , l ) /2Δ y , and Z = ( e i , j , l + 1 − e i , j , l − 1 ) / 2 Δ z Z=(e_{i,j,l+1}-e_{i,j,l-1})/2\Delta z Z = ( e i , j , l + 1 − e i , j , l − 1 ) /2Δ z [analogous to Eq. (A.16)]. If ∣ det h ∣ ≤ 10 − 6 \lvert\det h\rvert\le10^{-6} ∣ det h ∣ ≤ 1 0 − 6 or the point lies outside of the box [ k x , i − 1 , k x , i + 1 ] × [ k y , j − 1 , k y , j + 1 ] × [ k z , l − 1 , k z , l + 1 ] [k_{x,i-1},k_{x,i+1}]\times[k_{y,j-1},k_{y,j+1}]\times[k_{z,l-1},k_{z,l+1}] [ k x , i − 1 , k x , i + 1 ] × [ k y , j − 1 , k y , j + 1 ] × [ k z , l − 1 , k z , l + 1 ] , the “Poorly defined extremum found” warning is raised and the location replaced by ( k x , i − X / 2 a , k y , j − Y / 2 b , k z , l − Z / 2 c ) (k_{x,i}-X/2a,k_{y,j}-Y/2b,k_{z,l}-Z/2c) ( k x , i − X /2 a , k y , j − Y /2 b , k z , l − Z /2 c ) . The energy value f 0 f_0 f 0 of the extremum is given by
f 0 = e i , j , l − ( k ~ x k ~ y k ~ z ) ( 2 a d e d 2 b f e f 2 c ) ( k ~ x k ~ y k ~ z ) , (159) f_0=e_{i,j,l}-
\begin{pmatrix}\tilde{k}_x & \tilde{k}_y & \tilde{k}_z\end{pmatrix}
\begin{pmatrix}
2a & d & e \\
d & 2b & f \\
e & f & 2c
\end{pmatrix}
\begin{pmatrix}\tilde{k}_x \\ \tilde{k}_y \\ \tilde{k}_z\end{pmatrix}, \tag*{(159)} f 0 = e i , j , l − ( k ~ x k ~ y k ~ z ) 2 a d e d 2 b f e f 2 c k ~ x k ~ y k ~ z , (159)
with ( k ~ x , k ~ y , k ~ z ) = ( k x , i , k y , j , k z , l ) − ( k x , 0 , k y , 0 , k z , 0 ) (\tilde{k}_x,\tilde{k}_y,\tilde{k}_z)=(k_{x,i},k_{y,j},k_{z,l})-(k_{x,0},k_{y,0},k_{z,0}) ( k ~ x , k ~ y , k ~ z ) = ( k x , i , k y , j , k z , l ) − ( k x , 0 , k y , 0 , k z , 0 ) . The nineteen_point_extremum_solver() function returns the result as f 0 f_0 f 0 , ( k x , 0 , k y , 0 , k z , 0 ) (k_{x,0},k_{y,0},k_{z,0}) ( k x , 0 , k y , 0 , k z , 0 ) , ( a , b , c , d , e , f ) (a,b,c,d,e,f) ( a , b , c , d , e , f ) . The band masses are calculated from the eigenvalues of the Hessian matrix. If the coordinate system is cylindrical or spherical, the appropriate coordinate transformation is applied prior to finding the eigenvalues.
Reference
Units and constants
Units
In kdotpy, physical quantities are represented by numerical data types without the explicit specification of units. For this reason, it is necessary to agree on a system of units such that calculations that physical quantities can be done intuitively, possibly without the need of conversion factors. Whereas a system where units are treated explicitly would be more fail-safe, it would create a lot of overhead which may reduce performance.
We choose a system of units such that physical quantities in context of solid-state physics have reasonable values. The basic units are:
Length: nm
Time: ns
Energy: meV (not eV)
Voltage: mV (not V)
Temperature: K
Electric charge: e
Magnetic field: T
With magnetic field we mean magnetic flux density , more accurately speaking. The unit for magnetic flux density in this unit system is defined as Tesla, T = V s / m 2 \mathbf{T} = \mathbf{V}\,\mathbf{s}/\mathbf{m}^{2} T = V s / m 2 . This unit is ‘incompatible’ with the combination of units for voltage, length, and time, which would be mV ns/nm² . The conversion, given by 1 T = 10 − 6 m V n s / n m 2 \mathbf{1\ T} = \mathbf{10^{-6}\ mV\ ns/nm^{2}} 1 T = 1 0 − 6 mV ns/n m 2 is done internally by kdotpy when it interprets magnetic field values.
From the basic units, we derive units for other physical quantities, for example,
Momentum (more appropriately wave vector) k \mathbf{k} k : nm⁻¹
Density (such as particle/carrier density): nm⁻¹ , nm⁻² , or nm⁻³ depending on dimensionality
Density of states: nm⁻¹ meV⁻¹ , nm⁻² meV⁻¹ , or nm⁻³ meV⁻¹
Charge density: e nm⁻¹ , e nm⁻² , or e nm⁻³
Electric field: mV/nm
Velocity: nm/ns = m/s
Inputs and outputs use the basic and derived units if not explicitly stated otherwise.
Physical constants
The following physical constants are defined in physconst.py.
m_e = 0.510998910e9 in meV : Electron mass in energy equivalents (E = m e c 2 E = m_{\mathrm{e}}c^{2} E = m e c 2 ).
e_el = 1.6021766208e-19 in C : Elementary charge e e e . We define this value to be positive.
cLight = 299792458. in nm/ns = m/s : Speed of light c c c .
hbar = 6.582119514e-4 in meV ns : Reduced Planck constant ℏ \hbar ℏ .
hbarm0 = hbar**2 * cLight**2 / m_e / 2 in meV nm² : ℏ 2 / 2 m e = 38.09982350 ( 23 ) m e V n m 2 \hbar^{2}/2m_{\mathrm{e}} = 38.09982350(23)\,\mathrm{meV\,nm}^{2} ℏ 2 /2 m e = 38.09982350 ( 23 ) meV nm 2 . The approximate value 38 meV nm² is useful for making estimates.
eoverhbar = 1e-6 / hbar in 1 / ( T n m 2 ) 1/(\mathrm{T}\,\mathrm{nm}^{2}) 1/ ( T nm 2 ) : e / ℏ e/\hbar e /ℏ defined such, that eoverhbar times magnetic field in T yields a density in n m − 2 \mathrm{nm}^{-2} nm − 2 . This takes into account the conversion factor 10 − 6 10^{-6} 1 0 − 6 in T = 10 − 6 m V n s / n m 2 = 10^{-6}\,\mathrm{mV\,ns}/\mathrm{nm}^{2} = 1 0 − 6 mV ns / nm 2 . The product eoverhbar * A, with the vector potential A A A in T nm, yields a value in n m − 1 \mathrm{nm}^{-1} nm − 1 , as appropriate for a momentum quantity. This appears in the Peierls substitution, for example. The product eoverhbar * B, with the magnetic field B B B in T, yields a quantity in units of n m − 2 \mathrm{nm}^{-2} nm − 2 , cf. l B 2 = ℏ / e B l_B^2 = \hbar/eB l B 2 = ℏ/ e B
These values have been extracted from the NIST Reference on Constants, Units, and Uncertainty, revision 2014, see Ref. [45 ] and online at https://physics.nist.gov/cuu/Constants/index.html . The revised NIST values from 2018 may deviate slightly (but negligibly) from the values listed here and in physconst.py.
Material parameters
Chemistry
elements: Comma-separated list of the elements, for example Hg, Te. If elements is not given, it is determined automatically from compound (and vice versa).
composition: Numbers for each of the elements in the chemical formula, that indicate their (stoichiometric) proportions in the compound. The numbers must be separated by commas and may be a function of the variables x x x , y y y , and/or z z z . For example, for a crystal with molecular formula H g 1 − x C d x T e \mathrm{Hg}_{1-x}\mathrm{Cd}_x\mathrm{Te} Hg 1 − x Cd x Te , use compound = HgCdTe and composition = 1-x, x, 1.
Special commands
[mat2]
copy = mat1
copies all parameters from material mat1 into material mat2. Each parameter may be subsequently overwritten manually.
linearmix: Define a material as a linear combination of two others, where the parameters are linearly interpolated. The value is a 3-tuple of the form mat1, mat2, var, where mat1 and mat2 are the source materials and var is the interpolation variable (x x x , y y y , or z z z ). For example
[HgCdTe]
linearmix = HgTe, CdTe, x
makes material HgCdTe a linear combination of HgTe and CdTe. Each parameter p p p is interpolated as p H g C d T e = ( 1 − x ) p H g T e + x p C d T e p_{\mathrm{HgCdTe}} = (1-x)p_{\mathrm{HgTe}} + x\,p_{\mathrm{CdTe}} p HgCdTe = ( 1 − x ) p HgTe + x p CdTe . Each parameter may be subsequently overwritten manually.
Band energies
Ev: ‘Valence’ band energy in meV. This is the energy of the Γ 8 \Gamma_{8} Γ 8 orbitals at k = 0 \boldsymbol{k} = \mathbf{0} k = 0 for the unstrained bulk material. For inverted materials, Ev indicates the energy of the Γ 8 \Gamma_{8} Γ 8 orbitals, not that of the actual valence band.
Ec: ‘Conduction’ band energy in meV. This is the energy of the Γ 6 \Gamma_{6} Γ 6 orbitals at k = 0 \boldsymbol{k} = \mathbf{0} k = 0 for the unstrained bulk material. For inverted materials, Ec indicates the energy of the Γ 6 \Gamma_{6} Γ 6 orbitals, not that of the actual conductance band.
delta_so: ‘Split-off’ energy difference Δ S O \Delta_{\mathrm{SO}} Δ SO in meV between the Γ 8 \Gamma_{8} Γ 8 and Γ 7 \Gamma_{7} Γ 7 orbitals in the unstrained bulk material. To put it more precisely, the energy of the Γ 8 \Gamma_{8} Γ 8 orbital at k = 0 \boldsymbol{k} = \mathbf{0} k = 0 is Ev - delta_so.
Quadratic terms
P: Kane matrix element P = ℏ m 0 ⟨ S ∣ p x ∣ X ⟩ P = \frac{\hbar}{m_{0}}\langle S|p_{x}|X\rangle P = m 0 ℏ ⟨ S ∣ p x ∣ X ⟩ in meV nm. NOTE: The definition of P P P differs between references by a sign and/or a factor of i. Here, we take a positive real value for P.
gamma1: Luttinger parameter γ 1 \gamma_{1} γ 1 , dimensionless value. This Luttinger parameter describes the spherically isotropic component of the (bare) band mass of the Γ 8 \Gamma_{8} Γ 8 orbitals.
gamma2: Luttinger parameter γ 2 \gamma_{2} γ 2 , dimensionless value. This Luttinger parameter describes the component proportional to k x 2 + k y 2 − 2 k z 2 k_{x}^{2} + k_{y}^{2} - 2k_{z}^{2} k x 2 + k y 2 − 2 k z 2 for the Γ 8 \Gamma_{8} Γ 8 orbitals. This component is axially, but not spherically symmetric.
gamma3: Luttinger parameter γ 3 \gamma_{3} γ 3 , dimensionless value. This Luttinger parameter describes the component proportional to k x 2 − k y 2 k_{x}^{2} - k_{y}^{2} k x 2 − k y 2 for the Γ 8 \Gamma_{8} Γ 8 orbitals. This component breaks axial symmetry.
F: Band mass parameter for the Γ 6 \Gamma_{6} Γ 6 orbitals. The bare band mass term is ℏ 2 2 m 0 ( 2 F + 1 ) ( k x 2 + k y 2 + k z 2 ) \frac{\hbar^{2}}{2m_{0}}(2F+1)(k_{x}^{2}+k_{y}^{2}+k_{z}^{2}) 2 m 0 ℏ 2 ( 2 F + 1 ) ( k x 2 + k y 2 + k z 2 ) . In 2 F + 1 2F+1 2 F + 1 , the 1 is the contribution of free electrons and 2 F 2F 2 F is the contribution from perturbative corrections from remote bands in k ⋅ p \boldsymbol{k}\cdot\boldsymbol{p} k ⋅ p theory.
kappa: See Section Magnetic couplings below.
Bulk-inversion asymmetry
bia_c: Linear bulk-inversion asymmetry coefficient C C C in meV nm− 1 ^{-1} − 1 .
bia_b8p: Quadratic bulk-inversion asymmetry coefficient B 8 v + B_{8v}^{+} B 8 v + in meV nm− 2 ^{-2} − 2 .
bia_b8m: Quadratic bulk-inversion asymmetry coefficient B 8 v − B_{8v}^{-} B 8 v − in meV nm− 2 ^{-2} − 2 .
bia_b7: Quadratic bulk-inversion asymmetry coefficient B 7 v B_{7v} B 7 v in meV nm− 2 ^{-2} − 2 .
Magnetic couplings
ge: Gyromagnetic factor g e g_{e} g e for the Γ 6 \Gamma_{6} Γ 6 orbitals. The magnetic coupling is also known as the Zeeman term and is equal to g e μ B B ⋅ S g_{e}\mu_{\mathrm{B}}\boldsymbol{B}\cdot\boldsymbol{S} g e μ B B ⋅ S . The value of g e g_{e} g e contains contributions from the free electron (equal to 2) and perturbative corrections from remote bands.
kappa: Gyromagnetic factor κ \kappa κ for the Γ 8 \Gamma_{8} Γ 8 and Γ 7 \Gamma_{7} Γ 7 orbitals. The magnetic coupling is of the form − 2 μ B κ J ⋅ B -2\mu_{\mathrm{B}}\kappa\boldsymbol{J}\cdot\boldsymbol{B} − 2 μ B κ J ⋅ B in the ( Γ 8 , Γ 8 ) (\Gamma_{8},\Gamma_{8}) ( Γ 8 , Γ 8 ) block of the Hamiltonian and analogous couplings in the ( Γ 8 , Γ 7 ) (\Gamma_{8},\Gamma_{7}) ( Γ 8 , Γ 7 ) and ( Γ 7 , Γ 7 ) (\Gamma_{7},\Gamma_{7}) ( Γ 7 , Γ 7 ) blocks. The coefficient kappa also appears as a non-magnetic term containing a commutator [ k x , k z ] [k_{x},k_{z}] [ k x , k z ] , which contributes only at material interfaces.
q: Coefficient q q q of the Γ 8 \Gamma_{8} Γ 8 magnetic coupling − 2 μ B q J ⋅ B -2\mu_{\mathrm{B}}q\mathcal{J}\cdot\boldsymbol{B} − 2 μ B q J ⋅ B , where J = ( J x 3 , J y 3 , J z 3 ) \mathcal{J} = (J_{x}^{3},J_{y}^{3},J_{z}^{3}) J = ( J x 3 , J y 3 , J z 3 ) .
exch_yNaIpha: Exchange energy parameter in meV for the Γ 6 \Gamma_{6} Γ 6 orbitals. The paramagnetic exchange interaction is relevant for paramagnetic materials like (Hg,Mn)Te. The interaction strength typically depends linearly on the Mn concentration (y in Ref. [3 ] , hence the y in the parameter name). In the materials file, this dependence must be given explicitly, e.g., by setting exch_yNaIpha = y * 400. The given dependence may be chosen non-linear if desired. See Ref. [3 ] for more details on the physics of this paramagnetic coupling in (Hg,Mn)Te.
exch_g: The gyromagnetic factor g e x g_{\mathrm{ex}} g ex in the argument of the Brillouin function. For (Hg,Mn)Te, this quantity is usually written as g M n g_{\mathrm{Mn}} g Mn see Eq. (58) and [3 ] . The default value is 2.
Electrostatic properties
diel_epsilon: Dielectric constant ϵ r \epsilon_r ϵ r , also known as relative permittivity. The value is dimensionless. The present version of kdotpy implements a constant value only, i.e., no frequency dependence is considered.
piezo_e14: Piezo-electric constant e 14 e_{14} e 14 in e nm− 2 ^{-2} − 2 . Note that this is the only independent component of the piezo-electric tensor for the zincblende crystal structure. To convert from units of C m− 2 ^{-2} − 2 , multiply the value by 10 18 e 10^{18}e 1 0 18 e , for example piezo_e14 = 0.035 * 1e18 * e_el.
Lattice constant and strain
strain_C1: Strain parameter (deformation potential) C 1 C_1 C 1 . The corresponding strain term is C 1 tr ϵ C_1 \operatorname{tr}\epsilon C 1 tr ϵ acting on the Γ 6 \Gamma_6 Γ 6 orbitals. In Refs. [2 , 3 ] , the notation C C C is used.
strain_Dd: Strain parameter (deformation potential) D d D_d D d . The corresponding strain term is D d tr ϵ D_d \operatorname{tr}\epsilon D d tr ϵ acting on the Γ 8 \Gamma_8 Γ 8 and Γ 7 \Gamma_7 Γ 7 orbitals. In Refs. [2 , 3 ] , the notation a a a is used.
strain_Du: Strain parameter (deformation potential) D u D_u D u . The corresponding strain term is a linear combination of the diagonal entries ϵ i i \epsilon_{ii} ϵ ii of the strain tensor, and acts on the Γ 8 \Gamma_8 Γ 8 and Γ 7 \Gamma_7 Γ 7 orbitals. In Refs. [2 , 3 ] , the notation b = − 2 3 D u b=-\frac{2}{3}D_u b = − 3 2 D u is used.
strain_Duprime: Strain parameter (deformation potential) D u ′ D'_u D u ′ . The corresponding strain term is a linear combination of the off-diagonal entries ϵ i j \epsilon_{ij} ϵ ij (shear components) of the strain tensor, and acts on the Γ 8 \Gamma_8 Γ 8 and Γ 7 \Gamma_7 Γ 7 orbitals. In Refs. [2 , 3 ] , d = − 2 3 D u ′ d=-\frac{2}{\sqrt{3}}D'_u d = − 3 2 D u ′ is used.
Lattice orientation
The SO(3) rotation matrix R R R can be parametrized in different ways, for example directly in terms of the device coordinate axis in terms of the lattice direction, or in terms of Euler angles. The command line option orientation is the most generic way to input a rotation. By giving up to three angles or directions, the crystal lattice can be rotated to any possible orientation with respect to the device coordinate system:
orientation #ang #ang #ang: Euler rotation z , x , z z,x,z z , x , z , i.e., rotate around the c c c crystal axis, tilt the z z z axis, and rotate around the z z z axis.
orientation #dir #dir #dir: Longitudinal, transversal, and growth direction x , y , z x,y,z x , y , z .
Angles #ang are entered as an explicit floating point number containing a decimal sign . or with the degree symbol (° or d). Directions #dir are triplets either of digits without separators and possibly with minus signs (e.g., 100, 111, 11-2, -110) or of numbers separated by commas without spaces (e.g., 1,1,0 or 10,-10,3). If multiple directions are given as arguments, they must be pairwise orthogonal, which is tested by calculating the inner products between them.
The command line arguments stripangle and stripdir are simplified options for rotation of a strip geometry around the z z z axis.
Custom eigensolvers
As discussed in § 3.4.1 , the diagonalization involves two components: The actual eigensolver and an efficient LU solver for the shift-and-invert step. kdotpy can be configured to use custom solvers provided by external packages for both steps. In this section, we list them and discuss their strengths and weaknesses.
Eigensolvers
eigsh from SciPy: The default implementation that ships with the SciPy module. It interfaces to the external ARPACK package [38 ] that implements the Lanczos/Arnoldi algorithm.
PRO: It is stable and there are no convergence problems. It comes with SciPy, so it does not require any steps to set up.
CONTRA: A single calculation can only make use of one CPU core (multi-core usage possible by parallelizing over k k k or B B B points). The memory bandwidth may be a bottleneck for large problems, due to gemm operations (matrix-matrix products with general matrices in BLAS [46 ] ) during eigenvector orthonormalization, which is the slowest operation per Lanczos/Arnoldi iteration.
eigsh from CuPy [47 ] : Also a Lanczos/Arnoldi algorithm, written in pure Python. The CuPy library mimics, extends and replaces the NumPy/SciPy packages. Where possible and efficient, the computational workload is done on a CUDA capable GPU. Performance is best on larger problem sizes. Depending on the availability of single and double precision GPU cores, using single precision floating-point arithmetic may be faster, at the expense of lower precision. Using CuPy requires a CUDA capable GPU and a compatible version of the CUDA library 9.
PRO: It is much faster for large problems compared to the CPU eigsh solver, for example about 6 times in non-axial LL mode, depending on setup and problem parameters. The GPUs typically have higher memory bandwidth. TensorCores can drastically speed up the gemm operation.
CONTRA: The RAM limits on GPU are generally tighter than those on CPU. The solver can fail to converge, especially if single precision floating-point arithmetic is used. This can be mitigated by switching to higher precision or falling back to the CPU solver (done automatically by default), but this leads to a reduction in speed. Setting up and configuring this solver requires more effort.
FEAST solver: Either provided via Intel MKL (version 2.1) or by manual compilation of a shared library (version 4.0).
PRO: Can be more efficient than default eigsh; no additional LU solver is required.
CONTRA: This solver can be unreliable with densely clustered eigenstates, which is frequently the case for kdotpy.
eigh from jax: Converts the sparse matrix to a dense matrix, then uses eigh from the Google JAX library to solve on accelerators like GPUs using highly optimized instructions. Scales across multiple accelerators. Currently implemented as fixed double precision.
PRO: Extremely fast when a large fraction of eigenvalues are requested (in fact, the algorithm does a full diagonalization internally).
CONTRA: Very memory intensive on GPUs. The entire Hamiltonian (including solutions) needs to fit into GPU memory.
LU solvers
CONTRA: Can fail with a memory allocation error for very large matrix sizes.
UMFPACK: Uses external library shipped with scikit/UMFPACK. Previously, this was used as default by SciPy, but this was changed due to license issues. If UMFPACK is installed (scikit libraries and Python packages), SciPy chooses it automatically for use with eigsh. PRO: It is stable and efficient, and usually fast. CONTRA: In some cases, it may rather be slower than SuperLU.
PARDISO: Provided by the Intel MKL library. It requires the Intel MKL libraries to be installed along with a suitable Python package that links to it. PRO: It is fast, for example about 3 to 4 times with kdotpy 1d, efficient and stable. CONTRA: The official Python package is no longer maintained. It may require more work to set up.
Optimizing solver speed is connected to the problem to be solved, as well as to the computation environment used for the calculation. For the very different workloads created by various kdotpy problem sets and the large range of hardware that kdotpy could be run on (from small dual core, low RAM PCs over powerful GPU accelerated workstations up to multiple HPC cluster nodes), it is not possible to identify a single eigensolver and a set of optimal parameters that satisfies every scenario.
Automatic settings in kdotpy always try to use settings for highest stability, maximum speed and minimal RAM requirements as a rough guideline (in order of priority). However in most scenarios, performance data is not available and has to be found by user experience. The following hardware parameters are important aspects to that affect eigensolver performance:
CPU instruction sets: Vector and matrix BLAS operations profit much from modern CPU instructions such as AVX. Intel MKL downthrottles AMD CPUs by not making use of some of those features, but this behaviour can be disabled. An older version of MKL might perform best in such cases, but should be benchmarked against current versions.
On CPU cores: While Python itself has many pitfalls in terms of efficient threading and multicore usage, prominently due to its global interpreter lock (GIL), we can still make good use of additional CPU cores by solving multiple matrices in parallel processes by parallelization over k k k or B B B points. As long as we do not run into other limits listed below, this yields almost linear performance improvements. Some of the external libraries (all ones mentioned above, except ARPACK) can also use more cores through multithreading, however this higher core usage is not always rewarded with speed gains. A high degree of parallelization can be energy-inefficient due to the extra overhead. On hardware with inadequate cooling, pushing the CPU to its limits for an extensive time may also lead to performance degradation from thermal throttling.
RAM size: The maximum amount of RAM in the system sets a hard limit on the number of matrices that can be solved in parallel. Each independent problem requires a similar amount of RAM space during calculation, that can not be shared. Once the threshold is exceeded, the whole process is likely to crash.
CPU cache size and RAM bandwidth: This is the amount of data the CPU can request from RAM (per second). For some calculations, it is possible, that data for CPU operations can not be stored efficiently enough in the CPU cache (cache miss) and a lot of data has to fetched from RAM. This is a limitation for large matrix-matrix-multiplications (BLAS function gemm), as the operation’s data cannot fit in cache. In non-axial LL mode, this can be observed when requesting many eigenvalues (large n e i g n_{\mathrm{eig}} n eig for thick layers, as the orthogonalization of eigenvectors (as part of the Lanczos algorithm) is basically done using two gemm calls. Running more simultaneous processes does not increase total solution speed, as it slows down each process due to shared RAM access.
Observables
Spatial observables
The following observables are defined as integrals over spatial coordinates. In the discrete coordinates used in kdotpy, they are implemented as summations, e.g., ∑ i ψ z i ∗ ψ z i \sum_i \psi_{z_i}^*\psi_{z_i} ∑ i ψ z i ∗ ψ z i for the expectation value ⟨ z ⟩ \langle z\rangle ⟨ z ⟩ .
y: Expectation value ⟨ y ⟩ \langle y\rangle ⟨ y ⟩ , where y y y is the coordinate transverse to the strip.
y2: Expectation value ⟨ y 2 ⟩ \langle y^2\rangle ⟨ y 2 ⟩ .
sigmay: Standard deviation of y y y , σ y = ⟨ y 2 ⟩ − ⟨ y ⟩ 2 \sigma_y=\sqrt{\langle y^2\rangle-\langle y\rangle^2} σ y = ⟨ y 2 ⟩ − ⟨ y ⟩ 2 .
z: Expectation value ⟨ z ⟩ \langle z\rangle ⟨ z ⟩ , where z z z is the coordinate parallel to the growth direction.
z2: Expectation value ⟨ z 2 ⟩ \langle z^2\rangle ⟨ z 2 ⟩ .
sigmaz: Standard deviation of z z z , σ y = ⟨ z 2 ⟩ − ⟨ z ⟩ 2 \sigma_y=\sqrt{\langle z^2\rangle-\langle z\rangle^2} σ y = ⟨ z 2 ⟩ − ⟨ z ⟩ 2 .
zif: Expectation value ⟨ z i f ⟩ \langle z_{\mathrm{if}}\rangle ⟨ z if ⟩ , where z i f z_{\mathrm{if}} z if is the (signed) distance to the nearest interface.
zif2: Expectation value ⟨ z i f 2 ⟩ \langle z_{\mathrm{if}}^2\rangle ⟨ z if 2 ⟩ .
sigmazif: Standard deviation of z i f z_{\mathrm{if}} z if , σ z i f = ⟨ z i f 2 ⟩ − ⟨ z i f ⟩ 2 \sigma_{z_{\mathrm{if}}}=\sqrt{\langle z_{\mathrm{if}}^2\rangle-\langle z_{\mathrm{if}}\rangle^2} σ z if = ⟨ z if 2 ⟩ − ⟨ z if ⟩ 2 .
well: Probability density inside the well.
wellext: Probability density inside the well and the adjacent 2 nm of barriers.
interface: Probability density less than 1 nm from each interface. This quantity cannot be used to compare samples of different size.
interface10nm: Probability density less than 10 nm from each interface. This quantity cannot be used to compare samples of different size.
custominterface[]: Probability density up to a length in nm, set by the command-line argument custominterfacelength.
interfacechar: ‘Interface character’. Probability density less than 1 nm from each interface divided by what this quantity would be for a uniform probability density, i.e., for a normalized wave function with constant magnitude given by ∣ ψ ∣ 2 ≡ 1 / V |\psi|^2\equiv1/V ∣ ψ ∣ 2 ≡ 1/ V , where V V V is the volume (size) of the complete sample. If Ω \Omega Ω denotes the domain near the interfaces (e.g., less than 1 nm away) and V i f = vol ( Ω ) V_{\mathrm{if}}=\operatorname{vol}(\Omega) V if = vol ( Ω ) its size, then the interface character is ( V / V i f ) ∫ Ω ∣ ψ ( r ) ∣ 2 d r (V/V_{\mathrm{if}})\int_{\Omega}|\psi(r)|^2\mathrm{d}r ( V / V if ) ∫ Ω ∣ ψ ( r ) ∣ 2 d r . Regardless of sample size, values larger than 1 indicate strong interface character.
interfacechar10nm: Interface character, like interfacechar, but with an interface region of 10 nm instead of 1 nm.
custominterfacechar[]: Interface character, like interfacechar, with the size of the interface region set by the command-line argument custominterfacelength.
Inverse participation ratio
Generically, an inverse participation ratio (IPR) for a probability distribution is defined in terms of the fourth moment (kurtosis) scaled by the square of the second moment (variance). For a wave function ψ ( r ) \psi(r) ψ ( r ) in terms of spatial coordinate(s) r r r , we define
I P R = ( ∫ ∣ ψ ( r ) ∣ 2 d r ) 2 ∫ ∣ ψ ( r ) ∣ 4 d r = ( ∫ ∣ ψ ( r ) ∣ 4 d r ) − 1 , (160) \mathrm{IPR}=\frac{\left(\int|\psi(r)|^2\mathrm{d}r\right)^2}{\int|\psi(r)|^4\mathrm{d}r}=\left(\int|\psi(r)|^4\mathrm{d}r\right)^{-1}, \tag*{(160)} IPR = ∫ ∣ ψ ( r ) ∣ 4 d r ( ∫ ∣ ψ ( r ) ∣ 2 d r ) 2 = ( ∫ ∣ ψ ( r ) ∣ 4 d r ) − 1 , (160)
where the second equality assumes normalization of the wave function. The resulting IPR has dimensions of length (for a one-dimensional spatial coordinate). kdotpy provides IPR observables for three choices of coordinates:
ipry: IPR over the coordinate y y y . If necessary, we first integrate over the coordinate z z z in order to obtain ∣ ψ ( y ) ∣ 2 |\psi(y)|^2 ∣ ψ ( y ) ∣ 2 . The dimensionful variety has units of length. For the dimensionless variety, divide by the width w w w in y y y direction.
iprz: IPR over the coordinate z z z . If necessary, we first integrate over the coordinate y y y in order to obtain ∣ ψ ( z ) ∣ 2 |\psi(z)|^2 ∣ ψ ( z ) ∣ 2 . The dimensionful variety has units of length. For the dimensionless variety, divide by the thickness d d d in z z z direction.
ipryz: IPR over the coordinates ( y , z ) (y,z) ( y , z ) . The dimensionful variety has units of area (length squared). For the dimensionless variety, divide by w d wd w d .
Internal degrees of freedom
The following observables are defined in terms of internal degrees of freedom, i.e., (combinations of) orbitals. This includes spin operators.
sx, sy, sz: Spin expectation value ⟨ S i ⟩ \langle S_i\rangle ⟨ S i ⟩ (i = x , y , z i=x,y,z i = x , y , z ). This is proper spin in units of ℏ \hbar ℏ , so that the range of possible values is [ − 1 2 , 1 2 ] \left[-\frac{1}{2},\frac{1}{2}\right] [ − 2 1 , 2 1 ] .
jx, jy, jz: Expectation values ⟨ J i ⟩ \langle J_i\rangle ⟨ J i ⟩ (i = x , y , z i=x,y,z i = x , y , z ) of the total angular momentum. The range of possible values is [ − 3 2 , 3 2 ] \left[-\frac{3}{2},\frac{3}{2}\right] [ − 2 3 , 2 3 ] .
gamma6, gamma7, gamma8: Expectation values ⟨ P Γ i ⟩ \langle P_{\Gamma_i}\rangle ⟨ P Γ i ⟩ (i = 6 , 7 , 8 i=6,7,8 i = 6 , 7 , 8 ) of the projection to the Γ i \Gamma_i Γ i orbitals. This is the probability density in these orbitals.
gamma8h: Expectation values ⟨ P Γ 8 H ⟩ \langle P_{\Gamma_{8H}}\rangle ⟨ P Γ 8 H ⟩ of the projection to the orbital ∣ Γ 8 , j z = ± 3 / 2 ⟩ |\Gamma_8,j_z=\pm3/2\rangle ∣ Γ 8 , j z = ± 3/2 ⟩ . ‘H’ stands for heavy hole.
gamma8l: Expectation values ⟨ P Γ 8 L ⟩ \langle P_{\Gamma_{8L}}\rangle ⟨ P Γ 8 L ⟩ of the projection to the orbital ∣ Γ 8 , j z = ± 1 / 2 ⟩ |\Gamma_8,j_z=\pm1/2\rangle ∣ Γ 8 , j z = ± 1/2 ⟩ . ‘L’ stands for light hole.
jz6, jz7, jz8: Expectation values ⟨ J z P Γ i ⟩ \langle J_zP_{\Gamma_i}\rangle ⟨ J z P Γ i ⟩ (i = 6 , 7 , 8 i=6,7,8 i = 6 , 7 , 8 ) of the angular momentum in z z z direction in the Γ i \Gamma_i Γ i orbitals.
orbital[j]: The squared overlaps of the eigenstates within orbital number j j j , where j j j runs from 1 1 1 to n o r b n_{\mathrm{orb}} n orb (the number of orbitals, i.e., 6 or 8). Available for kdotpy 2d only, if the command line option orbitalobs is given.
Plain parity and ‘isoparity’ operators
The following observables implement several plain parity operators (a purely spatial operation) as well as ‘isoparity’ operators, which combine a spatial and a spin component [48 ] . The latter are given as actions of the appropriate representations of the relevant point group, namely the double group of T d T_d T d or one of its subgroups.
pz: Expectation value of the parity operator in the z z z coordinate, i.e., ⟨ P z ⟩ = ∫ ψ ∗ ( z ) ψ ( − z ) d z \langle P_z\rangle=\int\psi^*(z)\psi(-z)\,dz ⟨ P z ⟩ = ∫ ψ ∗ ( z ) ψ ( − z ) d z .
px, py: Expectation value of the parity operator in the coordinate x x x or y y y , i.e., ⟨ P x ⟩ \langle P_x\rangle ⟨ P x ⟩ , ⟨ P y ⟩ \langle P_y\rangle ⟨ P y ⟩
isopz: Expectation value of isoparity ⟨ P ~ z ⟩ \langle\widetilde{P}_z\rangle ⟨ P z ⟩ : this is the parity operator combined with the diagonal matrix Q Q Q in orbital space, given by Q = diag ( 1 , − 1 , 1 , − 1 , 1 , − 1 , − 1 , 1 ) Q=\operatorname{diag}(1,-1,1,-1,1,-1,-1,1) Q = diag ( 1 , − 1 , 1 , − 1 , 1 , − 1 , − 1 , 1 ) in the basis given by Eq. (10) . This is a conserved quantum number under a few assumptions [48 ] .
isopx, isopy: Expectation value of in-plane isoparity ⟨ P ~ x ⟩ \langle\widetilde{P}_x\rangle ⟨ P x ⟩ , ⟨ P ~ y ⟩ \langle\widetilde{P}_y\rangle ⟨ P y ⟩ . This is the parity operator in x or y, combined with the appropriate matrix Q x Q_x Q x , Q y Q_y Q y in orbital space, which can be found from the appropriate representations of the point group [48 ] .
isopzw: Expectation value of a modified isoparity operator like isopz, that acts only in the quantum well layer. Formally speaking, if the well ranges from z = z min z=z_{\min} z = z m i n to z max z_{\max} z m a x , then it maps z ′ = z − c z'=z-c z ′ = z − c (c = ( z min + z max ) / 2 c=(z_{\min}+z_{\max})/2 c = ( z m i n + z m a x ) /2 being the center of the well) to − z ′ -z' − z ′ . While isopz is not a conserved quantity for asymmetric geometries (e.g., a well layer and two barriers with unequal thickness), isopzw can remain almost conserved in that case. Due to incomplete confinement in the well region, the eigenvalues may deviate significantly from ± 1 \pm1 ± 1 .
isopzs: Expectation value of a modified isoparity operator like isopz, that acts only in a symmetric region around the centre of the quantum well layer. It is like isopzw, but z min z_{\min} z m i n and z max z_{\max} z m a x are chosen such that the range fits inside the stack, while keeping c = ( z min + z max ) / 2 c=(z_{\min}+z_{\max})/2 c = ( z m i n + z m a x ) /2 at the centre of the well. It tends to have eigenvalues closer to ± 1 \pm1 ± 1 , because it generally covers the probability density in (a part of) the barrier layers as well.
Hamiltonian terms
The following observables are expectation values of the individual terms in the Hamiltonian.
hexinf: Exchange energy in the large-field limit. Regardless of the actual value of the B B B field, give the expectation value of the exchange Hamiltonian evaluated for B z → ∞ B_z\to\infty B z → ∞ . In this limit, the Brillouin function is saturated at its maximum absolute value.
Landau levels
The following are observables based on the Landau level index n n n .
llindex: In the LL mode sym or legacy, this is the (conserved) LL index n n n . The minimal value is − 2 -2 − 2 . The lowest indices n = − 2 , − 1 , 0 n=-2,-1,0 n = − 2 , − 1 , 0 are incomplete, i.e., for these indices, not all orbitals contribute.
llmod4: In the LL mode full, analogous to llavg, returns the expectation value ⟨ n m o d 4 ⟩ \langle n\bmod4\rangle ⟨ n mod 4 ⟩ . While llavg is not a conserved quantity if axial symmetry is broken, this observable is usually conserved if bulk inversion symmetry is not broken.
llmod2: In the LL mode full, analogous to llavg, returns the expectation value ⟨ n m o d 2 ⟩ \langle n\bmod2\rangle ⟨ n mod 2 ⟩ . While llavg is not a conserved quantity if axial symmetry is broken, this observable is usually conserved even if bulk inversion symmetry is broken.
ll[j]: The squared overlaps of the eigenstates within Landau level j j j , where j j j runs from − 2 -2 − 2 to n max n_{\max} n m a x , the largest LL index. This observable is available for kdotpy ll in full LL mode only, if the command line option llobs is given.
Broadening
In kdotpy, the following types of broadening are implemented. The application of broadening is done by means of the broadening kernel f ( E ) f(E) f ( E ) . These are scaled versions of the probability density functions PDF ( x ) \operatorname{PDF}(x) PDF ( x ) of the corresponding distributions. The occupation functions F ( E ) F(E) F ( E ) are also implemented in the code. These are defined as the complementary cumulative density functions 1 − CDF ( x ) 1-\operatorname{CDF}(x) 1 − CDF ( x ) of the probability density functions PDF ( x ) \operatorname{PDF}(x) PDF ( x ) above. Since the PDFs are symmetric, the CDFs satisfy 1 − CDF ( x ) = CDF ( − x ) 1-\operatorname{CDF}(x)=\operatorname{CDF}(-x) 1 − CDF ( x ) = CDF ( − x ) . The kernels f ( x ) f(x) f ( x ) and occupation functions F ( x ) F(x) F ( x ) are plotted in Figure 24 .
Figure 24. Broadening function kernels f ( x ) f(x) f ( x ) and occupation functions F ( x ) F(x) F ( x ) for the Fermi, Gaussian, and Lorentzian shapes. The argument x x x is scaled by the width parameter k B T k_{\mathrm{B}}T k B T , σ \sigma σ , or γ \gamma γ , respectively.
Thermal (Fermi function):
The thermal broadening function models the broadening of the occupation (function) at finite temperature. The shape of the broadening is given by the Fermi function,
f ( E ) = 1 k B T e − x ( 1 + e − x ) 2 = 1 k B T 1 4 cosh 2 ( x / 2 ) (161) f(E)=\frac{1}{k_{\mathrm{B}}T}\frac{e^{-x}}{(1+e^{-x})^2}=\frac{1}{k_{\mathrm{B}}T}\frac{1}{4\cosh^2(x/2)} \tag*{(161)} f ( E ) = k B T 1 ( 1 + e − x ) 2 e − x = k B T 1 4 cosh 2 ( x /2 ) 1 (161)
where we define x = E / k B T x=E/k_{\mathrm{B}}T x = E / k B T . The characteristic width is k B T k_{\mathrm{B}}T k B T , where T T T is the temperature. The input argument is broadening T thermal with the temperature value T T T . The occupation function is
F ( x ) = 1 2 ( 1 + tanh ( − x / 2 ) ) = e − x 1 + e − x . (162) F(x)=\frac{1}{2}(1+\tanh(-x/2))=\frac{e^{-x}}{1+e^{-x}}. \tag*{(162)} F ( x ) = 2 1 ( 1 + tanh ( − x /2 )) = 1 + e − x e − x . (162)
The corresponding distribution is also known as the logistic distribution .
f ( E ) = 1 2 π σ 2 e − x 2 / 2 σ 2 , (163) f(E)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-x^2/2\sigma^2}, \tag*{(163)} f ( E ) = 2 π σ 2 1 e − x 2 /2 σ 2 , (163)
where x = E / σ x = E/\sigma x = E / σ . The broadening parameter σ \sigma σ is the standard deviation of the Gaussian distribution. Note that subtly different definitions may be found in literature, for example [3 ] uses the parameter Γ = 2 σ \Gamma= \sqrt{2}\sigma Γ = 2 σ . The input argument is broadening σ \boldsymbol{\sigma} σ gauss with the standard deviation σ \sigma σ . The occupation function is
F ( x ) = 1 2 erfc ( x / 2 ) , (164) F(x) = \frac{1}{2}\operatorname{erfc}(x/\sqrt{2}), \tag*{(164)} F ( x ) = 2 1 erfc ( x / 2 ) , (164)
where erfc ( z ) = 1 − erf ( z ) \operatorname{erfc}(z) = 1 - \operatorname{erf}(z) erfc ( z ) = 1 − erf ( z ) is the complementary error function. In statistics, the distribution is usually called the normal distribution .
f ( E ) = 1 π γ ( 1 + x 2 ) , (165) f(E) = \frac{1}{\pi\gamma(1+x^2)}, \tag*{(165)} f ( E ) = π γ ( 1 + x 2 ) 1 , (165)
where x = E / γ x = E/\gamma x = E / γ . The width parameter is γ \gamma γ . Lorentzian line shapes can be used to account for life-time limited broadening in optical transitions experiments. In that context, γ \gamma γ is proportional to the inverse of the lifetime of excited states. The input argument is broadening γ \gamma γ lorentz with the width γ \gamma γ . The occupation function is
F ( x ) = 1 2 + 1 π arctan ( − x ) . (166) F(x) = \frac{1}{2} + \frac{1}{\pi}\arctan(-x). \tag*{(166)} F ( x ) = 2 1 + π 1 arctan ( − x ) . (166)
The Lorentzian line shape is equivalent to the Cauchy distribution .
F ( x ) = 1 2 ( 1 − sgn ( x ) ) = { 1 for x < 0 0 for x > 0 (167) F(x) = \frac{1}{2}(1-\operatorname{sgn}(x)) =
\begin{cases}
1 & \text{for } x < 0 \\
0 & \text{for } x > 0
\end{cases} \tag*{(167)} F ( x ) = 2 1 ( 1 − sgn ( x )) = { 1 0 for x < 0 for x > 0 (167)
where x = E x = E x = E . This function is implemented separately because the other functions are ill-defined in this limit. The corresponding broadening kernel is f ( x ) = δ ( x ) f(x) = \delta(x) f ( x ) = δ ( x ) , the Dirac delta function (or delta distribution ).
Configuration Options
Solvers and tasks
diag_solver_cupy_gemm_dim_thr: Maximum dimension for matrix matrix multiplication in single precision mode. If problem size exceeds this value, the solution is split into multiple smaller problem sets. Smaller values can lead to worse solution speeds, larger values can lead to more numerical problems and fallback to slower double precision solver. (default: 4e-6 )
tasks_grouped: If set to true, all steps for a single DiagDataPoint are executed within the same worker/thread with the settings for the solve_ham step. Compared to the default mode, this involves less inter-worker data transfers (via pickling), which can give rise to issues with very large eigenvectors. As such, the worker communication behaves similar to kdotpy versions < v0.72. (default: false )
Band Alignment and Character
band_align_exp: Value of the exponent in the minimization function of the ‘error’ in the band alignment algorithm. A numerical value equal to e means that ∑ ( ∣ Δ E ∣ e ) \sum(|\Delta E|^e) ∑ ( ∣Δ E ∣ e ) is minimized. Alternatively, if the special value max is used, then the minimization function is max ( ∣ Δ E ∣ ) \max(|\Delta E|) max ( ∣Δ E ∣ ) . (default: 4 )
band_align_ndelta_weight: Coefficient of the penalty for reduction of the number of bands in the band alignment algorithm. The higher this value, the more the algorithm ‘resists’ changes in the number of bands. The value may not be negative (however, 0 is allowed), and too high values should be avoided. It is recommended to use the default value unless the band alignment algorithm does not proceed correctly. (default: 20.0 )
band_char_orbital_threshold: In the band character algorithm, the maximum value for the probability density (∣ ψ ∣ 2 |\psi|^2 ∣ ψ ∣ 2 ) in an orbital for the probability density to be considered zero. In that case, the orbital content of that orbital is ignored. (default: 5e-3 )
band_char_use_minmax: In the band character algorithm, whether to use the ‘new’ node counting method, that counts flips between local extrema. If set to false, use the legacy method. (boolean value; default : true)
band_char_make_real: In the band character algorithm, whether to divide the orbital component by the complex phase factor at its maximum, so that the function becomes effectively real, prior to counting the nodes. If set to false, consider both real and imaginary part as is. (boolean value; default : false)
kdotpy batch
batch_float_format: Format string for representation of float values being replaced in the command string. This is a standard %-style conversion, with the following addition: If a . (period) is added to the end, for example %f., apply the smart decimal option, i.e., strip superfluous zeros at the end, but keep the decimal point if the value is integer. Useful examples are, among others: %s, %f, %f., %.3f, %g. (default : %s)
BHZ Calculation
bhz_allow_intermediate_bands: Whether to allow a non-contiguous set of A bands. By default (false), do not allow B bands in between the A bands. If set to true, relax this restriction. This only takes effect if the input are band labels, e.g., bhz E1 H1 L1. It does not apply to numeric input (e.g., bhz 2 2), which is a contiguous set by definition. NOTE: Setting true is experimental, it may cause unexpected errors. (boolean value; default : false)
bhz_abcdm: Whether to output (tex file) a four-band BHZ model in ‘standard form’, using coefficients A, B, C, D, M. If this cannot be done, use the generic form instead. (boolean value; default : false)
bhz_ktilde: If BHZ is done at a nonzero momentum value k 0 k_0 k 0 , whether to express the Hamiltonian in the TeX output as shifted momentum k ~ = k − k 0 \tilde{k}=k-k_0 k ~ = k − k 0 . If set to false, express it in terms of unshifted momentum k k k . This option has no effect for BHZ done at k 0 = 0 k_0=0 k 0 = 0 . (boolean value; default : true)
bhz_plotcolor: Colour of the BHZ dispersion in the BHZ output file. It may be a single matplotlib color, a pair separated by a comma (separate colours for each block), or a triplet separated by commas (one block, other block, states without specific block). (default : red, blue, black, legacy value: red)
bhz_plotstyle: Style of the BHZ dispersion in the BHZ output file. It may be a single matplotlib line style, a pair separated by a comma (separate styles for each block), or a triplet separated by commas (one block, other block, states without specific block). Examples are solid, dashed, dotted.
Density of states
dos_interpolation_points: The minimal number of points on the horizontal axis for some DOS and Berry curvature (Hall conductivity) plots. When the calculated number of (k or b) points is smaller, then perform interpolation to at least this number. Must be an integer; if equal to 0, do not interpolate. (default : 100)
dos_convolution_points: The minimal number of points in the energy variable taken when applying a broadening function (a convolution operation) to an integrated DOS. If the energy range contains fewer points than this value, the integrated DOS is interpolated. Note that this value affects the ‘dummy variable’ of the convolution integral only, i.e., the internal accuracy of the (numerical) integration. The broadened integrated DOS (the result) will always be with respect to the same energies as the input. (default : 200)
dos_print_momentum_multiplier: The momentum range can be extended by using a multiplier that takes into account the part of momentum space not explicitly calculated. Examples: If only positive momenta are calculated, simulate the negative values by multiplying by 2; or, if in polar coordinates the calculation was done from 0 to 90 degrees angle, multiply by 4 for a full circle. This setting determines whether this multiplicative factor should be printed to the standard output. (boolean value; default : false)
dos_quantity: The quantity in which to express density of states. Prior to version v0.95, this was done using the command line arguments densitypnm, densityecm, etc. Possible values:
k: Occupied volume in momentum space; units 1 / n m d 1/\mathrm{nm}^{d} 1/ nm d (alias : momentum)
p: Density of particles/carriers (n n n or d n / d E dn/dE d n / d E ); units 1 / n m d 1/\mathrm{nm}^{d} 1/ nm d (default ; alias : n, particles, carriers, cardens)
s: Density of states (IDOS or DOS); units 1 / n m d 1/\mathrm{nm}^{d} 1/ nm d . The only difference with p is the way the quantities are labelled. (alias : dos, states)
e: Density of charge (σ \sigma σ or d σ / d E d\sigma/dE d σ / d E ); units e / n m d e/\mathrm{nm}^{d} e / nm d (alias : charge) (The exponent d d d in the unit is adjusted according to the dimensionality.)
dos_unit: The length units used for density of states. Prior to version v0.95, this was done using the command line arguments densitypnm, densityecm, etc. Possible values:
nm: Units of 1 / n m d 1/\mathrm{nm}^{d} 1/ nm d , e / n m d e/\mathrm{nm}^{d} e / nm d (default )
cm: Units of 1 / c m d 1/\mathrm{cm}^{d} 1/ cm d , e / c m d e/\mathrm{cm}^{d} e / cm d
m: Units of 1 / m d 1/\mathrm{m}^{d} 1/ m d , e / m d e/\mathrm{m}^{d} e / m d In the output, the density values are also scaled to a suitable ‘power of ten’. The exponent d d d in the unit is adjusted according to the dimensionality.
Self-consistent Hartree
selfcon_check_chaos_steps: Number of previous iterations used for the detection of chaotic behaviour. If this value is set to n n n , we say chaos occurs at iteration i i i if the previous V ( j ) V^{(j)} V ( j ) closest to V ( i ) V^{(i)} V ( i ) are more than n n n iterations ago, i.e., i − j > n i-j>n i − j > n . When chaos is detected, adjust the time step if selfcon_dynamic_time_step is set to true. (default : 4)
selfcon_check_orbit_steps: Number of previous iterations used for the detection of periodic orbits. We say a periodic orbit occurs at iteration i i i if the previous V ( j ) V^{(j)} V ( j ) closest to V ( i ) V^{(i)} V ( i ) show a regular pattern like j − i = 2 , 4 , 6 , 8 j-i=2, 4, 6, 8 j − i = 2 , 4 , 6 , 8 ; the value n n n set here is the minimum length of the regular pattern. When a periodic orbit is detected, adjust the time step if selfcon_dynamic_time_step is set to true. (default : 4)
selfcon_debug: Whether to enable debug mode for the self-consistent Hartree calculation. In debug mode, write temporary files and provide traceback for all exceptions (including KeyboardInterrupt) within the iteration loop, which is useful for debugging. If debug mode is disabled, then do not write temporary files and continue on SelfConError and KeyboardInterrupt exceptions. (boolean value; default : false)
selfcon_diff_norm: Method that defines a measure of convergence for the self-consistent calculation. This method is essentially a function applied to the difference of potentials of the last two iteration steps. The result, a nonnegative value, is compared to the convergence criterion. Possible values:
selfcon_erange_from_eivals: Whether to use the eigenvalues from first diagonalization result to determine the energy range used for calculating the density of states for the self-consistent calculation. If false, the energy range given in the command line is used instead. (boolean value; default : false).
selfcon_full_diag: Whether to use the full-diagonalization approach for the self-consistent Hartree calculation. If true, use the full-diagonalization approach that calculates all conduction band states to determine density as function of z z z . If false, use the standard mode that calculates bands around the charge neutrality point (CNP). The latter is significantly faster, but the results are based on an implausible assumption on the density at the CNP (boolean value; default : true)
selfcon_ll_use_broadening: Whether to enable broadening during self-consistent calculation in LL mode. This can lead to bad convergence behaviour (or no convergence at all, depending on selected broadening), but results in more accurate Hartree potentials for the given broadening. This does not affect the broadening applied to the main diagonalization/postprocessing after the self-consistent calculation has finished. (boolean value; default : false)
selfcon_use_init_density: Whether a uniform density profile (consistent with the total carrier density) is applied in the initialization of the self-consistent Hartree calculation. If enabled, calculate the potential and apply it to the Hamiltonian in the first iteration. If disabled, use the Hamiltonian with zero potential, unless an initial potential is loaded from a file. (boolean value; default : false)
Optical transitions
transitions_max_deltae: Maximum energy difference in meV of transitions, i.e., upper limit of the vertical axis (filtered transitions plot only). If set to 0, determine the vertical scale automatically. (default : 0)
transitions_dispersion_num: Number of transitions to include in the dispersion or B dependence (LL fan) plot. If set to n, the transitions with n highest transitions rates will be shown. If set to 0, show an unlimited number of transitions. (default : 4)
– gaussian: Gaussian function, scale parameter sigma, which is the standard deviation. (alias : gauss, normal)
– fermi: Fermi function (thermal distribution), scale parameter is energy. (alias : logistic, sech)
– thermal: Fermi function (thermal distribution), scale parameter is temperature.
The broadening functions for the absorption are the probability density functions for all of these choices; see Appendix § 11 .§ 9 for further information.
Colours and Colormaps
color_bindex: Colormap for band index. For band index only, the range of the observable is adjusted to the number of colours in the colormap. (default : tab21posneg; NOTE: for the ‘old’ set of colours, use tab20alt)
color_threehalves: Colormap for observables with range [ − 3 / 2 , 3 / 2 ] [-3/2, 3/2] [ − 3/2 , 3/2 ] (default : yrbc)
Figures
fig_matplotlib_style: Matplotlib style file for changing the properties of plot elements. This may be a file in the configuration directory ~/.kdotpy or in the working directory, or a built-in matplotlib style. (default : kdotpy.mplstyle)
fig_hsize, fig_vsize: Horizontal and vertical size of the figures, in mm. (default : 150, 100, respectively)
fig_lmargin, fig_rmargin, fig_bmargin, fig_tmargin: Figure margins (left, right, bottom, top), i.e., the space in mm between the figure edge and the plot area. (default : 20, 4, 12, 3, respectively)
fig_charlabel_space: Vertical space for the character labels in the dispersion plot, in units of the font size. To avoid overlapping labels, use a value of approximately 0.8 or larger. (default : 0.8)
fig_colorbar_space: Space reserved for the colour bar legend in mm (default : 30) In other words, this is the distance between the right-hand edges of the figure and the plot if a colour bar is present. It ‘replaces’ the right margin.
fig_colorbar_margin: Space between the right-hand edge of the plot and the colour bar legend, in mm. This space is taken from the colour bar space (set by fig_colorbar_width), so it does not affect the right-hand edge of the plot. (default : 7.5)
fig_colorbar_size: Width of the actual colour bar in mm (default : 4)
fig_colorbar_method: Way to place the colour bar; one of the following options:
insert: Take space inside the existing plot; keep the figure size, but decrease the plot size. (default )
extend: Add extra space; keep the plot size but increase the figure size.
file: Save into a separate file. The original figure is not changed.
fig_colorbar_labelpos: Method to determine the position of the label of the colour bar. One of the following options:
legacy: The ‘old’ method, using colorbar.set_label plus a manual shift.
xaxis: As label for the ‘x axis’, directly below the the colour bar.
yaxis: As label for the ‘y axis’, vertically up on the right-hand side.
center: Centred in the whole space allocated for the colour bar, including margins; very similar to ‘legacy’ for default settings of the colour bar size and margins. (default )
left: Left aligned with the left border of the colour bar.
fig_colorbar_abstwosided: Whether a shaded dual colour bar, where the vertical value is the absolute value of the observable, should show the observable itself, with values running from -max to max (if set to true; default). Otherwise show the absolute value, running from 0 to max. (boolean value; default : true)
fig_extend_xaxis: Relative extension of the horizontal plot range for dispersion and magnetic field dependence. For example, a value of 0.05 means 5% of the range is added left and right of the minimum and maximum x value (where x is k or B), respectively. This does not affect the range if the command line argument x range is used. Use 0 to not extend the plot range. The value may not be negative. (default : 0.05)
fig_inset_size: Size (width and height) of the inset legend in mm. Values smaller than 30 are not recommended. (default : 30)
fig_inset_margin: Space between inset edge and plot edge in mm. (default : 3)
One can use different choices for the horizontal and vertical axis, as follows:
fig_ticks_major=normal,fewer
One can use different choices for the horizontal and vertical axis, as follows:
fig_ticks_minor=fewer,none
Plot output
plot_dispersion_energies: Plot special energies, e.g., charge-neutrality point, Fermi energy/chemical potential at zero and finite density in dispersion plots. (boolean value; default : true)
plot_dispersion_parameter_text: Write an indication in the plot for constant parameter values, e.g., when plotting along k x k_x k x for a nonzero k y k_y k y value, write “For k y k_y k y = ”. (boolean value; default : true)
plot_dispersion_stack_by_index: If enabled, make sure the data with the lowest band or Landau-level index is shown on top, to make sure the ‘most interesting data’ (low-index states) is not obscured by ‘less interesting data’ (high-index states). Otherwise, the plot function uses the default plot stacking order: the data is then drawn simply in the order by which it is processed. (boolean value; default : false)
plot_dos_energies: Plot special energies, e.g., charge-neutrality point, Fermi energy/chemical potential at zero and finite density in density (DOS) plots. (boolean value; default : true)
plot_dos_units_negexp: Use negative exponents in DOS units in density plots. If set to true, write n m − 2 \mathrm{nm}^{-2} nm − 2 instead of 1 / n m 2 1/\mathrm{nm}^2 1/ nm 2 , for example. (boolean value; default : false)
plot_dos_vertical: Plot the (integrated) DOS sideways, so that energy is plotted on the vertical axis. The vertical scale will match the dispersion plot, so that these figures can be put side-by-side with a common axis. (boolean value; default : true)
plot_rasterize_pcolormesh: Whether to rasterize plot elements created with pcolormesh from matplotlib. This is used primarily for two-dimensional color plots with kdotpy ll when one uses quadratic stepping for the magnetic field values. Rasterization leads to improved performance both in creating the plots as well as in rendering them with a pdf viewer. The resolution can be controlled with the matplotlibrc parameters figure.dpi and savefig.dpi. If the old behaviour is desired, i.e., that the data is rendered as vector graphics, set the value of plot_rasterize_pcolormesh to false. (boolean value; default : true)
plot_rxy_hall_slope: Plot the Hall slope R x y = B / ( n e ) R_{xy} = B/(ne) R x y = B / ( n e ) , where B B B is magnetic field, n n n is density and e e e is electron charge, in the plots for R x y R_{xy} R x y (rxy–constdens.pdf) as a dashed line. (boolean value; default : true)
plot_sdh_markers: Whether to show markers for the period of the Shubnikov-de Haas (SdH) oscillations in the ‘constdens’ plot (both ‘normal’ and ‘SdH’ versions). The markers are placed at the values for which 1 / B 1/B 1/ B is a multiple of e / ( 2 π ℏ n ) e/(2\pi\hbar n) e / ( 2 π ℏ n ) , where n n n is the density. (boolean value; default : true)
plot_sdh_scale_amount: The maximum number of SdH oscillations to be shown in the SdH plot. If set to a nonzero value, the scale on the horizontal axis is magnified to this amount of SdH oscillations. The scale is never shrunk, so there may be fewer SdH oscillations on the axis. The ‘constden’ plot linear in B B B is unaffected. If set to 0 (default), do not scale the axis. A typical useful nonzero value is 20.
plot_wf_orbitals_order: Order of the orbitals in the legend, for wave function plot style ‘separate’. Possible choices:
standard (default ):
Γ 6 , + 1 / 2 Γ 8 , + 1 / 2 Γ 7 , + 1 / 2 \Gamma_{6,+1/2}\ \Gamma_{8,+1/2}\ \Gamma_{7,+1/2} Γ 6 , + 1/2 Γ 8 , + 1/2 Γ 7 , + 1/2 Γ 6 , − 1 / 2 Γ 8 , − 1 / 2 Γ 7 , − 1 / 2 \Gamma_{6,-1/2}\ \Gamma_{8,-1/2}\ \Gamma_{7,-1/2} Γ 6 , − 1/2 Γ 8 , − 1/2 Γ 7 , − 1/2 Γ 8 , + 3 / 2 Γ 8 , − 3 / 2 \Gamma_{8,+3/2}\ \Gamma_{8,-3/2} Γ 8 , + 3/2 Γ 8 , − 3/2
paired:
Γ 6 , + 1 / 2 Γ 6 , − 1 / 2 Γ 7 , + 1 / 2 \Gamma_{6,+1/2}\ \Gamma_{6,-1/2}\ \Gamma_{7,+1/2} Γ 6 , + 1/2 Γ 6 , − 1/2 Γ 7 , + 1/2 Γ 8 , + 1 / 2 Γ 8 , − 1 / 2 Γ 7 , − 1 / 2 \Gamma_{8,+1/2}\ \Gamma_{8,-1/2}\ \Gamma_{7,-1/2} Γ 8 , + 1/2 Γ 8 , − 1/2 Γ 7 , − 1/2 Γ 8 , + 3 / 2 Γ 8 , − 3 / 2 \Gamma_{8,+3/2}\ \Gamma_{8,-3/2} Γ 8 , + 3/2 Γ 8 , − 3/2
table:
Γ 8 , + 3 / 2 \Gamma_{8,+3/2} Γ 8 , + 3/2 Γ 6 , + 1 / 2 Γ 8 , + 1 / 2 Γ 7 , + 1 / 2 \Gamma_{6,+1/2}\ \Gamma_{8,+1/2}\ \Gamma_{7,+1/2} Γ 6 , + 1/2 Γ 8 , + 1/2 Γ 7 , + 1/2 Γ 6 , − 1 / 2 Γ 8 , − 1 / 2 Γ 7 , − 1 / 2 \Gamma_{6,-1/2}\ \Gamma_{8,-1/2}\ \Gamma_{7,-1/2} Γ 6 , − 1/2 Γ 8 , − 1/2 Γ 7 , − 1/2 Γ 8 , − 3 / 2 \Gamma_{8,-3/2} Γ 8 , − 3/2
For the six-orbital basis, the Γ 7 \Gamma_7 Γ 7 states are omitted.
plot_wf_zy_format: File format for wavefunction plots ∣ ψ ( z , y ) ∣ 2 \lvert\psi(z,y)\rvert^2 ∣ ψ ( z , y ) ∣ 2 . Possible choices:
pdf: Multi-page PDF if possible, otherwise separate PDF files. (default )
png: Separate PNG files.
pngtopdf: Separate PNG files are converted and merged into a multi-page PDF. Requires the ‘convert’ command to be available. (alias: png_to_pdf)
plot_wf_zy_bandcolors: Colour model for the wavefunction plots ∣ ψ ( z , y ) ∣ 2 \lvert\psi(z,y)\rvert^2 ∣ ψ ( z , y ) ∣ 2 separated by bands. Possible choices:
– hsl: Hue-saturation-lightness. The colour (hue) is determined by the relative content of the bands, the saturation and lightness by the density.
– hsv: Hue-saturation-value. Like hsl, the colour (hue) is determined by the relative content of the bands, the saturation by the density, and the value is equal to 1.
– rgb: Red-green-blue. The red, green, and blue channels are determined by the contents of the bands.
NOTE: This is not a colormap! For the absolute value without band content, use the colormap set by color_wf_zy.
plot_wf_zy_scale: Scaling method (colour scale normalization) for wavefunction plots ∣ ψ ( z , y ) ∣ 2 |\psi(z,y)|^2 ∣ ψ ( z , y ) ∣ 2 . Possible choices:
CSV output
Table output
table_data_label_style: Style for expressing data labels in generic two-dimensional csv output, such as density of states and Berry curvature. The label is positioned at the end of the first row with data. Possible choices: none (alias: false), raw, plain, unicode, tex (for details, see table_dispersion_unit_style below). If none, do not write a label. (default : plain)
table_data_unit_style: Style for expressing the unit in generic two-dimensional csv output. Possible choices: none (alias: false), raw, plain, unicode, tex (for details, see table_dispersion_unit_style below). If none, do not write a unit. Also, if table_data_label_style is set to none, this option is ignored and no unit is written. (default : plain)
table_dos_scaling: Whether to apply density scaling for csv output of densities. If false, use the native units (n m − 2 \mathrm{nm}^{-2} nm − 2 in two dimensions). Otherwise, use the same scaling as for plots. (boolean value; default : false)
table_dispersion_precision: Precision (number of decimals) for floating point numbers, for the dispersion csv files. Energy and momentum values may use a different number of decimals. (minimum: 2, default : 5)
table_dispersion_units: Whether to include units of the variables and observables in dispersion csv files. For a one-dimensional dispersion, these are included as second header row. For a multi-dimensional dispersion, the unit is added at the end of the first data row. (boolean value; default : true)
(default : plain)
NOTE: Even with raw or plain, there may still be some non-ASCII symbols, for example μ \mu μ .
table_dispersion_obs_style: Style for expressing observables/quantities. Possible choices: raw, plain, unicode, tex (see above). (default : raw)
For the archive options (tar, zip, etc.), the csv files are deleted if the archive has been written successfully; otherwise they are kept. Some options may be unavailable depending on the installed Python modules.
XML output
xml_omit_default_config_values: If set to true, do not save all configuration values to the XML output file, but only the ones that are set to a value different than the default value. Otherwise save all values (default ); this is recommended for reproducibility. (boolean value; default : false)
xml_shorten_command: If set to true, replace the script path in the <cmdargs> tag by kdotpy xx (where xx = 1d, 2d, etc.) if typing kdotpy on the command line refers to the kdotpy main script. For this, the main script (or a link to it) must be in the PATH environment variable; this is generally the case if kdotpy has been installed with pip. (boolean value; default : false)
Miscellaneous
berry_ll_simulate: Whether to use simulated Berry curvature (more accurately: Chern numbers) for Berry / Hall output, for kdotpy ll, instead of the calculated one. The calculated value may sometimes show artifacts that cannot be easily resolved by increasing number of eigenstates for example. The simulated Berry curvature (observable berrysim) is set to exactly 1 for all states at nonzero magnetic field. (boolean value; default : false) Hint: One may do a comparison by doing the calculation twice with settings true and false, respectively. The output is written to different file names as to ease the comparison.
NOTE: This configuration value is independent from the command line option tempout. The npz and hdf5 formats are meant for permanent data storage, the tempout files are only safe for immediate re-use and should not be used for long-term storage.
job_monitor_limit: If the number of data points is smaller than this value, show the full job monitor with information about the intermediate steps. Otherwise, show the simple in-line progress indicator. For the value 0, always show the simple progress indicator. (default : 101)
lattice_regularization: Enables or disables lattice regularization. The settings true and false correspond to the obsolete command-line arguments latticereg and nolatticereg, respectively. The recommended value and default value is false. Note that for older kdotpy versions (kdotpy v0.xx), the default value was true for compatibility reasons. (boolean value; default : false)
lattice_zres_strict: Enables or disable strict check of commensurability of z resolution with thickness of the layers, i.e., whether the thicknesses are integer multiples of the z resolution. If they are incommensurate, quit with an error if strict checking is enabled. If disabled, change the thicknesses to match the z resolution and raise a warning. (boolean value; default : true)
magn_epsilon: Numeric value that determines whether small values near zero need to be inserted if the grid contains magnetic fields. The value zero means disabling this feature. Otherwise, +/- the absolute value of magn_epsilon is inserted at either side of B = 0, whichever side (positive or negative) is included in the range. If negative, insert the values only if the range is two-sided. The motivation for including this option is to reduce some plot artifacts for ranges that contain positive and negative magnetic fields. For this option to be effective, it might also be necessary to set the split parameter to a small value. (default : -1e-4)
numpy_linewidth: Sets the (approximate) line width for NumPy array output. (This output is used in verbose mode mostly.) The value is passed to numpy.set_printoptions(). The value has to be an integer ≥ 0 \ge0 ≥ 0 . The output is always at least one column, so small values may be exceeded. (default : 200)
numpy_printprecision: The number of digits of precision for NumPy array floating point output. (This output is used in verbose mode mostly.) The value is passed to numpy.set_printoptions(). The value has to be an integer ≥ 0 \ge0 ≥ 0 . The number of digits shown does not exceed the number needed to uniquely define the values, e.g., 17 digits for 64-bit floating point numbers. (default : 6)
wf_locations_exact_match: If set to true (default ), the wave function locations should match the momentum/magnetic field values exactly. If no exact match is found, skip the location (‘old behaviour’). If set to false, find the nearest value to each location. (boolean value; default : true)
NOTE: Boolean configuration options may have the following values (not case sensitive):
For “True”: yes, y, true, t, 1, enabled, on
For “False”: no, n, false, f, 0, disabled, off
Command-line arguments
This command line reference lists the commands for the present version, kdotpy v1.0.0. We note that commands may change (sometimes only subtly) between versions. Thus, we recommend the user to refer to the wiki [34 ] and/or the built-in help for up-to-date information if a newer version is used. In the list below, we use the symbol # to indicate additional arguments. The bracketed [#] stands for an optional argument. The list is ordered thematically. Some commands have aliases which may be used instead of the listed command, with identical functionality. The input of the listed commands is case insensitive and ignores underscores, so that for example DOS may be used instead of dos and z_res instead of zres. The additional arguments are usually case sensitive. For example, in out -HgTe, the distinction between uppercase and lowercase is respected.
Options affecting computation
Modelling
Determine the model, i.e., the type of Hamiltonian that needs to be constructed.
norb #: Number of orbitals in the Kane model. The argument can be either 6 or 8, which means exclusion or inclusion, respectively, of the Γ 7 \Gamma_{7} Γ 7 orbitals. (Alias: orbitals, orb). Shorthand for norb 6: 6o, 6orb, 6orbital, 6band, sixband Shorthand for norb 8: 8o, 8orb, 8orbital, 8band, eightband NOTE: Omission of this input is not permitted.
lllegacy, llfull: Force Landau level mode to be ‘legacy’ or ‘full’. By default, the Landau level calculation uses either the symbolic mode ‘sym’ if possible or the full mode if necessary. The legacy mode may not be used if the full mode were required. By giving llfull, one may also use the full mode if the automatically chosen ‘sym’ mode does not give the desired results. Beware that full mode is much heavier on resources. (kdotpy ll and kdotpy bulk-ll)
Regularizations, degeneracy lifting, etc.
These options fine-tune the model.
ax: Use axial symmetry, i.e., the axial approximation. This is the default for Landau level mode (kdotpy ll and kdotpy bulk-ll). For dispersions, it is mandatory to provide either ax or noax. (Alias: axial)
isopzw: Use isoparity applied to the well layer only, like observable isopzw. While isopz is not a conserved quantity for asymmetric geometries (e.g., a well layer and two barriers with unequal thickness), isopzw can remain almost conserved in that case. Due to incomplete confinement in the well region, the eigenvalues may deviate significantly from ± 1 \pm1 ± 1 .
isopzs: Use isoparity applied to a region symmetric around the centre of the well layer, like observable isopzs. Like isopzw, the observable isopzs is also an almost conserved quantity for asymmetric geometries and tends to have eigenvalues closer to ± 1 \pm1 ± 1 , because it generally takes into account the decaying wave function in (a part of) the barriers.
cross: Momentum dependent splitting, with the quantization axis perpendicular to the in-plane momentum direction, i.e., ( k x S y − k y S x ) / ∣ k ∣ (k_xS_y-k_yS_x)/|\mathbf{k}| ( k x S y − k y S x ) /∣ k ∣ for k ≠ 0 \mathbf{k}\ne0 k = 0 . It is set to zero at k = 0 \mathbf{k}=0 k = 0 .
For the relevant observables, see Appendix § 11 .§ 8 .
bia: Include bulk inversion asymmetry. Note that combination of BIA with ‘split’ may cause unwanted asymmetries, for example under k z → − k z k_z\to-k_z k z → − k z . (For kdotpy 2d, kdotpy 1d, and kdotpy bulk)
ignoremagnxy: Ignore the in-plane components of the magnetic field in the gauge field (i.e., the ‘orbital field’). The in-plane components still have an effect through the Zeeman and exchange couplings even if this option is enabled. Enabling this option ‘simulates’ the calculation before the in-plane orbital fields were implemented, as of version v0.58 (kdotpy 1d) or v0.74 (kdotpy 2d), respectively. (Alias: ignoreorbxy, ignorebxy)
yconfinement #: Set a confinement in the y y y direction; local potential on the outermost sites, in meV. A large value (such as the default) suppresses the wave function at the edges, which effectively imposes Dirichlet boundary conditions (wave functions = 0). If the value is set to zero, the boundary conditions are effectively of Neumann type (derivative of wave functions = 0). Default: 100000 (meV). (Alias: yconf, confinement)
Diagonalization options
Options that affect the diagonalization, i.e., which energy eigenvalues are calculated from the Hamiltonian.
targetenergy # [# ...]: Energy (meV) at which the shift-and-invert Lanczos is targeted. If multiple values are given, then apply Lanczos at each of these energies (experimental feature). If large numbers of eigenvalues are to be calculated (e.g., 500), it may be faster to calculate multiple sets with a smaller number of eigenvalues (e.g., 5 sets of 150). Note that the values need to be chosen carefully. If there is no overlap between the intervals where eigenvalues are found, the calculation is aborted. For smaller numbers of eigenvalues, it is recommended to use a single value for targetenergy. (Alias: e0)
energyshift #: Shift energies afterwards by this amount (in meV). Other energy values may still refer to the unshifted energies. This is an experimental feature that should be used with care. In case one intends to merge data (e.g., using kdotpy merge), then one should avoid using this option for the individual runs. Afterwards, this option may be used with kdotpy merge. (Alias: eshift)
zeroenergy: Try to align the charge-neutral gap with E = 0 m e V E = 0\,\mathrm{meV} E = 0 meV . In combination with energyshift, align at that energy instead of 0 m e V 0\,\mathrm{meV} 0 meV . See also the warnings under energyshift.
bandalign [# [#]]: Try to (re)connect the data points, by reassigning the band indices. The first optional argument determines the ‘anchor energy’, i.e., the energy at k = 0 k = 0 k = 0 (or B = 0 B = 0 B = 0 ) that separates bands with positive and negative indices. If the second argument is given, treat the gap at the given energy as having this index. Omission of the first argument causes the anchor energy to be determined automatically. Explicit specification of this energy is necessary only if the automatic method appears to fail, or if the correct assignment of the band indices is important (e.g., for calculation density of states). When the second argument is omitted, use the default gap index 0. Alternatively, bandalign filename.csv may be used to use the energies in the csv file in order to do assign the band indices. The format is that of dispersion.byband.csv, i.e., energies of each of the bands in columns. This option may be used to manually ‘correct’ an incorrect band connection result. If the data is not sorted (as function of k k k or B B B ), then try to sort the data automatically before applying the band alignment algorithm. See also § 3.6 (Alias: reconnect) (For kdotpy merge, kdotpy 2d, and kdotpy ll)
System options
cpus #: Number of parallel processes to be used. Note that the processes do not share memory, so it should be chosen such that the total memory requirement does not exceed the available memory. Can also be set to value max, auto or automatic, for using all available cores; this is the default . For a single-core run, cpus 1 must be given explicitly. (Alias: cpu, ncpu)
Arguments that allow saving intermediate result from partially completed diagonalization runs, for example for saving calculation time in debugging. It saves the data container for each data point (called `DiagDataPoint), into a binary file that may be reloaded later. Do this only at own risk; read the warnings below.
resume #1 [#2]: Path to folder (#1) created by argument tempout during a previous kdotpy run. If a matching DiagDataPoint is found in this folder, it is restored into RAM and already processed calculation steps are skipped. Optionally, an integer step index (#2) may be specified to overwrite the step from which the
process is resumed. This can be used, e.g. to redo the postprocessing for each DiagDataPoint, if eigenvectors have been saved (see keepeivecs).
NOTE: Some command line arguments may be changed between runs (e.g., cpu and/or threads configuration) without affecting the validity of older DiagDataPoints for new runs. Apart from matching k and B values, there is no further automatic validation.
NOTE: The binary file format is not a suitable research data format. Compatibility between different versions of kdotpy is not guaranteed.
NOTE: These files should be used for temporary storage and immediate re-use only. This is not a suitable data format for long-time storage. Compatibility between different versions of kdotpy is not guaranteed. For permanent storage of eigenvectors, enable the configuration option diag_save_binary_ddp. See also the security warnings for the pickle module.
HINT: Usage suggestions are resuming a preemptively cancelled job (e.g., due to walltime limit, out of resources, etc), and testing or debugging restartable from partial solutions in order to save calculation time.
See also system options related to output, Appendix § 13 .7.
Density of states, electrostatics, etc.
Post-processing functions
dos: Plot density of states and integrated density of states. The Fermi energy and chemical potential are also indicated in the plots and printed to stdout, if their calculation has been successful. The range of validity is shown in red: In the shaded regions, additional states (typically at larger momentum k k k ) are not taken into account in the present calculation and may cause the actual DOS to be higher than indicated. The validity range typically grows upon increasing the momentum range (argument k k k ). For kdotpy ll, dos will generate equal-DOS contours and put them in the LL plot. This is done either at a number of predefined densities, or at the density given by cardens. For this script, also plot the total DOS, and the ‘numeric DOS’ (roughly the number of filled LL).
localdos: For kdotpy 2d, plot the ‘local DOS’, the momentum-dependent density of states. For kdotpy ll, plot the equivalent quantity, DOS depending on magnetic field. For kdotpy ll, additionally plot the ‘differential DOS’, the integrated DOS differentiated in the magnetic field direction.
banddos: For kdotpy 2d and kdotpy bulk, output the DOS by band. One obtains two csv files, for DOS and IDOS, respectively. Each column represents one band. (Alias: dosbyband)
byblock: For kdotpy 2d and kdotpy ll, in combination with dos. Give density of states where all states are separated by isoparity value (P ~ z = ± 1 \tilde{P}_z = \pm1 P ~ z = ± 1 ). Note: By nature, this function does not take into account spectral asymmetry of the individual blocks. (Alias: byisopz)
densityz: For kdotpy ll, plot density as function of z z z at the Fermi level, for all values of the magnetic field B. The output is a multipage pdf file and a csv file with z z z and B values over the rows and columns, respectively. The output is for one carrier density only.
Self-consistent Hartree
selfcon [# [#]]: Do a selfconsistent calculation of the electrostatic potential (“selfconsistent Hartree”). This method solves the Poisson equation iteratively, taking into account the occupied states in the well. This option also provides plots of the density as function of z z z and of the potential. Two optional numerical arguments: maximum number of iterations (default: 10) and accuracy in meV (default: 0.01)
selfconweight #: Use this fractional amount to calculate the new potential in each iteration of the self-consistent Hartree method. This has to be a number between 0 and 1. The default value is 0.9. It may be set to a smaller value in case the iteration goes back and forth between two configurations, without really converging. A small number also slows down convergence, so the number of iterations may need to be increased. (Alias: scweight, scw)
Potentials
The following options define a background potential that affects the calculation of the dispersion and/or the self-consistent Hartree calculation.
vtotal #: Add a potential difference between top and bottom of the whole layer stack. The value is in meV and may be positive as well as negative. (Alias: v_outer, vouter)
vwell #: Add a potential difference between top and bottom of the ‘well region’. The value is in meV and may be positive as well as negative. (Alias: v_inner, vinner)
vsurf # [# [#]]: Add a surface/interface potential. The first argument is the value of the potential at the interfaces (barrier-well) in meV. The second parameter determines the distance (in nm) for which the potential decrease to 0 (default: 2.0). If the latter argument is q (alias: quadr, quadratic), then the potential has a parabolic shape. Otherwise, the decrease to 0 is linear. (Alias: vif)
potential ## [# ...]: Read potential from a file. The file must be in CSV format, i.e., with commas between the data values. The columns must have appropriate headings; only z z z and potential are read, whereas other columns are ignored. If the z z z coordinates of the file do not align with those of the current calculation, then values are found by linear interpolation or extrapolation. If extrapolation is performed, a warning is given.
The first argument must be a valid file name. The following arguments may be further filenames, and each filename may be followed by a number, interpreted as multiplier. For example, potential v1.csv -0.5 v2.csv will yield the potential given by V ( z ) = − 0.5 V 1 ( z ) + V 2 ( z ) V(z)=-0.5V_1(z)+V_2(z) V ( z ) = − 0.5 V 1 ( z ) + V 2 ( z ) . Multiple arguments potential are also allowed; the results are added. Thus, the sequence of arguments ... potential v1.csv -0.5 ... potential v2.csv ... is equivalent to the previous example.
cardens # [# / #]: Carrier density in the well in units of e / n m 2 e/\mathrm{nm}^2 e / nm 2 . This value sets the chemical potential, i.e., “filling” of the states in the well. The sign is positive for electrons and negative for holes. In combination with kdotpy ll ... dos, specify the density at which the equal-density contour should be drawn. (See dos above.) The argument may also be a range (# # / #; this affects most (but not all) postprocessing output functions. If omitted, the default range is equivalent to -0.015 0.015 / 30 (i.e., − 1.5 × 10 12 -1.5 \times10^{12} − 1.5 × 1 0 12 to 1.5 × 10 12 1.5 \times10^{12} 1.5 × 1 0 12 e / c m 2 e/\mathrm{cm}^2 e / cm 2 in steps of 10 11 10^{11} 1 0 11 e / c m 2 e/\mathrm{cm}^2 e / cm 2 ).
(Alias: carrdens, carrierdensity, ncarr, ncar, ncarrier)
ndepletion # [#]: Density of the depletion layer(s) in the barrier, in units of e / n m 2 e/\mathrm{nm}^2 e / nm 2 . The sign is positive for holes and negative for electrons. The whole sample is neutral if the arguments cardens and ndepletion come with the same value. If one value is specified, the charge is equally divided between top and bottom barrier. If two values are specified, they refer to bottom and top layer, consecutively. (Alias: ndepl, ndep)
ldepletion # [#]: Length (thickness) of the depletion layers in mm. The values may be numbers > 0 > 0 > 0 or inf or - for infinite (which means zero charge volume density). The numbers refer to the bottom and top barrier, respectively. If a single value is given, use the same value for both bottom and top barrier. The default (if the argument is omitted) is infinity. (Alias: ldepl, ldep)
efield # #: Electric field at the bottom and top of the sample in m V / n m \mathrm{mV}/\mathrm{nm} mV / nm . Alternatively, one may enter a single value for either the top or the bottom electric field:
efield -- #, efield top #, efield t #, efield # top, etc. (top)
efield # --, efield btm #, efield b #, efield # btm, etc. (bottom)
If the variant with two values is used, the carrier density is calculated automatically. In that case, the explicit input of the carrier density (option cardens) is not permitted.
NOTE: efield 0 # is not the same as efield -- #.
NOTE: A positive electric field at the top boundary corresponds to a negative gate voltage, and vice versa.
Input like a Python dict instance without any spaces: "{’v1’:5,’z1’:-10.,’v2’:7,’z2’:10.}" All boundary names must be given explicitly, the order is irrelevant.
Input single quantities as string separated with semicolon without any spaces: "v1=5;z1=-10.;v2=7;z2=10." All boundary names must be given explicitly, the order is irrelevant.
Input quantity pairs as string separated with semicolon without any spaces: Either explicit: ’v1[-10.]=5;v2[10.]=7’ Or implicit: ’v[-10.]=5;v[10.]=7’ When using the explicit format, the order is irrelevant. When using the implicit format there is an internal counter, which applies an index to the quantity name, thus, the order does matter.
Here, all given examples will result in the same boundary condition dictionary: {’v1’:5,’z1’:-10.,’v2’:7,’z2’:10.} The z z z values must be given as coordinate in nm, or as one of the following labels:
bottom: Bottom end of the layer stack
bottom_if: Bottom interface of the “well” layer
mid: Center of the “well” layer
top_if: Top interface of the “well” layer
top: Top end of the layer stack
If less than 4 key-value pairs are given, only the corresponding values of the automatically determined boundary conditions are overwritten. The ones that do not appear in the automatic determined boundary conditions, are ignored. This also means, you can decide to only overwrite the z z z -coordinates but keep the automatic determined values for v1, v2, etc. If two full boundary conditions are given (4 or 5 key-value pairs), automatic boundary conditions are always fully overwritten.
NOTE: A special case for the implicit type 3 input is v12. The input v[-10.,10.]=0;v[0.]=7 for example, yields {’v12’:0,z1’:-10.,’z2’:10.,’v3’:7,’z3’:0.}. Another special case for the same input type is the combination of dv1 and v1 (or dv2 and v2). Here you can use dv[-10.]=0;v[-10.]=7 (or `v[-10.]=7;dv[-10.]=0); note the same z z z coordinates.
Broadening options
The following options affect the broadening applied to the density of states. A combination of options is possible, in particular also using multiple instances of broadening and berrybroadening. See § 3.7.7 and Appendix § 11 .§ 9 for details and some physical background.
broadening [#1 #2 ...]: Broadening parameter for the density of the eigenstates (for kdotpy ll: Landau levels). The broadening is determined by a numerical width parameter w 1 w_1 w 1 which may be supplemented by additional parameters, the broadening shape, the scaling function, and a parameter for the Berry broadening (the latter for kdotpy ll only). The broadening types are:
thermal: Fermi distribution, width parameter is temperature; if the width parameter is omitted, use the temperature set by temp.
fermi: Fermi distribution, width parameter is energy (alias : logistic, sech)
gauss: Gaussian distribution, width parameter is energy (alias : gaussian, normal)
lorentz: Lorentzian distribution, width parameter is energy (alias : lorentzian)
If omitted, use the default auto which selects thermal for dispersion mode and gauss for LL mode. The scaling function determines how the width w w w scales as function of x x x (momentum k k k in n m − 1 \mathrm{nm}^{-1} nm − 1 or field B B B in T) (w 1 w_1 w 1 is the input width parameter):
auto: Use const for dispersion mode and sqrt for LL mode (alias: automatic)
const: Use constant width, w = w 1 w = w_1 w = w 1
lin: The width scales as w = w 1 x w = w_1 x w = w 1 x (alias: linear)
sqrt: The width scales as w = w 1 x w = w_1\sqrt{x} w = w 1 x
cbrt: The width scales as w = w 1 x 3 w = w_1\sqrt[3]{x} w = w 1 3 x
n ^ \hat{n} n ^ : Where n n n is a number (integer, float, or fraction like 1/2). The width scales as w = w 1 x n w = w_1x^n w = w 1 x n .
The final optional value (kdotpy ll only) is numeric (floating point number or a percentage like 10%) that defines a different broadening width for the Berry curvature/Hall conductivity. Floating point input is interpreted as the broadening width itself, a percentage defines this broadening width as percentage of the density broadening width. The Berry/Hall broadening inherits the shape and scaling function from the density broadening.
Multiple broadening arguments may be combined; these will then be iteratively applied to the (integrated) DOS, in the given order. See § 3.7.7 and Appendix § 11 .§ 9 for details.
NOTE: Due to limitations of the numerical integration (convolution operation), combining multiple broadening functions may lead to larger numerical errors than a single broadening function. The convolution operation is commutative only up to numerical errors, so changing the order may lead to slight differences in the result.
Examples:
broadening 2 thermal const: A thermal broadening with width of T = 2 T = 2 T = 2 K, constant in momentum k k k . This is the default shape and scaling for dispersion mode.
broadening 2 gauss sqrt: A Gaussian broadening of width 2 meV at 1 T scaling proportionally to B \sqrt{B} B . This is the default shape and scaling for LL mode.
broadening 2: For dispersion mode, equivalent to broadening 2 thermal const. For LL mode, equivalent to broadening 2 gauss sqrt.
broadening 2 10%: In LL mode, set the Berry/Hall broadening width to 10% of that of the density broadening. That is, for the Berry/Hall broadening, the parameters are effectively 0.2 gauss sqrt.
berrybroadening [#] [#] [#]: Broadening parameter for the Berry curvature/Hall conductivity. The syntax is the same as the ordinary broadening parameter. Also multiple ones can be combined. Note that it is not permitted to combine berrybroadening with a broadening with argument with an extra numerical argument (for example broadening 0.5 gauss 10%). For kdotpy ll only. (Alias: hallbroadening, chernbroadening)
dostemp #: Temperature used for thermal broadening of the DOS. This argument is equivalent to the setting broadening # thermal const (but only one of these may be used at a time). This temperature may be different than the temperature set by temp on the command line (which controls the temperature in the exchange coupling, for example). If neither dostemp nor broadening is given, no broadening is applied. If both dostemp and broadening are given, the setting for broadening takes priority. This option is especially useful for calculating the DOS with kdotpy merge and kdotpy compare: In that case, temp has no effect, because the value is read from the data files, whereas dostemp can be used to set the thermal broadening.
Additional options
The following options affect calculations of the density of states, self-consistent Hartree, etc.
ecnp #: Set charge-neutral energy (zero density) to this energy. The value determines the point where the density is zero. This affects integrated density of states in dispersion mode only. In order to manipulate band indices by determining the zero gap, use the bandalign argument. (Alias: cnp, efermi, ef0)
densoffset #: Set a density offset. Basically, this number is added to the integrated DOS / carrier density in the selfconsistent calculation. The value is in units of charge density and can be interpreted as free carriers inside the quantum well. (Alias: noffset, ncnp)
Output options
dosrange [#1] #2: Plot range of integrated density plots. If just one value n max = # 2 n_{\max} = \#2 n m a x = #2 is given, use [ 0 , n max ] [0,n_{\max}] [ 0 , n m a x ] for densities and [ − n max , n max ] [-n_{\max},n_{\max}] [ − n m a x , n m a x ] for integrated densities. Omission means that the plot range is determined automatically. If a density unit is given, e.g., densityenm, the values are interpreted in the quantity being plotted. Here, large numbers (> 1000 > 1000 > 1000 ) are interpreted as having units of c m − 1 \mathrm{cm}^{-1} cm − 1 , c m − 2 \mathrm{cm}^{-2} cm − 2 , or c m − 3 \mathrm{cm}^{-3} cm − 3 and small numbers as n m − 1 \mathrm{nm}^{-1} nm − 1 , n m − 2 \mathrm{nm}^{-2} nm − 2 , or c m − 3 \mathrm{cm}^{-3} cm − 3 (with the appropriate dimension). (Alias: densityrange, dosmax, densitymax)
NOTE: Most of these functions are available only for a limited number of kdotpy scripts.
Pre-diagonalization
The option legend will include a legend in these plots (recommended). (Alias: plotqz)
Using wave functions or eigenvectors
Functions that derive extra data based on the eigenvectors.
overlaps: Calculate overlaps between the eigenstates with those at zero momentum. By default, the overlaps are calculated with ∣ E 1 ± ⟩ \lvert E1\pm\rangle ∣ E 1 ± ⟩ , ∣ H 1 ± ⟩ \lvert H1\pm\rangle ∣ H 1 ± ⟩ , ∣ H 2 ± ⟩ \lvert H2\pm\rangle ∣ H 2 ± ⟩ , and ∣ L 1 ± ⟩ \lvert L1\pm\rangle ∣ L 1 ± ⟩ . A nice visualization can be obtained with obs subbandrgb, which assigns colours depending on the overlaps with E1, H1, and H2. A visualization with different bands can be obtained by using obs subbandh1e1e2, for example, where the observable id ends with ≥ 3 \ge3 ≥ 3 pairs of subband identifiers. Each subband identifier is a band character (e, l, or h followed by a number) denoting a pair of subbands, a single subband (the previous followed by + or −), or a band index (a signed integer preceded by b or parenthesized, e.g., b+2, (−25)). See also observables, Appendix B.5 (kdotpy 2d and kdotpy l1)
transitions [#1 #2] [#3]: Calculate and plot transitions between levels. There can be up to 3 optional numerical arguments: The first pair is the energy range where transitions are calculated. If omitted, calculate transitions between all calculated states (which may be controlled with neig and targetenergy). The last argument is the square-amplitude threshold above which the transitions are taken into account. If omitted, the program uses the default value 0.05.
berry: Calculate and plot the Berry curvature for the states close to the neutral gap. Also plot the integrated Berry curvature as function of energy. If combined with the option dos, then also plot the integrated Berry curvature as function of density. For LL mode (kdotpy ll), the Berry curvature is implicitly integrated, and the resulting output values are the Chern numbers of the eigenstates instead.
hall: Shortcut that activates all options for calculation of Hall conductivity with kdotpy ll. It is equivalent to the combination berry dos localdos broadening 0.5 10%. The default value of the broadening can be overridden with the explicit option broadening # [#] combined with hall. See also options for density of states and broadening, Appendix § 13 .2.
Post-diagonalization (postprocessing)
The postprocessing functions rely predominantly on the eigenvalues (dispersion).
extrema: Output the local extrema of each subband. The output contains the type (min or max), the momentum, the energy, and an estimate for the effective inertial mass along the momentum direction. (kdotpy 2d and kdotpy bulk; Alias: localminmax, mimaxlocal)
symmetrytest: Analyze the symmetries of the eigenvalues and observables under various transformations in momentum space. This results in a list of compatible representations of the maximal point group O h O_h O h , from which the program tries to determine the actual symmetry group (point group at the Γ \Gamma Γ point).
NOTE: For a reliable result, the momentum grid must be compatible with the symmetries; a cartesian grid should be used for cubic symmetry, a polar or cylindrical grid otherwise.
For kdotpy 2d, kdotpy bulk: full analysis. For kdotpy 1d, kdotpy merge: partial analysis (full analysis to be implemented).
symmetrize: Extend the data in the momentum space by symmetrization. For example, a 1D range for positive k k k can be extended to negative k k k , or a 2D range defined in the first quadrant can be extended to four quadrants. The extension is done by taking the known eigenvalues and observables and transforming them appropriately.
NOTE: The algorithm relies on some pre-defined transformation properties of the observables, and should be used with care. A cross-check with a symmetric range and symmetrytest is advised.
(kdotpy 1d, kdotpy 2d, and kdotpy bulk, kdotpy merge)
kbhz #: Set the reference momentum for the BHZ (Löwdin) expansion. The argument refers to a momentum value on the k x k_x k x axis. This experimental option can be used for expansions around nonzero momentum. Please consider the results with care, as they are not always meaningful. See also § 3.9.4 . (Alias: bhzk, bhzat)
Definition of the layer stack
lbarr #1 [#2]: Thickness of the barrier layers in nm. If one thickness is given, assume this value for both barrier layers (bottom and top). If two thicknesses are given, the first and second argument refer to the bottom and top layer, respectively. The input lbarr #1 lbarr #2 is equivalent to lbarr #1 #2. (Alias: lbar, lbarrier, bar, barr, barrier)
llayer #1 [#2 ...]: Thicknesses of the layers in nm. The number of layers may be arbitrary, but the number of thicknesses must always be equal to the number of materials. This argument may not be combined with lwell and lbarr. (Alias: llayers, layer, layers, thickness, thicknesses, thicknesses, thick)
msubst #1 [#2]: Material for the substrate. This only sets the lattice constant which is used to calculate strain. If this argument is omitted, the strain is taken from the strain or the alattice argument. (Alias: msub, substrate, msubstrate)
(Alias: ltype, lstack)
NOTE: Some functions will work properly only if there is exactly one ‘well’ layer.
ldens #1 [#2 ...]: For each layer, the ‘background density’ of charge, for example doping. There need to be as many values as there are layers. The values are expressed in e / n m 2 e/\mathrm{nm}^{2} e / nm 2 . (Alias: layerdens, layerdensity)
Each material instance is a material id or compound (e.g., HgMnTe, HgCdTe), optionally followed by extra numerical arguments that define the composition. The composition can either be specified as part of the compound (chemical formula) or as these extra arguments. Fractions and percentages are both accepted. Thus, all of the following are equivalent: HgMnTe 2%, HgMnTe 0.02, HgMn0.02Te, Hg0.98Mn0.02Te, HgMn2%Te, HgMn0.02 _{0.02} 0.02 Te, etc.
The chemical formulas (or material ids) are case sensitive, which eliminates ambiguity.
Material parameters
matparam #: Modify the material parameters. The argument can either be a materials file or a sequence of parameter=value pairs. For the latter, multiple parameters must be separated by semicolons (;) and must be preceded by the material identifier, like so: matparam ’HgTe:gamma1=4.1;gamma2=0.7;CdTe:gamma1=1.6’
Spaces are ignored and the colon (:) after the material may be replaced by period (.) or underscore (_). The argument must be quoted in the shell if it contains spaces. The material need not be repeated for subsequent parameters, so that in the example, gamma2 refers to the material HgTe. The values may be Python expressions, but restrictions apply (see Appendix § 11 .2 for information for material parameter files). Note that all expressions must resolve to numerical values in order for kdotpy to run successfully. Multiple matparam arguments will be processed in order of appearance on the command line. (Alias: materialparam)
Other geometrical parameters
zres #: Resolution in the z z z direction in nm. (Alias: lres)
width #: Width of the sample (in the y y y direction. If a single number is given, this determines the width in nm. If the argument is given as #1*#2 or #1 * #2, where #1 is an integer, then the sample has #1 sites in the y y y direction spaced by a distance of #2 nm each. If the argument is given as #1/#2 or #1 / #2, then the total width is #1 and the resolution #2. (Alias: W)
yres #: Resolution in the y y y direction in nm. (Alias: wres)
linterface #: Smoothing width of the interface in nm. (Alias: interface)
periodicy: Enables periodic boundary conditions in the y y y direction. (Only applies to 1D geometry.)
stripangle #: Angle in degrees between the translationally invariant direction of the strip (or ribbon) and the (100) lattice vector (kdotpy 1d only). Default: 0 (Alias: ribbonangle)
stripdir #: Direction of the translationally invariant direction of the strip/ribbon in lattice coordinates. The argument may be a lattice vector, e.g., 130 for (1,3,0) or any of x, y, xy, and -xy (equivalent to 0, 90, 45, and -45 degrees). Only one argument stripangle or stripdir should be given. (Alias: ribbondir)
radians: Use radians for angular coordinate values. If omitted, use degrees (default ).
orientation # [#] [#]: Orientation of the lattice, see also § 3.3.6 and Appendix § 11 .§ 3 . (Alias: orient)
Possible patterns (#ang and #dir denote angles and direction triplets, respectively):
#ang: Rotation around z z z (like stripangle)
#ang #ang: Tilt z z z axis, then rotate around z z z axis
#ang #ang #ang: Euler rotation z , x , z z,x,z z , x , z . Rotate around c c c axis, tilt z z z axis, rotate around z z z axis.
#dir: Longitudinal direction x x x (like stripdir)
#dir #dir: Longitudinal and growth direction x , z x,z x , z
#dir #dir #dir: Longitudinal, transversal, and growth direction x , y , z x,y,z x , y , z .
#dir #ang or #ang #dir: Growth direction z z z and rotation around z z z .
Format for the inputs: For angles #ang, enter an explicit floating point number containing a decimal sign (period .). Integer values (for example 45 degrees) can be entered as 45., 45.0, 45d, or 45°. Direction triplets (#dir) are a triplet of digits without separators and possibly with minus signs (e.g., 100, 111, 11-2, -110) or numbers separated by commas without spaces (e.g., 1,1,0 or 10,-10,3).
If orientation is combined with stripangle or stripdir, the latter are ignored.
NOTE: If multiple #dir inputs are given, they must be orthogonal directions. If the inner product between any pair of them is nonzero, an error is raised.
NOTE: With the option orientation, the program uses an alternative construction method for the Hamiltonian, which may cause the time consumption by this step to increase by a factor of approximately 4. There is no exception for trivial orientations, like orientation - 001, which still invokes the alternative construction method.
Other physical parameters
External parameters
temp #: Temperature in K. The temperature affects the gap size (band edges) and the Mn exchange coupling. Optionally, it sets the thermal broadening of the density of states if the argument ‘broadening thermal’ (without value) is given, see Appendix § 13 .2.
NOTE: Thermal broadening is not implied by temp. In order to apply thermal broadening, specifying broadening thermal or dostemp is required, see Appendix § 13 .2 for more information.
Specification of strain
strain # [# #]: Set strain value. The value may be set as a number or percentage (e.g., -0.002 or -0.2%). The value is interpreted as the ‘relative strain’ ε = ( a s t r a i n e d / a u n s t r a i n e d ) − 1 \varepsilon= (a_{\mathrm{strained}}/a_{\mathrm{unstrained}}) - 1 ε = ( a strained / a unstrained ) − 1 , where a u n s t r a i n e d a_{\mathrm{unstrained}} a unstrained refers to the well material. (In layer stacks with more than three layers, the well may not be identified, and then this option cannot be used. Setting strain none is equivalent to ignorestrain. It is also possible to specify more than one argument; then the values are interpreted as ε x x , ε y y , ε z z \varepsilon_{xx}, \varepsilon_{yy}, \varepsilon_{zz} ε xx , ε y y , ε z z . It is possible to enter - for one or two values; then the strain values corresponding to these components are determined from the other one(s). If strain is used together with ignorestrain, the latter has priority, i.e., no strain is applied.
NOTE: Exactly one of the three options msubst, alattice, and strain must be used at once.
Options affecting plots
Observables
obs #: Use observable # (see Appendix § 11 .§ 8 for the colouring of the plot. It must be one of the available observables in the data files. There is a special case orbitalrgb, which colours the states with RGB colours determined by the gamma6, gamma8l, gamma8h expectation values. In kdotpy compare, using obs will leave only the markers to distinguish the data sets; without obs, distinct markers and colours are used.
obsrange [#] #: Minimum and maximum value of the observable that determines the colour scale. If one value is given, it is the maximum and the minimum is either 0.0 or the minus the maximum, which is determined by whether the standard scale is symmetric or not. If this option is omitted, use the predefined setting for the colour scale (recommended). (Alias: orange, colourrange, colourrange)
dimful: Use dimensionful observables. Some observables, for example z and y, are dimensionless by default, and this option changes them to observables with a dimension (for example length in nm). This option affects output data (xml and csv) and graphics. (Alias: dimfull)
orbitalobs: Calculate the observables orbital[j], that is the squared overlaps of the eigenstates within orbital number j, where j runs from 1 to n o r b n_{\mathrm{orb}} n orb (the number of orbitals). (For kdotpy 2d only.) (Alias: orbitaloverlaps, orbobs, orboverlaps)
llobs: Calculate the observables ll[j], that is the squared overlaps of the eigenstates within Landau level j j j , where j j j runs from -2 to llmax (the largest LL index). This option is available for kdotpy ll in full LL mode only. (Alias: lloverlaps)
Data and plot range
erange #1 #2: Energy range, minimum and maximum value in meV. The energy range determines the vertical plot range in plots. It is also used as range for density of states calculations. For Landau level calculations, states outside the energy range are not saved in the B dependence data file.
Plot style
Upon omission, the default value is auto.
Other plot elements, style, etc.
title #: Assign plot title. One may use {var} to substitute the variable named var. In order to find out which are the available variable names (keys), use title ? to get a list. The format syntax follows Python’s string format function, including the format specification “Mini-Language”12 . Here, only named variables can be specified. Positional ones, like {0} or {1} are not permitted. Some special variable names are:
llayer(#): For layer properties, append parenthesized integer index (n), e.g., llayer(1), for the property of the n’th layer.
b_x, b_y, b_z: Cartesian vector components
b_phi, b_theta: Angular coordinates of a vector in degrees
b_len, b_abs: Vector length (len and abs are equivalent)
(Alias: plottitle)
NOTE: left and right are synonyms to top left and top right NOTE: Double words can be with hyphen (top-center), underscore (top_center), space ("top center"; quotes are usually needed) or be joined (topcenter). NOTE: e, east, w, west are not legal values (Alias: plottitlepos, titleposition, plottitleposition)
System options
out #: Determines the names of the output files. For example, if the argument is 1, the program produces output1.xml, plot1.pdf, etc. This option also uses variable substitution using Python’s string format function; see command plottitle above. (Alias: outfile, outid, outputid, outputname)
outdir #: Name of the output directory. If the directory does not exist, try to create it. If omitted, try to write to the subdirectory data if it exists, otherwise in the current directory. (Alias: dir, outputdir)
See also Appendix C.1 for system options related to calculations.