Пример #1
0
def Run_1(_N, _J, _i, _j, Phase):
    '''
    This func calculate the system with uniform spin distribution in Z-direction.
    '''
    print("Start Calc: N=%d, J=%.3f" % (int(_N), _J))
    h = Hamiltonian(N=int(_N), J=_J, Delta=3.333, **CONST_HJZ)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
    Phase[_i][_j] = TopoOrder(res)
    print("End Calc: N=%d, J=%.3f; Res=%d" % (int(_N), _J, TopoOrder(res)))
    return
Пример #2
0
def Run_SpinZ(_N, _J, _i, _j, Phase, Delta=3, CONST=CONST_HZL):
    '''
    This func calculate the system with uniform spin distribution in Z-direction.
    Use default constants from Hai-Zhou Lu's paper.
    '''
    print("Start Calc: N=%d, J=%.3f" % (int(_N), _J))
    h = Hamiltonian(N=int(_N), J=_J, Delta=Delta, **CONST)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings_strict)
    Phase[_i][_j] = TopoOrder(res)
    print("End Calc: N=%d, J=%.3f; Res=%d" % (int(_N), _J, TopoOrder(res)))

    return
Пример #3
0
def Run_HZL(_N, _J, _i, _j, Phase):
    '''
    This func calculate the system with uniform spin distribution in Z-direction.
    Use the Parameters from the Hai-Zhou Lu's paper.
    '''
    print("Start Calc: N=%d, J=%.3f" % (int(_N), _J))
    h = Hamiltonian(N=int(_N), J=_J, Delta=3.333, **CONST_HZL)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
    Phase[_i][_j] = TopoOrder(res)

    print("End Calc: N=%d, J=%.3f; Res=%d" % (int(_N), _J, TopoOrder(res)))
    if TopoOrder(res) != 0:
        stderr.write("!!!!!!!!\nN=%d, J=%.3f; Res=%d\n!!!!!!!!!!\n" %
                     (int(_N), _J, TopoOrder(res)))
    return
Пример #4
0
def PT_SpinZ(_N, _J_Max, _i, _j, Phase, _J_Min=0,  _J_tol=1e-4, Delta=3.189, CONST=CONST_HZL, settings=settings):
    assert _J_tol > 0, "_J_tol should >0!"

    print("Start Calc: N=%d" % (int(_N)))
    L, R = _J_Min, _J_Max

    print("===>Calculate N=%d, J=%.3f" % (int(_N), L))
    h = Hamiltonian(N=int(_N), J=L, Delta=Delta, **CONST)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
    T_L = TopoOrder(res)

    print("Calculate N=%d, J=%.3f" % (int(_N), R))
    h = Hamiltonian(N=int(_N), J=R, Delta=Delta, **CONST)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
    T_R = TopoOrder(res)

    if T_L == T_R:
        Phase[_i][_j] = -1
        print("===>End Calc: N=%d. No phase transition, Res=%d" %
              (int(_N), TopoOrder(res)))
    else:
        while (R-L) > _J_tol:
            M = (R+L)/2
            print("Calculate N=%d, J=%.3f" % (int(_N), M))
            h = Hamiltonian(N=int(_N), J=M, Delta=Delta, **CONST)
            res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
            T_M = TopoOrder(res)
            if T_M == T_R:
                R = M
            elif T_M == T_L:
                L = M
            else:
                Phase[_i][_j] = R
                raise Exception("Middle result different with either!")
        Phase[_i][_j] = R
        print("===>End Calc: N=%d, phase transition at %.3f" %
              (int(_N), R))
    return
Пример #5
0
def Run_Inv(_T, _J, _i, _j, Phase, N=20, n=None, Delta=3, CONST=CONST_HZL):
    '''
    This func calculate the system with Mirror Symmetry,   which means that for the upper half and the lower half,the parallel components changes sign while the perpendicular term keep unchanged
    :para `n` defines how many layers (in upper half) contains the Spin term. In default, all of the upper half have the spin term.
    '''
    print("Start Calculation: Theta=%.3f , J=%.3f" % (_T, _J))
    _S = np.zeros([N, 3])
    layer = int(N / 2) if n == None else min(int(n), int(N / 2))
    for i in range(layer):
        _S[i, 0], _S[N - i - 1, 0] = 1, 1
        _S[i, 1], _S[N - i - 1, 1] = _T, _T
    S = convertSpin(_S)

    h = Hamiltonian(N=N, J=_J, S=S, Delta=Delta, **CONST)
    res = Calc(h, CalcZ2=True, LogOut=False, settings=settings)
    Phase[_i][_j] = TopoOrder(res)

    print("End Calculation: Theta=%.3f pi , J=%.3f, Result: C=%.4f , Z2=%s" %
          (_T / np.pi, _J, res.Chern, str(res._Z2)))
    return