def get_orb_struc(qtemplate, spin):

    ExtractOrbitalStructure.insert_SKIP_SCFMAN(qtemplate)
    input_scf_skip = qtemplate.strip()[:-3] + "_skip.in"
    output_scf_skip = run_qchem(input_scf_skip)
    num_alpha_occ = ExtractOrbitalStructure.get_num_alpha_orbs(output_scf_skip)
    num_beta_occ = 0
    if spin == 1:
        num_beta_occ = ExtractOrbitalStructure.get_num_beta_orbs(output_scf_skip)
    total_orbs = ExtractOrbitalStructure.get_total_orbs(output_scf_skip, spin)
    return num_alpha_occ, num_beta_occ, total_orbs
Beispiel #2
0
    return energy

###
# Minimize energy w.r.t. temperature
###
#
#def minimize_energy(E, T_start, T_end):
#
#    What function to use?
#    xtol - convergence tolerance
#    scipy.optimize(fun=..., x0='initial guess', method='Nelder-Mead', xtol='conv tol')

###
# Main function
###

if __name__ == "__main__":

    spin = ExtractOrbitalStructure.check_spin(qtemplate)
    alpha_occ, beta_occ, total_orbs = active_space_generator.get_orb_struc(qtemplate, spin)
    print alpha_occ, beta_occ, total_orbs

    if Nact_occ > alpha_occ:
        exit("ERROR: Too many occupied orbitals requested in active space")
    elif total_orbs < (alpha_occ + Nact_virt):
        exit("ERROR: Too many virtual orbitals requested in active space")

    energy = get_energy(1000.0, spin, qtemplate) # Works like this, include temperature more systematically
    print "Energy =",energy