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