Coverage for tbkit/models.py: 100%

117 statements  

« prev     ^ index     » next       coverage.py v7.17.3, created at 2026-11-21 11:05 +0000

1r''' 

2A library of named Tight-Binding models, each in one call. 

3 

4Every function takes the parameters of the paper that introduced the 

5model as keyword arguments and returns a :class:`tbkit.kspace.KSpace`, so 

6every band, topology and response tool applies to it. For a finite 

7sample in real space, cut it with :mod:`tbkit.bridges`: 

8*finite_system* gives a ready-to-use :class:`tbkit.system.System` for 

9the spinless models, *finite_model* the sparse Hamiltonian (with the 

10site positions) for every model, spinful ones included. 

11 

12================================= =========== ====================================== 

13Function Dimension Invariant 

14================================= =========== ====================================== 

15:func:`ssh` 1D Zak phase (*berry_phase*) 

16:func:`rice_mele` 1D (polarization, not quantized) 

17:func:`rice_mele_pump` 1D + cycle *chern_number* of the pump 

18:func:`kitaev_chain` 1D, BdG *bdg.majorana_number* 

19:func:`haldane` 2D *chern_number* 

20:func:`qi_wu_zhang` 2D *chern_number* 

21:func:`kane_mele` 2D, spin *z2_invariant* 

22:func:`bhz` 2D, spin *z2_invariant* 

23:func:`tmd_three_band` 2D (trivial; valley Berry curvature) 

24:func:`topological_insulator_3d` 3D, spin *z2_indices_3d* 

25:func:`weyl_semimetal` 3D *topology.find_weyl_points* 

26================================= =========== ====================================== 

27 

28Examples 

29-------- 

30Example usage:: 

31 

32 from tbkit import models 

33 from tbkit.bridges import finite_system 

34 

35 hal = models.haldane(t2=0.1, phi=np.pi / 2, M=0.2) 

36 hal.chern_number(bands=[0]) # 1.0 

37 flake = finite_system(hal, (20, 20)) # the same model, in real space 

38''' 

39from __future__ import annotations 

40 

41from math import cos, sqrt 

42from typing import Sequence 

43 

44import numpy as np 

45 

46import tbkit.error_handling as error_handling 

47from tbkit.bdg import bdg_kspace 

48from tbkit.kspace import KSpace, PAULI 

49from tbkit.lattice import Lattice 

50import tbkit.lattices as lattices 

51 

52# Liu, Shan, Yao, Yao and Xiao, Phys. Rev. B 88, 085433 (2013): GGA 

53# nearest-neighbour parameters (Table II; a in angstrom, energies in eV) 

54# and spin-orbit couplings lam (Table IV). 

55TMD_PARAMETERS: dict[str, dict[str, float]] = { 

56 'MoS2': dict(a=3.190, eps1=1.046, eps2=2.104, t0=-0.184, t1=0.401, t2=0.507, 

57 t11=0.218, t12=0.338, t22=0.057, lam=0.073), 

58 'WS2': dict(a=3.191, eps1=1.130, eps2=2.275, t0=-0.206, t1=0.567, t2=0.536, 

59 t11=0.286, t12=0.384, t22=-0.061, lam=0.211), 

60 'MoSe2': dict(a=3.326, eps1=0.919, eps2=2.065, t0=-0.188, t1=0.317, t2=0.456, 

61 t11=0.211, t12=0.290, t22=0.130, lam=0.091), 

62 'WSe2': dict(a=3.325, eps1=0.943, eps2=2.179, t0=-0.207, t1=0.457, t2=0.486, 

63 t11=0.263, t12=0.329, t22=0.034, lam=0.228), 

64 'MoTe2': dict(a=3.557, eps1=0.605, eps2=1.972, t0=-0.169, t1=0.228, t2=0.390, 

65 t11=0.207, t12=0.239, t22=0.252, lam=0.107), 

66 'WTe2': dict(a=3.560, eps1=0.606, eps2=2.102, t0=-0.175, t1=0.342, t2=0.410, 

67 t11=0.233, t12=0.270, t22=0.190, lam=0.237), 

68} 

69 

70 

71def _two_orbitals(tags: tuple[str, str], prim_vec: Sequence[tuple[float, ...]]) -> Lattice: 

72 ''' 

73 Private function. Two orbitals on one site at the origin. 

74 ''' 

