<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Dear Sir,</p>
<p style="margin-top:0;margin-bottom:0">                I am a new user of z2 pack and trying to calculate chern number following the journal
<a href="https://journals.aps.org/prb/pdf/10.1103/PhysRevB.85.115439" class="OWAAutoLink" id="LPlnk983747" previewremoved="true" tabindex="-1" disabled="true">
https://journals.aps.org/prb/pdf/10.1103/PhysRevB.85.115439</a> . I have defined the Hamiltonian as given in equation 14. I should get non-zero chern number. But instead of that I am getting zero. I am attaching my code below. Kindly help me in this regard.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">*********************************************************************<br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>#!/usr/bin/env python<br>
# -*- coding: utf-8 -*-<br>
#<br>
# Author:  Dominik Gresch <greschd@gmx.ch><br>
# Date:    16.08.2016 14:25:39 CEST<br>
# File:    haldane.py<br>
<br>
import json<br>
import logging<br>
<br>
import z2pack<br>
import numpy as np<br>
import matplotlib.pyplot as plt<br>
from numpy import linalg as LA<br>
<br>
logging.getLogger('z2pack').setLevel(logging.WARNING)<br>
<br>
# defining pauli matrices<br>
identity = np.identity(2, dtype=complex)<br>
pauli_x = np.array([[0, 1], [1, 0]], dtype=complex)<br>
pauli_y = np.array([[0, -1j], [1j, 0]], dtype=complex)<br>
pauli_z = np.array([[1, 0], [0, -1]], dtype=complex)<br>
Sx= 1./2. * np.array([[0, 1], [1, 0]], dtype=complex)<br>
Sy= 1./2. * np.array([[0, -1j], [1j, 0]], dtype=complex)<br>
Sz= 1./2. * np.array([[1, 0], [0, -1]], dtype=complex)<br>
<br>
def Hamilton(k, m, t1, VR):<br>
    kx, ky,_= k<br>
    H  = (3. *t1 /2. * (  pauli_x * kx + pauli_y * ky)) *  identity <br>
    H += (3. *t1 /2. * (- pauli_x * kx + pauli_y * ky)) *  identity<br>
    H +=  3. *VR /2. * (  pauli_x * Sy - pauli_y * Sx) <br>
    H += 3. *VR /2. *  (- pauli_x * Sy - pauli_y * Sx)<br>
    #H3 = n * 3. *sqrt3 * t2 * pauli_z *Sz<br>
    H += (m * Sz) * identity<br>
    #H5 = u * pauli_z * identity<br>
    return H<br>
<br>
<br>
def get_chern( m, t1, VR, **settings):<br>
    system = z2pack.hm.System(lambda k: Hamilton(k, m, t1, VR), bands=1)<br>
    <br>
    result = z2pack.surface.run(system=system, surface=lambda t1, t2: [t1, t2, 1], **settings)<br>
    return z2pack.invariant.chern(result)<br>
    <br>
<br>
if __name__ == "__main__":<br>
    # Task a)<br>
    print(get_chern(0.3, 1., 0.5 ))<br>
    #print(get_chern(0.5, 1., 1. / 3., -0.5 * np.pi))<br>
    #print(Hamilton(0.1, 1, 0.3,0.5))<br>
********************************************************************<br>
<br>
Thanking You,</div>
<div>Priyanka Sinha</div>
<div>IIT Guwahati</div>
<div>Research Scholar<br>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</p>
</div>
</body>
</html>