Beispiel #1
0
def optimize_for_energies_2pks(basis_set0, energy_list,  **keyargs):
    b_type = type(basis_set0[0])
    if b_type !=l2.STO and b_type != l2.GTO:
        print 'unsupported basis'
        sys.exit()
    driven_term = l2.h_like_atom('2p').dipole_init_velocity(0)
    def one_iter(basis_set, energy):
        if b_type == l2.STO:
            l_op = l2.h_like_atom('1s').h_minus_energy_sto(energy)
        else:
            l_op = l2.h_like_atom('1s').h_minus_energy_gto(energy)
        return optimize(basis_set, driven_term, l_op, **keyargs)

    ene_zeta_list = []
    basis_set = basis_set0
    for energy in energy_list:
        (conv, basis_set, dummy) = one_iter(basis_set, energy)
        if not conv:
            return (False, ene_zeta_list)
        zeta_list = [ basis.z for basis in basis_set]
        ene_zeta_list.append( (energy, zeta_list) )
    return (True, ene_zeta_list)
Beispiel #2
0
 def one_iter(basis_set, energy):
     if b_type == l2.STO:
         l_op = l2.h_like_atom('1s').h_minus_energy_sto(energy)
     else:
         l_op = l2.h_like_atom('1s').h_minus_energy_gto(energy)
     return optimize(basis_set, driven_term, l_op, **keyargs)