75 r0 = (0.,) * len(prim_vec[0]) 

76 return Lattice(unit_cell=[{'tag': tags[0], 'r0': r0}, {'tag': tags[1], 'r0': r0}], 

77 prim_vec=prim_vec) 

78 

79 

80_SQUARE = [(1., 0.), (0., 1.)] 

81_CUBIC = [(1., 0., 0.), (0., 1., 0.), (0., 0., 1.)] 

82 

83 

84def _chain_lattice() -> Lattice: 

85 ''' 

86 Private function. Two sites per cell, half a lattice constant apart. 

87 ''' 

88 return Lattice(unit_cell=[{'tag': 'a', 'r0': (0., 0.)}, {'tag': 'b', 'r0': (0.5, 0.)}], 

89 prim_vec=[(1., 0.)]) 

90 

91 

92def ssh(v: float = 0.5, w: float = 1.) -> KSpace: 

93 r''' 

94 Su-Schrieffer-Heeger chain (Phys. Rev. Lett. 42, 1698 (1979)): two 

95 sites 'a', 'b' per cell, intracell hopping *v* and intercell hopping 

96 *w*, 

97 

98 .. math:: 

99 

100 H(k) = \begin{pmatrix} 0 & v + w e^{-ik} \\ v + w e^{ik} & 0\end{pmatrix}\, . 

101 

102 The gap :math:`2|v - w|` closes at :math:`|v| = |w|`. For :math:`|w| > |v|` 

103 the lower band's Zak phase (*berry_phase* with ``positions=False``) is 

104 :math:`\pi` and an open chain has a zero mode at each end; for 

105 :math:`|w| < |v|` it is 0. 

106 

107 Parameters 

108 ---------- 

109 v : Real number, default 0.5 

110 Intracell hopping. 

111 w : Real number, default 1 

112 Intercell hopping. 

113 

114 Returns 

115 ------- 

116 ks 

117 **KSpace** instance (1D, spinless). 

118 ''' 

119 error_handling.real_numbers({'v': v, 'w': w}) 

120 return rice_mele(t=0.5 * (v + w), delta=0.5 * (v - w)) 

121 

122 

123def rice_mele(t: float = 1., delta: float = -0.25, Delta: float = 0.) -> KSpace: 

124 r''' 

125 Rice-Mele chain (Phys. Rev. Lett. 49, 1455 (1982)): the SSH chain 

126 with alternating hoppings :math:`t\pm\delta` and a staggered onsite 

127 energy :math:`\pm\Delta`, 

128 

129 .. math:: 

130 

131 H(k) = \begin{pmatrix} \Delta & v + w e^{-ik} \\ v + w e^{ik} & -\Delta\end{pmatrix}\, , 

132 \qquad v = t + \delta,\ w = t - \delta\, . 

133 

134 Its gap, at :math:`k = \pi`, is :math:`2\sqrt{\Delta^2 + 4\delta^2}`. 

135 With :math:`\Delta = 0` it is :func:`ssh`. 

136 

137 Parameters 

138 ---------- 

139 t : Real number, default 1 

140 Mean hopping. 

141 delta : Real number, default -0.25 

142 Dimerization: intracell hopping :math:`t+\delta`, intercell :math:`t-\delta`. 

143 Delta : Real number, default 0 

144 Staggered onsite energy, :math:`+\Delta` on 'a' and :math:`-\Delta` on 'b'. 

145 

146 Returns 

147 ------- 

148 ks 

149 **KSpace** instance (1D, spinless). 

150 ''' 

151 error_handling.real_numbers({'t': t, 'delta': delta, 'Delta': Delta}) 

152 ks = KSpace(_chain_lattice()) 

153 ks.set_hopping([{'i': 0, 'j': 1, 'R': (0,), 't': t + delta}, 

154 {'i': 0, 'j': 1, 'R': (-1,), 't': t - delta}]) 

155 ks.set_onsite({'a': Delta, 'b': -Delta}) 

156 return ks 

157 

158 

159def rice_mele_pump(t: float = 1., delta: float = 0.5, Delta: float = 0.6, 

160 offset: float = 0.) -> KSpace: 

