Beispiel #1
0
if __name__ == "__main__":
    np.random.seed(1)
    np.set_printoptions(linewidth=2000, precision=5,threshold=4000)

    args = parse_args.parse_args()

    L = args.L
    Hamiltonian = args.H
    assert Hamiltonian in ['TFI', 'XXZ']

    J = 1.
    if Hamiltonian == 'TFI':
        g = args.g
        h = args.h
        H_list = qTEBD.get_H(Hamiltonian, L, J, g, h)
        H_model = model.MpoModel(L, J, g=g, h=h, Hamiltonian=Hamiltonian)
        H_mpo = H_model.H_mpo_hor
    elif Hamiltonian == 'XXZ':
        g = delta = args.delta
        H_list = qTEBD.get_H(Hamiltonian, L, J, delta, 0)
        H_model = model.MpoModel(L, J, delta, Hamiltonian)
        H_mpo = H_model.H_mpo_hor

    depth = args.depth
    N_iter = args.N_iter
    order = args.order

    save_each = 100
    assert order in ['1st', '2nd']
Beispiel #2
0
    h = float(sys.argv[3])
    depth = int(sys.argv[4])
    N_iter = int(sys.argv[5])
    order = str(sys.argv[6])
    ## the target state is corresponding to time T.
    T = float(sys.argv[7])

    save_each = 100
    tol = 1e-12
    cov_crit = tol * 0.1
    max_N_iter = N_iter

    assert order in ['1st', '2nd', '4th']

    Hamiltonian = 'TFI'
    H_list = qTEBD.get_H(Hamiltonian, L, J, g, h)
    Sz_list = [np.array([[1, 0.], [0., -1.]]) for i in range(L)]

    ############### LOAD TARGET STATE ######################
    if np.isclose(g, 1.):
        chi = 128
    else:
        chi = 32

    # data_tebd_dt1.000000e-03/1d_TFI_g1.4000_h0.*/L31/trunc_wf_chi32_4th/
    mps_dir_path = './data_tebd_dt%e/1d_%s_g%.4f_h%.4f/L%d/trunc_wf_chi%d_4th/' % (
        1e-3, Hamiltonian, g, h, L, chi)
    filename = mps_dir_path + 'T%.1f.pkl' % T
    target_mps = pickle.load(open(filename, 'rb'))

    ############### SET UP INITIALIZATION #################
Beispiel #3
0
    J = 1.
    g = float(sys.argv[2])
    h = float(sys.argv[3])
    depth = int(sys.argv[4])
    N_iter = int(sys.argv[5])
    order = str(sys.argv[6])
    total_t = 30.
    dt = 0.01
    save_each = int(0.1 // dt)
    tol = 1e-12
    cov_crit = tol * 0.1
    max_N_iter = N_iter

    assert order in ['1st', '2nd']
    Hamiltonian = 'TFI'
    H_list  =  qTEBD.get_H(Hamiltonian, L, J, g, h, change_basis=True)
    Sz_list = [np.array([[1, 0.], [0., -1.]]) for i in range(L)]

    U_list =  qTEBD.make_U(H_list, 1j * dt)
    U_half_list =  qTEBD.make_U(H_list, 0.5j * dt)

    idx = 0
    my_circuit = []
    t_list = [0]
    E_list = []
    update_error_list = [0.]
    Sz_array = np.zeros([int(total_t // dt) + 1, L], dtype=np.complex)
    ent_array = np.zeros([int(total_t // dt) + 1, L-1], dtype=np.double)
    num_iter_array = np.zeros([int(total_t // dt) + 1], dtype=np.int)