예제 #1
0
print(theta)
print(alpha)

lattice = 'longRange'
para = pm.generate_parameters_dmrg(lattice)
para['l'] = 10  # number of sites
para['jxy'] = 0  # Jxy coupling constant
para['jz'] = 1  # Jz coupling constant
para['hx'] = 0.5  # magnetic field in x direction
para['hz'] = 0  # magnetic field in z direction
para['alpha'] = 0  # decaying parameter of the interaction strength
para['chi'] = 80  # dimension cut-off of DMRG
para['bound_cond'] = 'open'  # boundary condition: open or periodic
para['is_pauli'] = True
para['data_path'] = '.\\data_dmrg\\fullyConnected\\'
mkdir(para['data_path'])

nt = len(theta)
na = len(alpha)
for n1 in range(0, nt):
    for n2 in range(0, na):
        para['theta'] = theta[n1]
        para['alpha'] = alpha[n2]
        para['hx'] = np.cos(theta[n1])
        para['jz'] = np.sin(theta[n1])
        para = pm.make_consistent_parameter_dmrg(para)
        # Run DMRG
        ob, A, info, para = dmrg.dmrg_finite_size(para)
        save(para['data_path'], para['data_exp'] + '.pr', (ob, A, info, para),
             ('ob', 'A', 'info', 'para'))
예제 #2
0
    tol = 1e-4  # to judge if the state has two-fold degeneracy
    lattice = 'chain'
    para = pm.generate_parameters_dmrg(lattice)
    para['spin'] = 'one'
    para['bound_cond'] = 'periodic'
    para['chi'] = 128
    para['l'] = 12
    para['jxy'] = 1
    para['hx'] = 0
    model = 'Spin_' + para['spin'] + '_' + lattice
    # para['data_path'] = '..\\dataQubism\\states_' + model + '\\'
    para['data_path'] = 'E:\\tmpData\\states_' + model + '\\'
    para[
        'image_path'] = '..\\dataQubism\\images_' + model + '\\train 0-' + str(
            delta)
    mkdir(para['data_path'])
    mkdir(para['image_path'])

    n_mid = int(para['l'] / 2)
    nj = len(j)
    nh = len(h)
    for n1 in range(0, nj):
        for n2 in range(0, nh):
            para['jz'] = j[n1]
            para['hz'] = h[n2]
            para = pm.make_consistent_parameter_dmrg(para)
            # Run DMRG
            if path.isfile(
                    path.join(para['data_path'], para['data_exp'] + '.pr')):
                print('Load existing data ...')
                a = load_pr(
예제 #3
0
para = pm.generate_parameters_dmrg(lattice)
para['spin'] = 'half'
para['bound_cond'] = 'periodic'
para['chi'] = chi
para['l'] = L
para['jxy'] = jxy
para['jz'] = jz
para['hx'] = hx
para['hz'] = hz
para['ini_way'] = ini_way
para['eigWay'] = eigWay
para['data_path'] = '..\\..\\..\\data_dmrg\\QIsing\\'
para['time_cut'] = time_cut
if ini_way == 'read_mps':
    para['load'] = {}
    para['load']['path'] = '..\\..\\..\\data_load\\QTSNE\\Ising_spinhalf\\'
    para['load']['Is_continue'] = Is_continue  # 判断是基于未收敛mps继续计算 还是基于同一个基态进行计算。
    para['load']['exp'] = load_exp
    mkdir(para['load']['path'])
else:
    para['load'] = '.'
mkdir(para['data_path'])

para = pm.make_consistent_parameter_dmrg(para)

# Run DMRG
ob, A, info, para = dmrg.dmrg_finite_size(para)
save('.', para['data_exp'] + '.pr', (ob, A, info, para),
     ('ob', 'A', 'info', 'para'))
#save(para['data_path'], para['data_exp'] + '.pr', (ob, A, info, para),('ob', 'A', 'info', 'para'))