161 r''' 

162 Thouless pump of the Rice-Mele chain (D. J. Thouless, Phys. Rev. B 27, 

163 6083 (1983)): the chain of :func:`rice_mele` with dimerization 

164 :math:`\delta\cos\phi` and staggering :math:`\Delta\sin\phi + \Delta_0`, 

165 cycled over :math:`\phi\in[0, 2\pi)`. The cycle parameter is the second 

166 crystal momentum of a 2D Bloch Hamiltonian :math:`H(k, \phi)` 

167 (primitive vectors (1, 0) and (0, 1)), whose lower band's 

168 *chern_number* is the charge pumped per cycle: :math:`\pm 1` when the 

169 loop encircles the gap closing :math:`\delta\cos\phi = \Delta\sin\phi + \Delta_0 = 0` 

170 (:math:`|\Delta_0| < |\Delta|` and :math:`\delta \neq 0`), 0 otherwise. 

171 

172 Parameters 

173 ---------- 

174 t : Real number, default 1 

175 Mean hopping. 

176 delta : Real number, default 0.5 

177 Amplitude of the dimerization. 

178 Delta : Real number, default 0.6 

179 Amplitude of the staggered onsite energy. 

180 offset : Real number, default 0 

181 Constant staggered onsite energy :math:`\Delta_0`. 

182 

183 Returns 

184 ------- 

185 ks 

186 **KSpace** instance (2D: :math:`k` and :math:`\phi`, spinless). 

187 ''' 

188 error_handling.real_numbers({'t': t, 'delta': delta, 'Delta': Delta, 'offset': offset}) 

189 lat = Lattice(unit_cell=[{'tag': 'a', 'r0': (0., 0.)}, {'tag': 'b', 'r0': (0.5, 0.)}], 

190 prim_vec=_SQUARE) 

191 ks = KSpace(lat) 

192 ks.set_hopping([{'i': 0, 'j': 1, 'R': (0, 0), 't': t}, 

193 {'i': 0, 'j': 1, 'R': (-1, 0), 't': t}, 

194 {'i': 0, 'j': 1, 'R': (0, 1), 't': delta / 2}, 

195 {'i': 0, 'j': 1, 'R': (0, -1), 't': delta / 2}, 

196 {'i': 0, 'j': 1, 'R': (-1, 1), 't': -delta / 2}, 

197 {'i': 0, 'j': 1, 'R': (-1, -1), 't': -delta / 2}, 

198 {'i': 0, 'j': 0, 'R': (0, 1), 't': Delta / 2j}, 

199 {'i': 1, 'j': 1, 'R': (0, 1), 't': -Delta / 2j}]) 

200 ks.set_onsite({'a': offset, 'b': -offset}) 

201 return ks 

202 

203 

204def kitaev_chain(t: float = 1., delta: float = 1., mu: float = 0.) -> KSpace: 

205 r''' 

206 Kitaev chain (A. Yu. Kitaev, Phys.-Usp. 44, 131 (2001)): spinless 

207 fermions with nearest-neighbour hopping *t* and p-wave pairing 

208 *delta*, in the Bogoliubov-de Gennes form of :func:`tbkit.bdg.bdg_kspace` 

209 (particle then hole), 

210 

211 .. math:: 

212 

213 E(k) = \pm\sqrt{(2t\cos k - \mu)^2 + 4\Delta^2\sin^2 k}\, . 

214 

215 For :math:`|\mu| < 2|t|` (and :math:`\Delta\neq 0`) it is topological: 

216 *bdg.majorana_number* is :math:`-1`, and an open chain has a Majorana 

217 zero mode at each end; for :math:`|\mu| > 2|t|` it is :math:`+1`. 

218 

219 Parameters 

220 ---------- 

221 t : Real number, default 1 

222 Hopping. 

223 delta : Real number, default 1 

224 p-wave pairing. 

225 mu : Real number, default 0 

226 Chemical potential. 

227 

228 Returns 

229 ------- 

230 ks 

231 **KSpace** instance (1D, two orbitals: particle and hole). 

232 ''' 

233 error_handling.real_numbers({'t': t, 'delta': delta, 'mu': mu}) 

234 chain = KSpace(lattices.chain()) 

235 chain.set_hopping([{'i': 0, 'j': 0, 'R': (1,), 't': t}]) 

236 return bdg_kspace(chain, [{'i': 0, 'j': 0, 'R': (1,), 'delta': delta}], mu=mu) 

237 

238 

239def _honeycomb_nnn(ks: KSpace, t_a: complex | np.ndarray, t_b: complex | np.ndarray) -> None: 

