示例#1
0
    plt.gca().set_aspect('equal')
    draw()
    print("etot(eV): ", etot * evpmol)
    # writes out the occ matrix
    # this is the same as metro1
    ofile = open((out_filenm), 'w')
    np.save(ofile, n)
    np.save(ofile, m)
    np.save(ofile, ntotmol)
    np.save(ofile, occm)
    np.save(ofile, etot)
    if (bbcharg):
        np.save(ofile, occm_ch)
        np.save(ofile, occm_higd)
        np.save(ofile, dipoles)
    ofile.close()

    ifilout.close()






"""

if __name__ == '__main__':
    args = scripts.get_args()
    logger = scripts.get_logger(quiet=args.quiet, debug=args.debug)
    simulation = Metro2(args)
        logger.debug("starting simulation...")
        sim.start()
        logger.debug("simulation complete.")
    except Exception as e:
        logger.warning(e.message)

if __name__ == '__main__':
    args = get_args()
    logger = scripts.get_logger(debug=args.debug, quiet=args.quiet, namespace='analytics')
    pool = mp.Pool()
    dt = time.time()
    sim_idx = 0
    for n_idx in range(args.n_min, args.n_max+1, args.n_step):
        for m_idx in range(args.m_min, args.m_max+1, args.m_step):
            for p_idx in range(0, int((args.p_max-args.p_min)/args.p_step)):  # range is integer only, can't do floats
                sim_args = scripts.get_args(default=True)
                sim_args.n_samples = args.n_samples
                sim_args.n = int(n_idx)
                sim_args.m = int(m_idx)
                sim_args.b = args.b
                sim_args.cov = (float(p_idx)/float(sim_args.n*sim_args.m))+0.001
                sim_args.kt = args.kt/(sim_args.kelperev*sim_args.hartree)
                if p_idx >= sim_args.n or p_idx >= sim_args.m:
                    break
                if sim_args.cov > 1:
                    break
                sim_args.quiet = True
                sim_args.display = False  # maybe don't display a f**k tonne of simulations concurrently!
                logger.info("adding simulation of lattice of size {0}x{1} at {2} density".format(sim_args.n, sim_args.m, sim_args.cov))
                sim_path = 'n{0}m{1}p{2}'.format(n_idx, m_idx, p_idx)
                logger.info("saving results to {0}".format(sim_path))