Basis set

The basis set is defined as a dictionary, where the keys are the types of the basis sets, and the values are the basis set:

basis = Dict("ao"=>"cc-pVTZ",
             "jkfit"=>"cc-pvtz-jkfit",
             "mpfit"=>"cc-pvtz-mpfit")

The basis set dictionary contains three keys: ao, jkfit, and mpfit. 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 mpfit key contains the fitting basis set for the correlated calculations.

Alternatively, you can define the basis set using a string that defines the AO basis. In this case, the jkfit and mpfit basis names will be generated automatically. Here's an example of how you can define the basis set using a string:

basis = "cc-pVDZ"

Common acronyms are also supported for the basis set names, e.g., cc-pVDZ can be written as vdz, and aug-cc-pVTZ can be written as avtz.

Additionally to the default basis, it is possible to specify basis sets for each element/center:

basis = Dict("ao"=>"avdz; O=avtz; H1=vdz; H2=vtz",
             "jkfit"=>"cc-pvtz-jkfit",
             "mpfit"=>"cc-pvtz-mpfit")

In this case, the basis set for the AO integrals is avdz for all elements, except for oxygen (irrespective of the name in the geometry, i.e., "O", "O1", etc), which uses avtz, and hydrogen, which uses vdz and vtz for the centers named "H1" and "H2", respectively.

Moreover, it is possible to define custom basis sets for each element/center using the Molpro format:

