Molecular system
ElemCo.MSystems
— ModuleInfo about molecular system (geometry/basis).
ACentre
and MSystem
structures are used for the atomic centres and the molecular system, respectively.
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 an instance of MSystem
, and the basis set information is stored in basis
field of each atom (ACentre
). The molecular system is defined using the parse_geometry
function:
parse_geometry(geometry, basis)
where geometry
is a string containing the molecular geometry in the XYZ format (or a xyz-file), and basis
is a dictionary containing the basis set information (or a string defining the AO basis).
Geometry
The geometry of the molecule is defined using the geometry
argument of the parse_geometry
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
(default is bohr
). If the first line contains the number of atoms (as in the standard XYZ format), then the next line is skipped, and the default units are 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
see Basis set
The basis set is defined using the basis
argument of the parse_geometry
function.
Exported functions and types
ElemCo.MSystems.ACentre
— TypeACentre
An atomic centre with basis set information.
label::String
: atomic centre label (e.g., "H1")position::StaticArraysCore.SVector{3, Float64}
: atomic position in Bohr (3D vector)atomic_number::Int64
: atomic numbercharge::Float64
: nuclear chargebasis::Dict{String, String}
: basis sets (e.g., "ao"=>"cc-pVDZ")dummy::Bool
: dummy atom
ElemCo.MSystems.MSystem
— TypeMSystem
A molecular system with atomic centres.
centres::Vector{ElemCo.MSystems.ACentre}
: atomic centres
ElemCo.MSystems.atomic_centre_label
— Methodatomic_centre_label(atom::ACentre)
Return atomic centre label (i.e., chemical symbol possibly with a number).
ElemCo.MSystems.atomic_position
— Methodatomic_position(at::ACentre; bohr2ang=false)
Return the position of the atom. If bohr2ang
is true: convert the position to angstrom.
ElemCo.MSystems.bond_length
— Methodbond_length(cen1::ACentre, cen2::ACentre)
Calculate bond length in bohr between two centres.
ElemCo.MSystems.electron_distribution
— Methodelectron_distribution(ms::MSystem, 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.MSystems.element_LABEL
— Methodelement_LABEL(name::AbstractString)
Return element label in all caps and without numbers.
ElemCo.MSystems.element_LABEL
— Methodelement_LABEL(atom::ACentre)
Return element label in all caps and without numbers.
ElemCo.MSystems.element_fullname
— Methodelement_fullname(atom::ACentre)
Return element full name.
ElemCo.MSystems.element_label
— Methodelement_label(name::AbstractString)
Return element label without numbers.
ElemCo.MSystems.element_label
— Methodelement_label(atom::ACentre)
Return element label without numbers.
ElemCo.MSystems.genxyz
— Methodgenxyz(ac::ACentre; angstrom=true)
Generate xyz string with element without numbers.
ElemCo.MSystems.genxyz
— Methodgenxyz(ms::MSystem; angstrom=true)
Generate xyz string with elements without numbers.
ElemCo.MSystems.guess_ncore
— Functionguess_ncore(ms::MSystem, coretype::Symbol=:large)
Guess the number of core orbitals in the system.
coretype
as in Elements.ncoreorbs
.
ElemCo.MSystems.guess_nelec
— Methodguess_nelec(ms::MSystem)
Guess the number of electrons in the neutral system.
ElemCo.MSystems.is_dummy
— Methodis_dummy(ac::ACentre)
Check whether the atom is a dummy atom.
ElemCo.MSystems.nuclear_repulsion
— Methodnuclear_repulsion(ms::MSystem)
Calculate nuclear repulsion energy.
ElemCo.MSystems.parse_geometry
— Methodparse_geometry(geometry::AbstractString, basis::AbstractString)
Parse geometry geometry
and return MSystem
object. The geometry can be in xyz format or in a file. The basis set can be defined for each element in the geometry.
ElemCo.MSystems.parse_geometry
— Methodparse_geometry(geometry::AbstractString, basis::Dict)
Parse geometry geometry
and return MSystem
object. The geometry can be in xyz format or in a file. The basis set can be defined for each element in the geometry.
ElemCo.MSystems.set_dummy!
— Methodset_dummy!(ac::ACentre)
Set the atom as a dummy atom.
ElemCo.MSystems.set_dummy!
— Methodset_dummy!(sys::MSystem, list)
Set dummy atoms in the system. The list can contain atom indices or element labels. All atoms are unset first, i.e., only the atoms in the list are set as dummy.
ElemCo.MSystems.system_exists
— Methodsystem_exists(ms::MSystem)
Check whether the system is not empty.
ElemCo.MSystems.unset_dummy!
— Methodunset_dummy!(ac::ACentre)
Unset the atom as a dummy atom.
Internal functions and types
ElemCo.MSystems.genbasis4element
— Methodgenbasis4element(basis::Dict, elem::AbstractString)
Set element specific basis from, e.g.,
Dict("ao"=>"cc-pVDZ; o=aug-cc-pVDZ;
h={! hydrogen (4s,1p) -> [2s,1p]
s, H , 13.0100000, 1.9620000, 0.4446000, 0.1220000
c, 1.4, 0.0196850, 0.1379770, 0.4781480, 0.5012400
c, 4.4, 1.0000000
p, H , 0.7270000
c, 1.1, 1.0000000}",
"jkfit"=>"cc-pvdz-jkfit")
ElemCo.MSystems.guess_nalpha
— Methodguess_nalpha(ms::MSystem)
Guess the number of alpha electrons in the neutral system.
ElemCo.MSystems.guess_nbeta
— Methodguess_nbeta(ms::MSystem)
Guess the number of beta electrons in the neutral system.
ElemCo.MSystems.guess_nocc
— Methodguess_nocc(ms::MSystem)
Guess the number of alpha and beta occupied orbitals in the neutral system.
ElemCo.MSystems.nshell4l_minbas
— Methodnshell4l_minbas(nnum, basis::String)
Return the number of shells for each angular momentum in the minimal basis set.
ElemCo.MSystems.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 ACentre
s and an empty string in case of success.
Empty lines are skipped. The default units are bohr. 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 (in this case, the default units are angstroms). If parsing fails: return empty array and the line that failed.
ElemCo.MSystems.try2create_atom
— Functiontry2create_atom(line::AbstractString, basis::Dict, ang2bohr=false)
Create ACentre
from a line <Atom> x y z
.
If ang2bohr is true: the coordinates are in angstrom, convert to bohr. Returns the centre and a bool success variable. If the line has a different format: return dummy centre and false.