Skip to main content

caroli_model/
presets.rs

1//! Ready-made models.
2
3use crate::gamma::*;
4use crate::{CMat, Model, c64, combine};
5use caroli_lattice::Lattice;
6
7/// Parameters of the BHZ model of a HgTe/CdTe quantum well, discretised on a square lattice.
8///
9/// Energies are in units of `A/a`; the defaults are the normalised HgTe values of the thesis
10/// (`A/a` = 72.9 meV with A = 364.5 meV·nm, a = 5 nm): inverted regime, `mass < 0`.
11#[derive(Clone, Copy, Debug, PartialEq)]
12pub struct BhzParams {
13    /// Linear term `A` (`A sin k_x`, `A sin k_y`); 1 with the defaults, the energy unit.
14    pub a: f64,
15    /// Mass curvature `B`: the mass is `M − B k²` near `k = 0`.
16    pub b: f64,
17    /// Energy offset `C`.
18    pub c: f64,
19    /// Curvature `D` common to both orbitals: `C − D k²` near `k = 0`.
20    pub d: f64,
21    /// Mass `M` at `k = 0`; the bands are inverted for `M/B > 0`, as with the defaults.
22    pub mass: f64,
23    /// Inter-spin-block spin-orbit coupling.
24    pub lambda: f64,
25}
26
27impl Default for BhzParams {
28    fn default() -> Self {
29        Self { a: 1.0, b: -0.376406, c: 0.0, d: -0.280933, mass: -0.137, lambda: 0.0 }
30    }
31}
32
33/// BHZ model on a square lattice (constant 1), basis `(E1↑, H1↑, E1↓, H1↓)`, as in the thesis
34/// codes (`ti.f90`, 2014 and later):
35///
36/// - on-site: `(C − 4D) Γ0 + (M − 4B) Γ55`
37/// - hopping `+x`: `D Γ0 + B Γ55 − (i/2)(A Γ33 − λ Γ13)`
38/// - hopping `+y`: `D Γ0 + B Γ55 + (i/2)(A Γ44 − λ Γ14)`
39pub fn bhz(p: BhzParams) -> Model {
40    let r = |x: f64| c64::new(x, 0.0);
41    let i = |x: f64| c64::new(0.0, x);
42    let onsite = combine(&[(r(p.c - 4.0 * p.d), &gamma0()), (r(p.mass - 4.0 * p.b), &gamma55())]);
43    let tx = combine(&[
44        (r(p.d), &gamma0()),
45        (r(p.b), &gamma55()),
46        (i(-0.5 * p.a), &gamma33()),
47        (i(0.5 * p.lambda), &gamma13()),
48    ]);
49    let ty = combine(&[
50        (r(p.d), &gamma0()),
51        (r(p.b), &gamma55()),
52        (i(0.5 * p.a), &gamma44()),
53        (i(-0.5 * p.lambda), &gamma14()),
54    ]);
55    Model::new(Lattice::square(1.0, 4)).onsite(0, onsite).hopping(0, 0, [1, 0, 0], tx).hopping(
56        0,
57        0,
58        [0, 1, 0],
59        ty,
60    )
61}
62
63/// Exchange coupling of a classical moment to the BHZ electrons.
64#[derive(Clone, Copy, Debug, PartialEq, Eq)]
65pub enum GFactors {
66    /// `g_E = g_H`: `n·s` (the thesis "ferro", `ge=gh`).
67    Same,
68    /// `g_E = −g_H`: `n·s τ_z` (the thesis "antiferro", `ge=-gh`).
69    Opposite,
70}
71
72/// Spin matrices `(S_x, S_y, S_z)` coupled to a classical moment in the BHZ basis:
73/// `(s_x, s_y, s_z)` for same-g, `(s_x τ_z, s_y τ_z, s_z τ_z)` for opposite-g.
74pub fn bhz_spin(coupling: GFactors) -> [CMat; 3] {
75    match coupling {
76        GFactors::Same => [gamma23(), gamma31(), gamma12()],
77        GFactors::Opposite => [gamma23p(), gamma31p(), gamma12p()],
78    }
79}
80
81/// Exchange matrix `J (n_x S_x + n_y S_y + n_z S_z)` in the BHZ basis for a moment `n`.
82pub fn bhz_exchange(coupling: GFactors, j: f64, n: [f64; 3]) -> CMat {
83    let [sx, sy, sz] = bhz_spin(coupling);
84    combine(&[(c64::new(j * n[0], 0.0), &sx), (c64::new(j * n[1], 0.0), &sy), (c64::new(j * n[2], 0.0), &sz)])
85}
86
87/// One spin block of the BHZ model.
88#[derive(Clone, Copy, Debug, PartialEq, Eq)]
89pub enum Spin {
90    /// Spin up: the orbitals `(E1↑, H1↑)`, the upper-left block.
91    Up,
92    /// Spin down: the orbitals `(E1↓, H1↓)`, the lower-right block.
93    Down,
94}
95
96/// One spin block of the BHZ model (2 orbitals `(E1, H1)`), the upper-left (`Up`) or lower-right
97/// (`Down`) 2×2 block of [`bhz`] without the inter-block coupling λ:
98///
99/// - on-site: `(C − 4D) + (M − 4B) τ_z`
100/// - hopping `+x`: `D + B τ_z ∓ (i/2) A τ_x` (− for spin up)
101/// - hopping `+y`: `D + B τ_z + (i/2) A τ_y`
102///
103/// The thesis four-terminal code (`dim = 2`) works with the spin-up block.
104pub fn bhz_block(p: BhzParams, spin: Spin) -> Model {
105    let full = bhz(BhzParams { lambda: 0.0, ..p });
106    let o = if spin == Spin::Up { 0 } else { 2 };
107    let sub = |m: &CMat| CMat::from_fn(2, 2, |i, j| m[(o + i, o + j)]);
108    let site = caroli_lattice::Site { cell: [0, 0, 0], sub: 0 };
109    let onsite = sub(&full.onsite_matrix(&site));
110    let (tx, ty) = (sub(&full.hoppings()[0].matrix), sub(&full.hoppings()[1].matrix));
111    Model::new(Lattice::square(1.0, 2)).onsite(0, onsite).hopping(0, 0, [1, 0, 0], tx).hopping(
112        0,
113        0,
114        [0, 1, 0],
115        ty,
116    )
117}
118
119#[cfg(test)]
120mod tests {
121    use super::*;
122    use caroli_lattice::Region;
123    use faer::Side;
124
125    /// Without inter-block coupling, the BHZ spectrum is the union of the two spin blocks.
126    #[test]
127    fn blocks_make_up_the_full_model() {
128        let p = BhzParams::default();
129        let full = bhz(p);
130        let region = Region::cuboid(full.lattice(), [4, 3, 0]);
131        let mut e4 = full.hamiltonian(&region).self_adjoint_eigenvalues(Side::Lower).unwrap();
132        let mut e2 = Vec::new();
133        for spin in [Spin::Up, Spin::Down] {
134            let m = bhz_block(p, spin);
135            let r = Region::cuboid(m.lattice(), [4, 3, 0]);
136            e2.extend(m.hamiltonian(&r).self_adjoint_eigenvalues(Side::Lower).unwrap());
137        }
138        e2.sort_by(f64::total_cmp);
139        e4.sort_by(f64::total_cmp);
140        assert!(e2.iter().zip(&e4).all(|(a, b)| (a - b).abs() < 1e-12));
141    }
142}