
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
# DIRA C OPERATOR
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
def D_SSM (k , li n k _phase s = None ) :
D = np . zeros ((4 , 4) , dt ype = compl e x )
for j , n in enu m e rate ( n_vecs ) :
n_h at = n / np . linalg . norm ( n)
Gamma_j = n_hat [0]* gam m a _ 1 + n_h a t [1]* gamma_2 + n_hat [2]* ga m m a _3
pha se = np . exp (1 j * np . dot (k , n ) )
if lin k _ phase s is not None :
pha se *= np . exp (1 j * li n k_phas e s [j ])
D += G a m m a _j * phas e
return D
def get _ energy (k , lin k _ phase s = None ) :
# D is Hermiti an , so eigen v a lues are real
eigvals = np . linalg . eig v a l sh ( D_SSM (k , l i n k_phas e s ) )
return np . min ( np . abs ( eigvals ) )
def mak e _ p ath ( points , labels , npts =200) :
path , ticks = [] , [0]
for i in r ange ( len ( points ) -1) :
for t in np . linspac e (0 , 1, npts , e n dp oint =(i == len (points ) -2)) :
path . append ( p o i n t s [i ]*(1 - t ) + points [ i +1]* t )
tic ks .append (len ( path ) -1)
return np . array ( path ) , ticks , l a b e l s
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
# 1. H ERMIT I C ITY & C HIRAL SYMMETRY CHECK
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
pri nt (" 1. F U NDAMEN T AL SY M M ETRIES ")
k_test = np . arra y ([1.2 , -0.4 , 2.7])
D = D_SSM ( k _ t e s t )
D_d ag = D . conj () .T
herm_di f f = np . linalg . norm ( D - D_ dag )
pri nt (f " || D - D ^ dagger || = { her m _ d iff :.2 e} ( S trictly H e rm itian ) ")
anticomm = gamma_5 @ D + D @ gamma_5
chi_diff = np . linalg . norm ( a n t i co mm )
pri nt (f " ||{{ gamma_5 , D }}|| = { chi_d i f f :.2 e } ( Exact Chiral Symme t r y )")
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
# 2. 3 D GEOMETR Y VIS U ALIZA T ION ( FIGURE 1)
# = === = == = == = == = === === === = == = == = === === === === = == = == = == = === === ==
pri nt (" \ n2 . GEN E R ATING F I G URE 1 (3 D G EO METRY ) ")
fig = plt . f igure ( f i g s i ze =(10 , 8) , dpi =300)
ax = fig . a dd_sub p l ot (111 , p r ojectio n ='3 d ')
ax . sca t t e r (0 , 0, 0 , color =' bla ck ', s =100 , zorder =5 , lab e l =' Origin ')
ax . sca t t e r ( n_ v e c s [: , 0] , n_vecs [: , 1] , n_vec s [: , 2] , col o r =' dodge r blue ', s =50 , zorder =4 ,
lab el ='K =12 Unit D i rection s (~0.70 7 ) ')
for vec in n_vecs :
ax . plot ([0 , vec [0]] , [0 , vec [1]] , [0 , vec [2]] , color =' gray ', li n e style = ' --' , alpha =0.5 ,
zorder =2)
for i in r ange ( len ( n_vecs ) ):
for j in r ange ( i + 1, len ( n_vecs ) ):
if np . isclo s e (np . l i n a l g .norm ( n_vecs [ i] - n _ v ecs [j ]) , a ):
ax . plot ([ n_vecs [i , 0] , n_vecs [j , 0]] , [ n _ v ecs [i , 1] , n_ v e c s [j , 1]] , [ n _ vecs [i ,
2] , n_vecs [ j , 2]] , c olor = ' do d g erblue ', linewid t h =2.0 , zorder =3)
r = [ -1 , 1]
for s , e in co m binat i o ns ( np . array (list ( p r o d u c t (r , r , r )) ) , 2) :
if np . isclo s e (np . l i n a l g .norm (s - e) , 2.0) :
ax . plot ([ s [0] , e [0]] , [s [1] , e [1]] , [s [2] , e [2]] , color =' crimson ', l i nestyle =': ',
alp ha =0.4 , zorder =1)
ax . plot ([] , [] , color =' crimson ', l in estyle = ': ' , label = ' Integer Global Bo u n d ar y ($ \ pm 1.0 $ ) '
11