def getbasis(atoms, basis_data=None, **opts): """\ bfs = getbasis(atoms,basis_data=None) Given a Molecule object and a basis library, form a basis set constructed as a list of CGBF basis functions objects. """ from PyQuante.Basis.basis import BasisSet return BasisSet(atoms, basis_data, **opts) # Option to omit f basis functions from imported basis sets omit_f = opts.get('omit_f', False) if not basis_data: from PyQuante.Basis.p631ss import basis_data elif type(basis_data) == type(''): # Assume this is a name of a basis set, e.g. '6-31g**' # and import dynamically basis_data = get_basis_data(basis_data) bfs = [] for atom in atoms: bs = basis_data[atom.atno] for sym, prims in bs: if omit_f and sym == "F": continue for power in sym2powerlist[sym]: bf = CGBF(atom.pos(), power, atom.atid) for expnt, coef in prims: bf.add_primitive(expnt, coef) bf.normalize() bfs.append(bf) return bfs
def getbasis(atoms,basis_data=None,**opts): """\ bfs = getbasis(atoms,basis_data=None) Given a Molecule object and a basis library, form a basis set constructed as a list of CGBF basis functions objects. """ from PyQuante.Basis.basis import BasisSet return BasisSet(atoms, basis_data, **opts) # Option to omit f basis functions from imported basis sets omit_f = opts.get('omit_f',False) if not basis_data: from PyQuante.Basis.p631ss import basis_data elif type(basis_data) == type(''): # Assume this is a name of a basis set, e.g. '6-31g**' # and import dynamically basis_data = get_basis_data(basis_data) bfs = [] for atom in atoms: bs = basis_data[atom.atno] for sym,prims in bs: if omit_f and sym == "F": continue for power in sym2powerlist[sym]: bf = CGBF(atom.pos(),power,atom.atid) for expnt,coef in prims: bf.add_primitive(expnt,coef) bf.normalize() bfs.append(bf) return bfs
def __init__(self, atoms, basis_data=None, **opts): """ """ # Option to omit f basis functions from imported basis sets omit_f = opts.get('omit_f', False) if not basis_data: from PyQuante.Basis.p631ss import basis_data elif type(basis_data) == type(''): # Assume this is a name of a basis set, e.g. '6-31g**' # and import dynamically basis_data = get_basis_data(basis_data) # Creating the function lists, by shell and by arbitrary order bfs = [] # Basis list shells = [] # Shell list n = 0 LIST1 = [ ] # list of atoms and basis function number # GLOBULION ADD LIST2 = [ ] # list of atoms and basis function type # GLOBULION ADD for atom in atoms: bs = basis_data[atom.atno] for sym, prims in bs: # Shell Symbol S,P,D,F A = sym2powerlist[sym] # GLOBULION ADD for ni in xrange(len(sym2powerlist[sym])): # GLOBULION ADD LIST1.append(n) # GLOBULION ADD LIST2.append(A[ni]) if omit_f and sym == "F": continue shell = Shell(sym) for power in sym2powerlist[sym]: cgbf = CGBF(atom.pos(), power, atom.atid) #exps,coefs = zip(*prims) #primlist = [PrimitiveGTO(alpha,atom.pos(),power) for alpha in exps] #bf = ContractedGTO(primlist,coefs) #bf.normalize() [cgbf.add_primitive(alpha, coef) for alpha, coef in prims] bfs.append(cgbf) # Normal ordering # Shell ordering bfs_index = len(bfs) - 1 # last added shell.append(cgbf, bfs_index) shells.append(shell) n += 1 self.bfs = bfs self.shells = shells self.LIST1 = LIST1 # GLOBULION ADD self.LIST2 = LIST2 # GLOBULION ADD
def __init__(self, atoms, basis_data = None, **opts): """ """ # Option to omit f basis functions from imported basis sets omit_f = opts.get('omit_f',False) if not basis_data: from PyQuante.Basis.p631ss import basis_data elif type(basis_data) == type(''): # Assume this is a name of a basis set, e.g. '6-31g**' # and import dynamically basis_data = get_basis_data(basis_data) # Creating the function lists, by shell and by arbitrary order bfs = [] # Basis list shells = []# Shell list n = 0 LIST1 = []# list of atoms and basis function number # GLOBULION ADD LIST2 = []# list of atoms and basis function type # GLOBULION ADD for atom in atoms: bs = basis_data[atom.atno] for sym,prims in bs: # Shell Symbol S,P,D,F A = sym2powerlist[sym] # GLOBULION ADD for ni in xrange(len(sym2powerlist[sym])): # GLOBULION ADD LIST1.append(n) # GLOBULION ADD LIST2.append(A[ni]) if omit_f and sym == "F": continue shell = Shell(sym) for power in sym2powerlist[sym]: cgbf = CGBF(atom.pos(), power, atom.atid) #exps,coefs = zip(*prims) #primlist = [PrimitiveGTO(alpha,atom.pos(),power) for alpha in exps] #bf = ContractedGTO(primlist,coefs) #bf.normalize() [cgbf.add_primitive(alpha,coef) for alpha,coef in prims] bfs.append(cgbf) # Normal ordering # Shell ordering bfs_index = len(bfs)-1 # last added shell.append(cgbf, bfs_index) shells.append(shell) n+=1 self.bfs = bfs self.shells = shells self.LIST1 = LIST1 # GLOBULION ADD self.LIST2 = LIST2 # GLOBULION ADD
def __init__(self,molecule,**opts): from PyQuante.Ints import getbasis from PyQuante.Basis.Tools import get_basis_data basis_data = opts.get('basis_data') bfs = opts.get('bfs') if bfs: self.bfs = bfs else: if not basis_data: basis = opts.get('basis') if basis: basis_data = get_basis_data(basis) self.bfs = getbasis(molecule,basis_data) logging.info("%d basis functions" % len(self.bfs)) return
def __init__(self, molecule, **opts): from PyQuante.Ints import getbasis from PyQuante.Basis.Tools import get_basis_data basis_data = opts.get('basis_data') bfs = opts.get('bfs') if bfs: self.bfs = bfs else: if not basis_data: basis = opts.get('basis') if basis: basis_data = get_basis_data(basis) self.bfs = getbasis(molecule, basis_data) logger.info("%d basis functions" % len(self.bfs)) return
def getbasis(atoms, basis_data=None, **kwargs): """\ bfs = getbasis(atoms,basis_data=None) Given a Molecule object and a basis library, form a basis set constructed as a list of CGBF basis functions objects. """ from PyQuante.Basis.basis import BasisSet if not basis_data: basis_data = kwargs.get('basis_data') if kwargs.get('bfs'): return kwargs.get('bfs') elif not basis_data: basis = kwargs.get('basis') if basis: basis_data = get_basis_data(basis) return BasisSet(atoms, basis_data, **kwargs)
def getbasis(atoms,basis_data=None,**kwargs): """\ bfs = getbasis(atoms,basis_data=None) Given a Molecule object and a basis library, form a basis set constructed as a list of CGBF basis functions objects. """ from PyQuante.Basis.basis import BasisSet if not basis_data: basis_data = kwargs.get('basis_data') if kwargs.get('bfs'): return kwargs.get('bfs') elif not basis_data: basis = kwargs.get('basis') if basis: basis_data = get_basis_data(basis) return BasisSet(atoms, basis_data, **kwargs)