basis = Dict("ao"=>"cc-pVTZ; o=avdz;
             h={! hydrogen
                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"=>"vtz-jkfit",
             "mpfit"=>"avtz-mpfit")

In this case, the basis set for the AO integrals is cc-pVTZ for all elements, except for oxygen, which uses avdz, and hydrogen, which uses a custom basis set. The Fock density fitting basis set is vtz-jkfit, and the fitting basis set for the correlated calculations is avtz-mpfit.

Exported functions and types

ElemCo.BasisSets.AngularShellType
AngularShell

Type for angular shells, i.e, subshells with the same angular momentum. For general contracted basis sets, the angular shell is a collection of all subshells with the same l quantum number. For some other basis sets (e.g., the def2-family), the angular shell can be a single subshell with a specific l quantum number. id is the index of the angular shell in the basis set.

  • element::String: element symbol (e.g., "H")

  • l::Int64: angular momentum

  • exponents::Vector{Float64}: array of exponents

  • subshells::Vector{ElemCo.BasisSets.BasisContraction}: array of subshells (contractions)

  • id::Int64: index of the angular shell in the basis set

source
ElemCo.BasisSets.BasisCentreType
BasisCentre

A basis centre (atom) with basis functions.

  • name::String: basis centre name (e.g., "H1")

  • position::StaticArraysCore.SVector{3, Float64}: atomic position in Bohr (3D vector)

  • atomic_number::Int64: atomic number

  • charge::Int64: nuclear charge (= 0 for dummy atoms)

  • basis::String: name of the basis set (e.g., "cc-pVDZ")

  • shells::Vector{ElemCo.BasisSets.AngularShell}: array of angular shells

source
ElemCo.BasisSets.BasisSetType
BasisSet

A basis set with basis centres (atoms) and basis functions.

  • centres::Vector{ElemCo.BasisSets.BasisCentre}: array of basis centres (atoms) with basis functions.

  • shell_indices::Vector{CartesianIndex{2}}: indices for angular shells.

  • centre_ranges::Vector{UnitRange{Int64}}: centre ranges for each basis set in a combined set.

  • shell_ranges::Vector{UnitRange{Int64}}: angular shell ranges for each basis sets in a combined set.

  • cartesian::Bool: cartesian basis set

  • lib::ElemCo.BasisSets.ILibcint5: infos for integral library (at the moment only libcint5 is possible).

source
ElemCo.BasisSets.ao_listFunction
ao_list(basis::BasisSet, ibas=1)

Return the list of atomic orbitals in the basis set.

For a combined basis set, use ibas to select the basis set.

source
ElemCo.BasisSets.centre_rangeFunction
centre_range(bs::BasisSet, i::Int=1)

Return the range of centres for the ith basis set.

The range is used to access the centres in the basis set, e.g., bs.centres[i] for i in centre_range(bs, 1) gives the centres of the first basis set.

source
ElemCo.BasisSets.coefficients_1matMethod
coefficients_1mat(ashell::AngularShell, cartesian::Bool)

Return a single contraction matrix of the coefficients in the angular shell (nprimitives × nsubshells). The contractions are normalized.

The missing coefficients are set to zero in the matrix.

source
ElemCo.BasisSets.combineMethod
combine(bs1::BasisSet, bs2::BasisSet)

Combine two basis sets.

The centres are concatenated. The centre/shell ranges (centre_ranges/shell_ranges) corresponding to the centres/shells for each basis set can be used to access the centres/shells in the combined basis set, e.g. bs.centres[i] for i in bs.centre_ranges[1] gives the centres of the first basis set in the combined set.

source
ElemCo.BasisSets.generate_basisFunction
generate_basis(EC::ECInfo, type="ao"; basisset::AbstractString="")

Generate basis sets for integral calculations.

The basis set is stored in BasisSet object. type can be "ao", "mpfit" or "jkfit". If basisset is provided, it is used as the basis set.

source
ElemCo.BasisSets.generate_basisFunction
generate_basis(ms::MSystem, type="ao"; cartesian=false, basisset::AbstractString="")

Generate basis sets for integral calculations.

The basis set is stored in BasisSet object. type can be "ao", "mpfit" or "jkfit". If basisset is provided, it is used as the basis set.

source
ElemCo.BasisSets.n_aoMethod
n_ao(ashell::AngularShell, cartesian::Bool)

Return the number of atomic orbitals in the angular shell.

source
ElemCo.BasisSets.n_aoMethod
n_ao(atom::BasisCentre, cartesian::Bool)

Return the number of atomic orbitals in the basis set for atom.

source
ElemCo.BasisSets.n_coefficients_1matMethod
n_coefficients_1mat(ashell::AngularShell)

Return the number of coefficients in the angular shell for a single contraction matrix.

The missing coefficients will be set to zero.

source
ElemCo.BasisSets.normalize_contractionMethod
normalize_contraction(subshell::BasisContraction, ashell::AngularShell, cartesian::Bool)

Normalize the contraction coefficients in subshell.

The subshell has to be part of the angular shell ashell. Return the normalized contraction.

source
ElemCo.BasisSets.shell_rangeFunction
shell_range(bs::BasisSet, i::Int=1)

Return the range of angular shells for the ith basis set.

The range is used to access the angular shells in the basis set, e.g., bs[i] for i in shell_range(bs, 1) gives the angular shells of the first basis set.

source

Internal functions and types

ElemCo.BasisSets.CartesianAtomicOrbitalType

CartesianAtomicOrbital

Represents an atomic orbital in a cartesian basis set.

  • icentre::UInt16: index of the centre in the basis set object

  • iangularshell::UInt16: index of the angular shell in the basis set object

  • isubshell::UInt8: index of the subshell in the angular shell

  • n::UInt8: principal quantum number

  • l::UInt8: orbital angular momentum quantum number

  • ml::Int8: magnetic "quantum number" (ml = -l:l(l+1)/2)

source
ElemCo.BasisSets.SphericalAtomicOrbitalType

SphericalAtomicOrbital

Represents an atomic orbital in a spherical basis set.

  • icentre::UInt16: index of the centre in the basis set object

  • iangularshell::UInt16: index of the angular shell in the basis set object

  • isubshell::UInt8: index of the contraction in the angular shell

  • n::UInt8: principal quantum number

  • l::UInt8: orbital angular momentum quantum number

  • ml::Int8: magnetic quantum number (ml = -l:l)

source
Base.getindexMethod
Base.getindex(bs::BasisSet, i::CartesianIndex{2})

Return the the angular shell.

source
Base.getindexMethod
Base.getindex(bs::BasisSet, i::Int, j::Int)

Return the the angular shell.

source
Base.iterateFunction
Base.iterate(bs::BasisSet, state=1)

Iterate over the basis angular shells in the basis set.

source
Base.lengthMethod
Base.length(bs::BasisSet)

Return the number of angular shells in the basis set.

source
ElemCo.BasisSets.full_basis_nameMethod
full_basis_name(basis_name::AbstractString)

Return the full basis name and version number (if given as *.v[0-2], otherwise -1 is returned).

I.e,

  • [a][wc/c]vXz* -> [aug-]cc-p[wc/c]vXz*
  • svp* -> def2-svp*
  • [tq]zvp* -> def2-[tq]zvp*

Additionally check for version number (e.g., vdz.v2)

source
ElemCo.BasisSets.parse_basisMethod
parse_basis(basis_name::String, atom::ACentre; fallback=false)

Search and parse the basis set for a given atom. If fallback is true, use def2-universal-jkfit as a fallback basis set.

Return a list of angular shells AngularShell.

source
ElemCo.BasisSets.parse_basis_blockMethod
parse_basis_block(basis_block::AbstractString, atom::ACentre)

Parse the basis block for a given atom.

Return a list of angular shells AngularShell. The basis block is in the Molpro format:

  • ! comments
  • s,p,d,f,g,h angular momentum
  • c, <from>.<to> contraction coefficients for primitives

Example cc-pVDZ for H atom:

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

For generally-contracted basis sets (like the one above), one angular shell is created for each angular momentum type s,p,d,f,g,h with the corresponding exponents and contraction coefficients. For other basis sets, like the def2-SVP, each contraction is a separate angular shell:

! hydrogen             (4s,1p) -> [2s,1p]
s, H , 13.0107010, 1.9622572, 0.44453796, 0.12194962
c, 1.3, 0.19682158E-01, 0.13796524, 0.47831935
c, 4.4, 1.0000000
p, H , 0.8000000
c, 1.1, 1.0000000
source
ElemCo.BasisSets.parse_contractionMethod
parse_contraction(conline::AbstractString)

Parse contraction coefficients from a line in the basis block.

Return the range of exponents and the contraction coefficients as a tuple. The line is in the Molpro format: c, 1.4, 0.0196850, 0.1379770, 0.4781480, 0.5012400 where c is the contraction, 1.4 is the exponent range, and the rest are the coefficients.

source
ElemCo.BasisSets.parse_exponentsMethod
parse_exponents(expline::AbstractString)

Parse exponents from a line in the basis block.

Return the angular momentum and exponents as a tuple. The line is in the Molpro format: s, H , 13.0100000, 1.9620000, 0.4446000, 0.1220000 where s is the angular momentum, H is the element symbol, and the rest are the exponents.

source
ElemCo.BasisSets.read_basis_blockMethod
read_basis_block(basisfile::AbstractString, atom::ACentre)

Read the basis block for a given atom.

The basis library is in the Molpro format:

  • ! comments
  • basis block starts with ! <elementname> ....
  • basis block ends with ! or }
  • basis block contains:
  • s,p,d,f,g,h angular momentum
  • c, <from>.<to> contraction coefficients for primitives

Example cc-pVDZ for H atom:

!
! 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
!
source
ElemCo.BasisSets.set_id!Method
set_id!(ashells::AbstractArray{AngularShell}, start_id)

Set the id for each angular shell in the array. Return the next id.

source
ElemCo.BasisSets.set_id!Method
set_id!(centres::AbstractArray{BasisCentre}, start_id)

Set the id for each angular shell in the array of centres. Return the next id.

source
ElemCo.BasisSets.split_angular_shellMethod
split_angular_shell(ashell::AngularShell)

If the ranges of exponents do not overlap, split the angular shell into separate angular shells for each subshell. The shells are kept together only if one is a subset of the other.

source