) (opts, args) = parser.parse_args() if len(args) < 3: parser.print_help() exit(-1) # input files chg_file = args[0] # output file nac_file = args[1] # S0-S1 excitation energy (in eV) en_diff = float(args[2]) / AtomicData.hartree_to_eV # load molecular geometry and transition charges atomlist, transition_charges = XYZ.read_charges(chg_file) # compute NAC vector nac = coupling_vector(atomlist, transition_charges, en_diff, nuclear_charge=opts.nuclear_charge) # and save it to a file fh_nac = open(nac_file, "w") # write header for NAC vector print("# non-adiabatic coupling vector ( in bohr^-1 ) ", file=fh_nac) print("# X Y Z ", file=fh_nac) # print non-adiabatic coupling vector as (Nat,3) matrix Nat = len(atomlist)
files = sys.argv[1:] cubes = [] molecules = [] charge_lists = [] for f in files: if ".cub" in f: cube = CubeData() cube.loadFromFile(f) cubes.append(cube) molecules.append(cube.atomlist) elif ".xyz" in f: atomlist = XYZ.read_xyz(f)[-1] molecules.append(atomlist) elif ".chg" in f: atomlist, charges = XYZ.read_charges(f) molecules.append(atomlist) charge_lists.append(charges) else: print "Unknown file type: %s" % f window.setWindowTitle(window.windowTitle() + " %s " % f) viewer.setCubes(cubes) viewer.setGeometries(molecules) if len(charge_lists) > 0: viewer.setGeometriesAndCharges(molecules, charge_lists) viewer.selectShowOptions(options=["surfaces", "charges", "transition charges"]) """ # plot E-field mlab = viewer.visualization.scene.mlab