コード例 #1
0
ファイル: topology.py プロジェクト: joselado/pygra
def operator_berry(hin,k=[0.,0.],operator=None,delta=0.00001,ewindow=None):
  """Calculates the Berry curvature using an arbitrary operator"""
  h = multicell.turn_multicell(hin) # turn to multicell form
  dhdx = multicell.derivative(h,k,order=[1,0]) # derivative
  dhdy = multicell.derivative(h,k,order=[0,1]) # derivative
  hkgen = h.get_hk_gen() # get generator
  hk = hkgen(k) # get hamiltonian
  (es,ws) = lg.eigh(hkgen(k)) # initial waves
  ws = np.conjugate(np.transpose(ws)) # transpose the waves
  n = len(es) # number of energies
  from berry_curvaturef90 import berry_curvature as bc90
  if operator is None: operator = np.identity(dhdx.shape[0],dtype=np.complex)
  b = bc90(dhdx,dhdy,ws,es,operator,delta) # berry curvature
  return b*np.pi*np.pi*8 # normalize so the sum is 2pi Chern
コード例 #2
0
def operator_berry(hin,
                   k=[0., 0.],
                   operator=None,
                   delta=0.00001,
                   ewindow=None):
    """Calculates the Berry curvature using an arbitrary operator"""
    h = multicell.turn_multicell(hin)  # turn to multicell form
    dhdx = multicell.derivative(h, k, order=[1, 0])  # derivative
    dhdy = multicell.derivative(h, k, order=[0, 1])  # derivative
    hkgen = h.get_hk_gen()  # get generator
    hk = hkgen(k)  # get hamiltonian
    (es, ws) = lg.eigh(hkgen(k))  # initial waves
    ws = np.conjugate(np.transpose(ws))  # transpose the waves
    n = len(es)  # number of energies
    from berry_curvaturef90 import berry_curvature as bc90
    if operator is None:
        operator = np.identity(dhdx.shape[0], dtype=np.complex)
    b = bc90(dhdx, dhdy, ws, es, operator, delta)  # berry curvature
    return b * np.pi * np.pi * 8  # normalize so the sum is 2pi Chern