240 ''' 

241 Private function. Second-neighbour hoppings of the honeycomb lattice 

242 along a2, -a1 and a1 - a2 (120 degrees apart): *t_a* within sublattice 

243 'a', *t_b* within 'b'; the reverse bonds carry the conjugates. 

244 ''' 

245 for R in [(0, 1), (-1, 0), (1, -1)]: 

246 ks.set_hopping([{'i': 0, 'j': 0, 'R': R, 't': t_a}, {'i': 1, 'j': 1, 'R': R, 't': t_b}]) 

247 

248 

249_HONEYCOMB_NN = [(0, 0), (-1, 0), (0, -1)] 

250 

251 

252def haldane(t1: float = 1., t2: float = 0.1, phi: float = np.pi / 2, M: float = 0.) -> KSpace: 

253 r''' 

254 Haldane model (F. D. M. Haldane, Phys. Rev. Lett. 61, 2015 (1988)), 

255 the first Chern insulator: the honeycomb lattice 

256 (:func:`tbkit.lattices.honeycomb`, nearest neighbours a distance 1 

257 apart) with nearest-neighbour hopping :math:`t_1`, second-neighbour 

258 hopping :math:`t_2 e^{\pm i\phi}` of opposite chirality on the two 

259 sublattices (a staggered flux, no net field) and a staggered onsite 

260 energy :math:`\pm M`. 

261 

262 The gaps at K and K' are :math:`2|M \pm 3\sqrt3\,t_2\sin\phi|`: the 

263 lower band's *chern_number* is :math:`\mathrm{sign}(t_2\sin\phi)` for 

264 :math:`|M| < 3\sqrt3\,|t_2\sin\phi|` (with :math:`t_1>0`), 0 above. 

265 

266 Parameters 

267 ---------- 

268 t1 : Real number, default 1 

269 Nearest-neighbour hopping. 

270 t2 : Real number, default 0.1 

271 Second-neighbour hopping amplitude. 

272 phi : Real number, default pi/2 

273 Phase of the second-neighbour hopping. 

274 M : Real number, default 0 

275 Staggered onsite energy, :math:`+M` on 'a' and :math:`-M` on 'b'. 

276 

277 Returns 

278 ------- 

279 ks 

280 **KSpace** instance (2D, spinless). 

281 ''' 

282 error_handling.real_numbers({'t1': t1, 't2': t2, 'phi': phi, 'M': M}) 

283 ks = KSpace(lattices.honeycomb()) 

284 ks.set_hopping([{'i': 0, 'j': 1, 'R': R, 't': t1} for R in _HONEYCOMB_NN]) 

285 _honeycomb_nnn(ks, t2 * np.exp(1j * phi), t2 * np.exp(-1j * phi)) 

286 ks.set_onsite({'a': M, 'b': -M}) 

287 return ks 

288 

289 

290def qi_wu_zhang(m: float = -1.) -> KSpace: 

291 r''' 

292 Qi-Wu-Zhang model (X.-L. Qi, Y.-S. Wu and S.-C. Zhang, Phys. Rev. B 

293 74, 085308 (2006)), the simplest Chern insulator: two orbitals 'a', 

294 'b' on one site of the square lattice, 

295 

296 .. math:: 

297 

298 H(\mathbf{k}) = \sin k_x\,\sigma_x + \sin k_y\,\sigma_y 

299 + (m + \cos k_x + \cos k_y)\,\sigma_z\, . 

300 

301 The gap closes at :math:`m = 0, \pm2`: the lower band's 

302 *chern_number* is :math:`+1` for :math:`-2 < m < 0`, :math:`-1` for 

303 :math:`0 < m < 2`, 0 for :math:`|m| > 2`. 

304 

305 Parameters 

306 ---------- 

307 m : Real number, default -1 

308 Mass. 

309 

310 Returns 

311 ------- 

312 ks 

313 **KSpace** instance (2D, spinless, two orbitals per site). 

314 ''' 

315 error_handling.real_number(m, 'm') 

316 ks = KSpace(_two_orbitals(('a', 'b'), _SQUARE)) 

317 hops = [] 

318 for R, s in (((1, 0), PAULI['x']), ((0, 1), PAULI['y'])): 

319 t = s / 2j + PAULI['z'] / 2 

