예제 #1
0
        type=str,
        default="./data/wi29.tsp",
        help="specify a file which contains cities's information.")
    parser.add_argument("--trotter_dim", type=int, default=10)
    parser.add_argument("--ann_para",
                        type=float,
                        default=1.0,
                        help="initial annealing parameter")
    parser.add_argument("--ann_step", type=int, default=1000)
    parser.add_argument("--mc_step", type=int, default=5000)
    parser.add_argument("--beta", type=float, default=float(36))
    parser.add_argument("--reduc_para", type=float, default=0.999)
    args = parser.parse_args()

    # prepare annealer
    anneal = qmc.QMC(args.trotter_dim, args.ann_para, args.ann_step,
                     args.mc_step, args.beta, args.reduc_para)
    anneal.read(args.file)

    anneal.calc_max_distance()

    config_at_init_time = list(-np.ones(anneal.NCITY, dtype=np.int))
    config_at_init_time[0] = 1

    print("start...")
    t0 = time.clock()

    np.random.seed(100)
    spin = anneal.getSpinConf(config_at_init_time)
    LengthList = list()
    for t in range(anneal.ANN_STEP):
        for i in range(anneal.MC_STEP):
예제 #2
0
def run_qmc(config):
    #construct wf
    wavefunction = build_wf(config)
    #run qmc
    qmc.QMC(wavefunction, config).run()
    return