def _process_theory_specifications(prog, method, basis, mult, orb_type): assert par.is_program(prog) # determine the orbital restriction singlet = (mult == 1) if len(orb_type) == 2: orb_type = orb_type[0] if singlet else orb_type[1] assert orb_type in ('R', 'U') orb_restricted = (orb_type == 'R') # for non-standard DFT/Basis, the user can input whatever they want if not par.Method.is_nonstandard_dft(method): assert par.is_program_method(prog, method) assert par.is_program_method_orbital_type( prog, method, singlet, orb_type) prog = par.standard_case(prog) method = par.standard_case(method) if not par.Basis.is_nonstandard_basis(basis): assert par.is_program_basis(prog, basis) basis = par.standard_case(basis) return prog, method, basis, orb_restricted
def _process_theory_specifications(prog, method, basis, mult, orb_type): """ Process the theory method including the orbital type conversion. :param prog: electronic structure program to use as a backend :type prog: str :param method: electronic structure method :type method: str :param basis: basis set :type basis: str :param mult: spin multiplicity :type mult: int :param orb_type: 'R' indicates restricted orbitals, 'U' indicates unrestricted orbitals; can also be 'RR', 'RU', or 'UU'. Where first (second) character sets R/U for singlets (multiplets) :type orb_type: str :rtype: (str, str, str, str) """ assert par.is_program(prog) # determine the orbital restriction singlet = (mult == 1) if len(orb_type) == 2: orb_type = orb_type[0] if singlet else orb_type[1] assert orb_type in ('R', 'U') orb_restricted = (orb_type == 'R') # for non-standard DFT/Basis, the user can input whatever they want if not par.Method.is_nonstandard_dft(method): print('assert check', prog, method) assert par.is_program_method(prog, method) assert par.is_program_method_orbital_type(prog, method, singlet, orb_type) prog = par.standard_case(prog) method = par.standard_case(method) if not par.Basis.is_nonstandard_basis(basis): assert par.is_program_basis(prog, basis) basis = par.standard_case(basis) return prog, method, basis, orb_restricted
def _process_theory_specifications(prog, method, basis, mult, orb_restricted): assert par.is_program(prog) # for non-standard DFT/Basis, the user can input whatever they want if not par.Method.is_nonstandard_dft(method): assert par.is_program_method(prog, method) singlet = (mult == 1) orb_restricted = (orb_restricted if orb_restricted is not None else singlet) assert par.is_program_method_orbital_restriction( prog, method, singlet, orb_restricted) prog = par.standard_case(prog) method = par.standard_case(method) if not par.Basis.is_nonstandard_basis(basis): assert par.is_program_basis(prog, basis) basis = par.standard_case(basis) return prog, method, basis, orb_restricted