Molecular system
ElemCo.MSystem — ModuleInfo about molecular system (geometry/basis).
The molecular system is the core of the simulation. It contains all the information about the molecule, including the geometry and basis sets The molecular system is defined using the MSys function:
MSys(geometry, basis)where geometry is a string containing the molecular geometry in the XYZ format, and basis is a dictionary containing the basis set information.
Geometry
The geometry of the molecule is defined using the geometry argument of the MSys function. The geometry is defined in the XYZ format. Here's an example of how you can define the geometry of a water molecule:
geometry="bohr
O 0.000000000 0.000000000 -0.130186067
H1 0.000000000 1.489124508 1.033245507
H2 0.000000000 -1.489124508 1.033245507"The first line of the geometry string contains the units of the coordinates. The supported units are bohr and angstrom. The coordinates of the atoms are specified in the following lines. Each line contains the atomic symbol and the coordinates of the atom. The coordinates are separated by spaces or tabs.
Basis set
The basis set is defined using the basis argument of the MSys function. The basis set is defined as a dictionary, where the keys are the names of the basis sets, and the values are the basis set definitions. Here's an example of how you can define the basis set for a water molecule:
basis = Dict("ao"=>"cc-pVDZ",
"jkfit"=>"cc-pvtz-jkfit",
"mp2fit"=>"cc-pvdz-rifit")The basis set dictionary contains three keys: ao, jkfit, and mp2fit. The ao key contains the basis set for the AO integrals, the jkfit key contains the basis set for the density fitting integrals in the Hartree-Fock calculations, and the mp2fit key contains the fitting basis set for the correlated calculations.
Exported functions and types
ElemCo.MSystem.ACenter — TypeAtomic center
name: name (as defined in input).nuccharge: nuclear charge (can be changed...).coord: coordinates in bohr.basis: various basis sets ("ao","mp2fit","jkfit").
ElemCo.MSystem.Basis — TypeBasis set
name: e.g., vdz, cc-pvdz, aug-cc-pvdz, cc-pvdz-jkfit.
ElemCo.MSystem.MSys — TypeGeometry and basis set for each element name in the geometry
atoms: array of atomic centers.
ElemCo.MSystem.bond_length — Methodbond_length(cen1::ACenter, cen2::ACenter)Calculate bond length between two centers.
ElemCo.MSystem.electron_distribution — Methodelectron_distribution(elem::AbstractString, nsh4l::Vector{Int})Distribute electrons among first atomic orbitals in nsh4l[1]s nsh4l[2]p nsh4l[3]d nsh4l[4]f... order considering the Hund's rule and electron configuration of the atom. Average occupations to account for the spin degeneracy and hybridization.
ElemCo.MSystem.electron_distribution — Methodelectron_distribution(elnam::AbstractString, minbas::AbstractString)Return the averaged number of electrons in the orbitals in the minimal basis set.
Number of orbitals in the minimal basis set has to be specified in minbas.jl.
ElemCo.MSystem.generate_basis — Functiongenerate_basis(ms::MSys, type = "ao")Generate basis sets for integral calculations. type can be "ao", "mp2fit" or "jkfit".
ElemCo.MSystem.genxyz — Methodgenxyz(ac::ACenter; bohr=true)Generate xyz string with element without numbers. If bohr: return in coordinates in bohr.
ElemCo.MSystem.genxyz — Methodgenxyz(ms::MSys; bohr=true)Generate xyz string with elements without numbers. If bohr: return in coordinates in bohr
ElemCo.MSystem.guess_ncore — Functionguess_ncore(ms::MSys, coretype::Symbol=:large)Guess the number of core orbitals in the system.
coretype as in ncoreorbs.
ElemCo.MSystem.guess_nelec — Methodguess_nelec(ms::MSys)Guess the number of electrons in the neutral system.
ElemCo.MSystem.guess_norb — Methodguess_norb(ms::MSys)Guess the number of orbitals in the system.
ElemCo.MSystem.ms_exists — Methodms_exists(ms::MSys)Check whether the system is not empty.
ElemCo.MSystem.nuclear_repulsion — Methodnuclear_repulsion(ms::MSys)Calculate nuclear repulsion energy.
Internal functions and types
ElemCo.MSystem.SubShell — TypeOccupation of the subshell with quantum numbers $n$ and $l$.
n::Int64: $n$-quantum number of the subshell.l::Int64: $l$-quantum number of the subshell.nel::Int64: Number of electrons in the subshell.
ElemCo.MSystem.a2b — Methoda2b(vals,skip)Transform from angstrom to bohr (if skip: no transformation).
ElemCo.MSystem.b2a — Methodb2a(vals,skip)Transform from bohr to angstrom (if skip: no transformation).
ElemCo.MSystem.element_NAME — Methodelement_NAME(name::AbstractString)Return element name in all caps and without numbers.
ElemCo.MSystem.element_name — Methodelement_name(name::AbstractString)Return element name without numbers.
ElemCo.MSystem.genbasis4element — Methodgenbasis4element(basis::Dict,elem::AbstractString)Set element specific basis from, e.g., Dict("ao"=>"cc-pVDZ; o=aug-cc-pVDZ","jkfit"=>"cc-pvdz-jkfit")
ElemCo.MSystem.guess_nalpha — Methodguess_nalpha(ms::MSys)Guess the number of alpha electrons in the neutral system.
ElemCo.MSystem.guess_nbeta — Methodguess_nbeta(ms::MSys)Guess the number of beta electrons in the neutral system.
ElemCo.MSystem.guess_nocc — Methodguess_nocc(ms::MSys)Guess the number of alpha and beta occupied orbitals in the neutral system.
ElemCo.MSystem.n_orbitals_in_subshell — Methodn_orbitals_in_subshell(shell::Char)Return the number of orbitals in the subshell.
ElemCo.MSystem.ncoreorbs — Functionncoreorbs(elem::AbstractString, coretype::Symbol=:large)Guess the number of core orbitals in the element.
coretype:
:large- large core (w/o semi-core):small- small core (w/ semi-core):none- no core
ElemCo.MSystem.nshell4l_minbas — Methodnshell4l_minbas(nnum, basis::String)Return the number of shells for each angular momentum in the minimal basis set.
ElemCo.MSystem.nuclear_charge_of_center — Methodnuclear_charge_of_center(elem::AbstractString)Return the nuclear charge of the element.
ElemCo.MSystem.parse_electron_configuration — Methodparse_electron_configuration(e::AbstractString)Parse the electron configuration string and return the number of electrons in each subshell. e.g. "[He] 2s^2 2p^6 3s^2 3p^6" -> [SubShell(1,0,2), SubShell(2,0,2), SubShell(2,1,6), SubShell(3,0,2), SubShell(3,1,6)]
ElemCo.MSystem.parse_xyz_geometry — Methodparse_xyz_geometry(xyz_lines::AbstractArray, basis::Dict)Parse xyz geometry xyz_lines stored as a vector of strings. Return array of atomic centers and an empty string in case of success.
Empty lines are skipped. If the line is bohr or angstrom: change the units. If the first line is a number: assume xyz format and skip the second line. If parsing fails: return empty array and the line that failed.
ElemCo.MSystem.try2create_acenter — Functiontry2create_acenter(line::AbstractString, basis::Dict, bohr = true)Create ACenter from a line <Atom> x y z.
If !bohr: coords are in angstrom. Returns the center and a bool success variable. If the line has a different format: return dummy center and false.