320 hops += [{'i': i, 'j': j, 'R': R, 't': t[i, j]} for i in range(2) for j in range(2) if t[i, j] != 0] 

321 ks.set_hopping(hops) 

322 ks.set_onsite({'a': m, 'b': -m}) 

323 return ks 

324 

325 

326def kane_mele(t: float = 1., lambda_so: float = 0.06, lambda_r: float = 0., 

327 lambda_v: float = 0.) -> KSpace: 

328 r''' 

329 Kane-Mele model (C. L. Kane and E. J. Mele, Phys. Rev. Lett. 95, 

330 226801 (2005)), the quantum spin Hall insulator of graphene: the 

331 honeycomb lattice with spin, nearest-neighbour hopping *t*, intrinsic 

332 spin-orbit coupling :math:`i\lambda_{SO}\nu_{ij}s_z` between second 

333 neighbours, Rashba coupling :math:`i\lambda_R(\mathbf{s}\times\hat{\mathbf{d}}_{ij})_z` 

334 between first neighbours and a staggered onsite energy 

335 :math:`\pm\lambda_v`, 

336 

337 .. math:: 

338 

339 H = t\sum_{\langle ij\rangle} c_i^\dagger c_j 

340 + i\lambda_{SO}\sum_{\langle\langle ij\rangle\rangle}\nu_{ij}c_i^\dagger s_z c_j 

341 + i\lambda_R\sum_{\langle ij\rangle}c_i^\dagger(\mathbf{s}\times\hat{\mathbf{d}}_{ij})_z c_j 

342 + \lambda_v\sum_i\xi_i c_i^\dagger c_i\, . 

343 

344 The :math:`\mathbb{Z}_2` invariant of the two lower bands 

345 (*z2_invariant*) is 1 for :math:`|\lambda_v| < 3\sqrt3\,|\lambda_{SO}|` 

346 at :math:`\lambda_R = 0` (the boundary moves with :math:`\lambda_R`), 

347 0 above. 

348 

349 Parameters 

350 ---------- 

351 t : Real number, default 1 

352 Nearest-neighbour hopping. 

353 lambda_so : Real number, default 0.06 

354 Intrinsic spin-orbit coupling. 

355 lambda_r : Real number, default 0 

356 Rashba coupling. 

357 lambda_v : Real number, default 0 

358 Staggered onsite energy, :math:`+\lambda_v` on 'a' and :math:`-\lambda_v` on 'b'. 

359 

360 Returns 

361 ------- 

362 ks 

363 **KSpace** instance (2D, ``spin=True``). 

364 ''' 

365 error_handling.real_numbers({'t': t, 'lambda_so': lambda_so, 'lambda_r': lambda_r, 

366 'lambda_v': lambda_v}) 

367 lat = lattices.honeycomb() 

368 ks = KSpace(lat, spin=True) 

369 ks.set_hopping([{'i': 0, 'j': 1, 'R': R, 't': t} for R in _HONEYCOMB_NN]) 

370 _honeycomb_nnn(ks, 1j * lambda_so * PAULI['z'], -1j * lambda_so * PAULI['z']) 

371 if lambda_r: 

372 tau = np.array([d['r0'] for d in lat.unit_cell]) 

373 a = np.array(lat.prim_vec) 

374 for R in _HONEYCOMB_NN: 

375 d = tau[1] + R[0] * a[0] + R[1] * a[1] - tau[0] 

376 d = d / np.linalg.norm(d) 

377 ks.set_hopping([{'i': 0, 'j': 1, 'R': R, 

378 't': 1j * lambda_r * (PAULI['x'] * d[1] - PAULI['y'] * d[0])}]) 

379 ks.set_onsite({'a': lambda_v, 'b': -lambda_v}) 

380 return ks 

381 

382 

383def bhz(A: float = 1., B: float = 1., C: float = 0., D: float = 0., M: float = 1.) -> KSpace: 

