ElemCo.jl global information
ElemCo.ECInfos — Module
Various global infos
Main structure
ElemCo.ECInfos.ECInfo — Type
ECInfoGlobal information for ElemCo.
scr::String:⟨"system-tmpdir/elemcojlscr/jl_*"⟩path to scratch directory.ext::String:⟨".bin"⟩extension of temporary files.verbosity::Int64:⟨2⟩verbosity level.options::ElemCo.ECInfos.Options: options.system::ElemCo.MSystems.MSystem: molecular system.fd::ElemCo.FciDumps.TFDump: fcidump.files::Dict{String, String}: information about (temporary) files. The naming convention is:prefix_ +name(+extensionEC.extadded automatically).prefixcan be:dfor dressed integralsSfor overlap matrixffor Fock matrixefor orbital energiesDfor density matrixhfor core HamiltonianCfor transformation from one basis to anotherTfor amplitudesUfor trial vectors or Lagrange multipliers
nameis given by the subspaces involved:ofor occupiedvfor virtualOfor occupied-βVfor virtual-βmfor (full) MO spaceMfor (full) β-MO spaceAfor AO basisafor active orbitalsdfor doubly-occupied (closed-shell) orbitalssfor singly-occupied (open-shell) orbitalsSfor singly-occupied with β electron (open-shell) orbitalsPfor auxiliary orbitals (fitting basis)Lfor auxiliary orbitals (Cholesky decomposition, orthogonal)Xfor auxiliary orbitals (amplitudes decomposition)
The order of subspaces is important, e.g.,
ovis occupied-virtual,vois virtual-occupied. Normally, the first subspaces correspond to subscripts of the tensor. For example,T_vocontains the singles amplitudes $T_{a}^{i}$. Disambiguity can be resolved by introducing^to separate the subscripts from the superscripts, e.g.,d_XXcontains $\hat v_{XY}$ andd_^XXcontains $\hat v^{XY}$ integrals. Subspaces with multiple characters are possible using{}, e.g.,C_vo{bX}contains $U_{a}^{i\bar X}$.
space::Dict{Char, Vector{Int64}}: subspaces: 'o'ccupied, 'v'irtual, 'O'ccupied-β, 'V'irtual-β, ':'/'m'/'M' full MO.
Exported functions
ElemCo.ECInfos.file_description — Method
file_description(EC::ECInfo, name::String)Return description of file name in ECInfo.
ElemCo.ECInfos.flipspin — Method
flipspin(sp::Char)Flip spin for a given space character.
ElemCo.ECInfos.freeze_core! — Function
freeze_core!(EC::ECInfo, core::Symbol, freeze_nocc::Int, freeze_orbs=[]; verbose=true)Freeze freeze_nocc occupied orbitals or orbitals on the freeze_orbs list. If freeze_nocc is negative and freeze_orbs is empty: guess the number of core orbitals.
core as in MSystems.guess_ncore.
ElemCo.ECInfos.freeze_nocc! — Method
freeze_nocc!(EC::ECInfo, freeze; verbose=true)Freeze occupied orbitals from the freeze list.
ElemCo.ECInfos.freeze_nvirt! — Function
freeze_nvirt!(EC::ECInfo, nfreeze::Int, freeze_orbs=[]; verbose=true)Freeze nfreeze virtual orbitals or orbitals on the freeze_orbs list.
ElemCo.ECInfos.fullfilename — Method
fullfilename(EC::ECInfo, name::String)
Return the full filename for file name in ECInfo.
The file is assumed to be in the scratch directory EC.scr with extension EC.ext. The filename is canonicalized by canonicalize_filename(name) and the extension is added.
ElemCo.ECInfos.get_occvirt — Method
get_occvirt(occas::String, occbs::String, norb, nelec; ms2=0, orbsym=Vector{Int}, ignore_error=false, verbose=true)Use a +/- string to specify the occupation. If occbs=="-", the occupation from occas is used (closed-shell). If both are "-", the occupation is deduced from nelec and ms2. The optional argument orbsym is a vector with length norb of orbital symmetries (1 to 8) for each orbital.
ElemCo.ECInfos.get_options — Method
get_options(opt)Return a NamedTuple with the current options for options opt.
ElemCo.ECInfos.get_options — Method
get_options(opt::Options)Return a nested NamedTuple with the current options.
ElemCo.ECInfos.is_closed_shell — Method
is_closed_shell(EC::ECInfo)Check if the system is closed-shell according the to the reference occupation and FCIDump.
ElemCo.ECInfos.isalphaspin — Method
isalphaspin(sp1::Char,sp2::Char)Try to guess spin of an electron: lowcase α, uppercase β, non-letters skipped. Return true for α spin. Throws an error if cannot decide.
ElemCo.ECInfos.len_spaces — Method
len_spaces(EC::ECInfo, spaces::String)Return lengths of spaces (e.g., "vo" for occupied and virtual orbitals).
ElemCo.ECInfos.n_occ_orbs — Method
n_occ_orbs(EC::ECInfo)Return number of occupied orbitals (for UHF: α).
ElemCo.ECInfos.n_occb_orbs — Method
n_occb_orbs(EC::ECInfo)Return number of occupied orbitals (β).
ElemCo.ECInfos.n_orbs — Method
n_orbs(EC::ECInfo)Return number of orbitals.
ElemCo.ECInfos.n_virt_orbs — Method
n_virt_orbs(EC::ECInfo)Return number of virtual orbitals (for UHF: α).
ElemCo.ECInfos.n_virtb_orbs — Method
n_virtb_orbs(EC::ECInfo)Return number of virtual orbitals (β).
ElemCo.ECInfos.parse_orbstring — Method
parse_orbstring(orbs::String; orbsym=Vector{Int})Parse a string specifying some list of orbitals, e.g., -3+5-8+10-12 → [1 2 3 5 6 7 8 10 11 12] or use ':' and ';' instead of '-' and '+', respectively.
ElemCo.ECInfos.reset_wf_info! — Method
reset_wf_info!(EC::ECInfo)Reset ECInfos.WfOptions to default.
ElemCo.ECInfos.restore_space! — Method
restore_space!(EC::ECInfo, space)Restore the space.
ElemCo.ECInfos.save_space — Method
save_space(EC::ECInfo)Save the current subspaces of space.
ElemCo.ECInfos.set_options! — Method
set_options!(opt, allopts)Set options for option opt from allopts.
ElemCo.ECInfos.set_options! — Method
set_options!(opt; kwargs...)Set options for option opt using keyword arguments.
ElemCo.ECInfos.setup_space! — Method
setup_space!(EC::ECInfo, norb, nelec, ms2, orbsym; verbose=true)Setup EC.space from norb, nelec, ms2, orbsym or occa/occb.
ElemCo.ECInfos.setup_space_fd! — Method
setup_space_fd!(EC::ECInfo; verbose=true)Setup EC.space from fcidump EC.fd.
ElemCo.ECInfos.setup_space_system! — Method
setup_space_system(EC::ECInfo; verbose=true)Setup EC.space from molecular system EC.system.
ElemCo.ECInfos.space4spin — Method
space4spin(sp::Char, alpha::Bool)Return the space character for a given spin. sp on input has to be lowercase.
ElemCo.ECInfos.spin4space — Method
spin4space(sp::Char)Return spin for a given space character.
ElemCo.ECInfos.with_local_options — Method
with_local_options(f::Function, EC::ECInfo, local_opts::NamedTuple)Execute function f with local options applied, then restore original options.
The local_opts is a NamedTuple where keys are option category names (e.g., wf, cc, scf) and values are NamedTuples of option key-value pairs.
Example
with_local_options(EC, (wf=(charge=-1, ms2=1), cc=(maxit=30,))) do
ccdriver(EC, "ccsd")
endFile management
ElemCo.ECInfos.file_exists — Function
file_exists(EC::ECInfo, name::String)Check if file name exists in ECInfo.
ElemCo.ECInfos.add_file! — Function
add_file!(EC::ECInfo, name::String, descr::String; overwrite=false)Add file name to ECInfo with (space-separated) descriptions descr. Possible description: tmp (temporary).
ElemCo.ECInfos.copy_file! — Function
copy_file!(EC::ECInfo, from::AbstractString, to::AbstractString; overwrite=false)Copy file from to to.
ElemCo.ECInfos.delete_file! — Function
delete_file!(EC::ECInfo, name::AbstractString)Delete file name from ECInfo.
ElemCo.ECInfos.delete_files! — Function
delete_files!(EC::ECInfo, which::AbstractString)Delete files in ECInfo which match description in which.
which can be a space-separated string of descriptions (then all descriptions have to match) Examples:
delete_files!(EC, "tmp")deletes all temporary files.delete_files!(EC, "tmp orbs")deletes all temporary files with additional description "orbs"
delete_files!(EC::ECInfo, which::AbstractArray{String})Delete files in ECInfo which match any description in array which.
Examples:
delete_files!(EC, ["tmp","orbs"])deletes all temporary files and all files with description "orbs".delete_files!(EC, ["tmp orbs","tmp2"])deletes all temporary files with description "orbs" and all files with description "tmp2".
ElemCo.ECInfos.delete_temporary_files! — Function
delete_temporary_files!(EC::ECInfo)Delete all temporary files in ECInfo.
Internal functions
ElemCo.ECInfos.active_space — Method
active_space(EC::ECInfo)Return active space and the new doubly-occupied (closed-shell) space.
EC.space has to be set up. The active space is defined either
- from the option
wf.active, if set up. The format is either an occupation string, or(#elec, #orb). - from the singly-occupied orbitals in the reference occupation (from
EC.space).
ElemCo.ECInfos.canonicalize_filename — Method
canonicalize_filename(name::String)Canonicalize a filename by stripping whitespace and changing each capital letter to the corresponding lowercase letter plus 'ß'.
ElemCo.ECInfos.remove_orbs_from_spaces! — Method
remove_orbs_from_spaces!(EC::ECInfo, orbs; exclude=[':', 'm', 'M'])Remove orbs from all subspaces in EC.space.
exclude is a list of subspaces to exclude (by default, exclude full MO spaces).
ElemCo.ECInfos.symorb2orb — Method
symorb2orb(symorb::AbstractString, symoffset::Vector{Int})Convert a symorb (like 1.3 [orb.sym]) to an orbital number. If no sym given, just return the orbital number converted to Int.
Abstract types
ElemCo.AbstractEC — Module
Abstract types to resolve circular dependenciesElemCo.AbstractEC.AbstractDeterminant — Type
AbstractDeterminantAbstract type for determinants with alpha and beta occupation patterns. Concrete implementations should have alpha and beta fields.