1
+ from koala .lattice import Lattice
2
+ import numpy as np
3
+ import scipy .linalg as la
4
+
5
+ def crosshair_marker (lattice : Lattice , projector : np .ndarray , crosshair_position : np .ndarray ):
6
+ """Generate the crosshair marker for a lattice and Hamiltonian
7
+
8
+ :param lattice: the lattice on which the Hamiltonian is placed
9
+ :type lattice: Lattice
10
+ :param projector: A projectro onto a set of occupied states
11
+ :type projector: np.ndarray
12
+ :param crosshair_position: the position of the crosshair in the bulk
13
+ :type crosshair_position: np.ndarray
14
+ :return: an array giving the marker value at every point in the system
15
+ :rtype: np.ndarray
16
+ """
17
+
18
+
19
+ positions = lattice .vertices .positions
20
+ theta_x_vec = np .diag (1 * (positions [:,0 ] < crosshair_position [0 ]))
21
+ theta_y_vec = np .diag (1 * (positions [:,1 ] < crosshair_position [1 ]))
22
+
23
+ crosshair_marker = 4 * np .pi * np .diag (projector @theta_x_vec @projector @theta_y_vec @projector ).imag
24
+
25
+ return crosshair_marker
26
+
27
+
28
+ def chern_marker (lattice : Lattice , projector : np .ndarray ):
29
+ """generate the Chern marker for the system
30
+
31
+ :param lattice: the lattice
32
+ :type lattice: Lattice
33
+ :param projector: a projector onto a set of occupied states
34
+ :type projector: np.ndarray
35
+ :return: the Chern marker value for each point in the system
36
+ :rtype: np.ndarray
37
+ """
38
+
39
+ positions = lattice .vertices .positions
40
+ X = np .diag (positions [:,0 ])
41
+ Y = np .diag (positions [:,1 ])
42
+
43
+ chern_marker = 4 * np .pi * np .diag (projector @X @projector @Y @projector ).imag
44
+
45
+ return chern_marker
0 commit comments