384 r''' 

385 Bernevig-Hughes-Zhang model of HgTe quantum wells (B. A. Bernevig, 

386 T. L. Hughes and S.-C. Zhang, Science 314, 1757 (2006)), in its 

387 square-lattice form (lattice constant 1): an s-like orbital 's' 

388 (:math:`E_1`) and a p-like orbital 'p' (:math:`H_1`) with spin, on one 

389 site, 

390 

391 .. math:: 

392 

393 H(\mathbf{k}) = \begin{pmatrix} h(\mathbf{k}) & 0 \\ 0 & h^*(-\mathbf{k})\end{pmatrix}, 

394 \quad h = \epsilon(\mathbf{k}) + A\sin k_x\,\tau_x + A\sin k_y\,\tau_y + d_z(\mathbf{k})\,\tau_z\, , 

395 

396 :math:`d_z = M - 2B(2 - \cos k_x - \cos k_y)` and 

397 :math:`\epsilon = C - 2D(2 - \cos k_x - \cos k_y)` (:math:`\tau`: 

398 orbital). The basis is that of *KSpace* with ``spin=True`` 

399 (:math:`E_1\uparrow, E_1\downarrow, H_1\uparrow, H_1\downarrow`), so 

400 the two blocks give :math:`A\sin k_x\,\tau_x s_z + A\sin k_y\,\tau_y`. 

401 Inversion is ``diag(1, -1)`` on the orbitals. The :math:`\mathbb{Z}_2` 

402 invariant of the two lower bands (*z2_invariant*, *parity_z2*; for 

403 :math:`|D| < |B|`) is 1 for :math:`0 < M/B < 4` and :math:`4 < M/B < 8`, 

404 0 otherwise. 

405 

406 Parameters 

407 ---------- 

408 A : Real number, default 1 

409 Velocity (orbital mixing). 

410 B : Real number, default 1 

411 Band curvature of the mass. 

412 C : Real number, default 0 

413 Energy offset. 

414 D : Real number, default 0 

415 Band curvature common to both orbitals. 

416 M : Real number, default 1 

417 Mass: the bands are inverted at :math:`\Gamma` for :math:`M/B > 0`. 

418 

419 Returns 

420 ------- 

421 ks 

422 **KSpace** instance (2D, ``spin=True``, two orbitals per site). 

423 ''' 

424 error_handling.real_numbers({'A': A, 'B': B, 'C': C, 'D': D, 'M': M}) 

425 ks = KSpace(_two_orbitals(('s', 'p'), _SQUARE), spin=True) 

426 ks.set_onsite({'s': C - 4 * D + M - 4 * B, 'p': C - 4 * D - M + 4 * B}) 

427 for R in [(1, 0), (0, 1)]: 

428 ks.set_hopping([{'i': 0, 'j': 0, 'R': R, 't': (D + B) * PAULI['0']}, 

429 {'i': 1, 'j': 1, 'R': R, 't': (D - B) * PAULI['0']}]) 

430 ks.set_hopping([{'i': 0, 'j': 1, 'R': (1, 0), 't': -0.5j * A * PAULI['z']}, 

431 {'i': 0, 'j': 1, 'R': (-1, 0), 't': 0.5j * A * PAULI['z']}, 

432 {'i': 0, 'j': 1, 'R': (0, 1), 't': -0.5 * A * PAULI['0']}, 

433 {'i': 0, 'j': 1, 'R': (0, -1), 't': 0.5 * A * PAULI['0']}]) 

434 return ks 

435 

436 

437def tmd_three_band( 

438 a: float = 3.190, eps1: float = 1.046, eps2: float = 2.104, t0: float = -0.184, 

439 t1: float = 0.401, t2: float = 0.507, t11: float = 0.218, t12: float = 0.338, 

440 t22: float = 0.057, lam: float = 0.073, spin: bool = False, 

441) -> KSpace: 

442 r''' 

443 Three-band model of the monolayer group-VIB transition-metal 

444 dichalcogenides MX\ :sub:`2` (G.-B. Liu, W.-Y. Shan, Y. Yao, W. Yao and 

445 D. Xiao, Phys. Rev. B 88, 085433 (2013)): the :math:`d_{z^2}`, 

446 :math:`d_{xy}`, :math:`d_{x^2-y^2}` orbitals of the metal (tags 'z2', 

447 'xy', 'x2y2') on a triangular lattice of constant *a*, with 

448 nearest-neighbour hoppings. The hopping matrix to the neighbour at 

449 :math:`\mathbf{R}_1 = (a, 0)` is 

450 

451 .. math:: 

452 

453 E(\mathbf{R}_1) = \begin{pmatrix} t_0 & t_1 & t_2 \\ -t_1 & t_{11} & t_{12} 

454 \\ t_2 & -t_{12} & t_{22}\end{pmatrix}\, , 

455 

456 and those to the other neighbours follow by the :math:`C_3` rotations 

457 (which turn :math:`(d_{xy}, d_{x^2-y^2})` by twice the angle) and 

458 Hermiticity, so that :math:`H(\mathbf{k})` is Eq. (4)-(10) of the 

459 paper. The defaults are the GGA parameters of MoS\ :sub:`2`; 

460 ``tmd_three_band(**TMD_PARAMETERS['WSe2'])`` gives another material 

461 (Mo/W, S/Se/Te). The smallest direct gap is at K and K' (1.663 eV for 

462 MoS\ :sub:`2`, the conduction band there being pure :math:`d_{z^2}` at 

463 :math:`\epsilon_1 - 3t_0`); the model is trivial (*chern_number* 0), 

464 with opposite Berry curvatures at K and K' (the valley Hall effect). 

465 

466 With ``spin=True`` the spin-orbit coupling :math:`\lambda L_z s_z/2` 

467 of the paper's Eq. (25)-(26) is added: it splits the valence band at 

468 K by :math:`2\lambda`, the upper state having spin down at K and spin 

469 up at K' (spin-valley locking). 

470 

471 Parameters 

472 ---------- 

473 a : Positive real number, default 3.190 

474 Lattice constant, in angstrom. 

475 eps1, eps2 : Real numbers, default 1.046, 2.104 

476 Onsite energies of :math:`d_{z^2}` and of :math:`d_{xy}, d_{x^2-y^2}` (eV). 

477 t0, t1, t2, t11, t12, t22 : Real numbers 

478 Nearest-neighbour hoppings (eV), defaults 

479 -0.184, 0.401, 0.507, 0.218, 0.338, 0.057. 

480 lam : Real number, default 0.073 

481 Spin-orbit coupling (eV), used with ``spin=True``. 

482 spin : Boolean, default False 

483 Spin-1/2 orbitals, with spin-orbit coupling. 

484 

485 Returns 

486 ------- 

487 ks 

488 **KSpace** instance (2D, three orbitals per site). 

489 ''' 

490 error_handling.positive_real(a, 'a') 

491 error_handling.real_numbers({'eps1': eps1, 'eps2': eps2, 't0': t0, 't1': t1, 't2': t2, 

492 't11': t11, 't12': t12, 't22': t22, 'lam': lam}) 

493 error_handling.boolean(spin, 'spin') 

494 lat = Lattice(unit_cell=[{'tag': tag, 'r0': (0., 0.)} for tag in ('z2', 'xy', 'x2y2')], 

495 prim_vec=[(a, 0.), (0.5 * a, 0.5 * sqrt(3) * a)]) 

496 ks = KSpace(lat, spin=spin) 

497 e_r1 = np.array([[t0, t1, t2], [-t1, t11, t12], [t2, -t12, t22]]) 

498 hops = [] 

499 # R1 = a1, then R1 turned by 120 and 240 degrees; the opposite 

500 # neighbours are the Hermitian conjugates 

501 for n, R in enumerate([(1, 0), (-1, 1), (0, -1)]): 

502 c, s = np.cos(4 * np.pi * n / 3), np.sin(4 * np.pi * n / 3) 

503 rot = np.array([[1., 0., 0.], [0., c, s], [0., -s, c]]) 

504 e_r = rot @ e_r1 @ rot.T 

505 hops += [{'i': i, 'j': j, 'R': R, 't': float(e_r[i, j])} 

506 for i in range(3) for j in range(3) if abs(e_r[i, j]) > 1e-14] 

507 if spin: 

508 hops.append({'i': 1, 'j': 2, 'R': (0, 0), 't': 1j * lam * PAULI['z']}) 

509 ks.set_hopping(hops) 

510 ks.set_onsite({'z2': eps1, 'xy': eps2, 'x2y2': eps2}) 

511 return ks 

512 

513 

514def topological_insulator_3d(M: float = 2., A: float = 1., B: float = 1.) -> KSpace: 

515 r''' 

516 Lattice model of a 3D topological insulator (the cubic-lattice 

517 regularization of the Bi\ :sub:`2`\ Se\ :sub:`3` model of H. Zhang et 

518 al., Nature Phys. 5, 438 (2009)): orbitals 's' and 'p' of opposite 

519 parity, with spin, on one site of the cubic lattice, 

520 

521 .. math:: 

522 

523 H(\mathbf{k}) = m(\mathbf{k})\,\tau_z + A\sum_{i=x,y,z}\sin k_i\,\tau_x\sigma_i\, , 

524 \qquad m(\mathbf{k}) = M - 2B\sum_i(1 - \cos k_i)\, . 

525 

526 Inversion is ``diag(1, -1)`` on the orbitals. The four 

527 :math:`\mathbb{Z}_2` indices of the two lower bands (*z2_indices_3d*), 

528 for :math:`B > 0` and :math:`A \neq 0`, are :math:`(0;000)` for 

529 :math:`M < 0` or :math:`M > 12B`, :math:`(1;000)` for 

530 :math:`0 < M < 4B` (a strong topological insulator), :math:`(0;111)` 

531 for :math:`4B < M < 8B` (weak), :math:`(1;111)` for :math:`8B < M < 12B`. 

532 

533 Parameters 

534 ---------- 

535 M : Real number, default 2 

536 Mass at :math:`\Gamma`. 

537 A : Real number, default 1 

538 Velocity. 

539 B : Real number, default 1 

540 Band curvature of the mass. 

541 

542 Returns 

543 ------- 

544 ks 

545 **KSpace** instance (3D, ``spin=True``, two orbitals per site). 

546 ''' 

547 error_handling.real_numbers({'M': M, 'A': A, 'B': B}) 

548 ks = KSpace(_two_orbitals(('s', 'p'), _CUBIC), spin=True) 

549 sigma = [PAULI['x'], PAULI['y'], PAULI['z']] 

550 hops = [] 

551 for d in range(3): 

552 R = tuple(int(x) for x in np.eye(3, dtype=int)[d]) 

553 hops += [{'i': 0, 'j': 0, 'R': R, 't': B * PAULI['0']}, 

554 {'i': 1, 'j': 1, 'R': R, 't': -B * PAULI['0']}, 

555 {'i': 0, 'j': 1, 'R': R, 't': -0.5j * A * sigma[d]}, 

556 {'i': 1, 'j': 0, 'R': R, 't': -0.5j * A * sigma[d]}] 

557 ks.set_hopping(hops) 

558 ks.set_onsite({'s': M - 6 * B, 'p': -(M - 6 * B)}) 

559 return ks 

560 

561 

562def weyl_semimetal(k0: float = np.pi / 2) -> KSpace: 

563 r''' 

564 Minimal Weyl semimetal (two Weyl points, broken time reversal) on the 

565 cubic lattice: a two-component orbital ('a', ``spin=True``) with 

566 

567 .. math:: 

568 

569 H(\mathbf{k}) = \sin k_x\,\sigma_x + \sin k_y\,\sigma_y 

570 + (2 + \cos k_0 - \cos k_x - \cos k_y - \cos k_z)\,\sigma_z\, , 

571 

572 whose bands touch at :math:`(0, 0, \pm k_0)` (*topology.find_weyl_points*), 

573 with chiralities :math:`\pm 1`: the planes :math:`|k_z| < k_0` have 

574 *chern_number* :math:`-1`, the others 0 (for :math:`0 < k_0 < \pi`). 

575 

576 Parameters 

577 ---------- 

578 k0 : Real number, default pi/2 

579 Position of the Weyl points along :math:`k_z`. 

580 

581 Returns 

582 ------- 

583 ks 

584 **KSpace** instance (3D, ``spin=True``, one site). 

585 ''' 

586 error_handling.real_number(k0, 'k0') 

587 ks = KSpace(Lattice(unit_cell=[{'tag': 'a', 'r0': (0., 0., 0.)}], prim_vec=_CUBIC), spin=True) 

588 ks.set_hopping([{'i': 0, 'j': 0, 'R': (1, 0, 0), 't': -0.5j * PAULI['x'] - 0.5 * PAULI['z']}, 

589 {'i': 0, 'j': 0, 'R': (0, 1, 0), 't': -0.5j * PAULI['y'] - 0.5 * PAULI['z']}, 

590 {'i': 0, 'j': 0, 'R': (0, 0, 1), 't': -0.5 * PAULI['z']}]) 

591 ks.set_onsite({'a': (2. + cos(k0), -2. - cos(k0))}) # (2 + cos k0) sigma_z 

592 return ks