FCIDump files
ElemCo.FciDumps — Module
Read and write fcidump format integrals. Individual arrays of integrals can also be in *.npy format
The FCIDump file format is a simple text file format for storing molecular integrals. It is used by many quantum chemistry programs.
Storage of molecular integrals
ElemCo.FciDumps.FDump — Type
FDump{N}Molecular integrals
The 2-e integrals are stored in the physicists' notation: int2[pqrs] $= <pq|rs>=v_{pq}^{rs}$
N denotes the number of indices in the 2-e-integral tensors, for N=3 (usual) the last two indices are stored as a single uppertriangular index (r <= s)
int2::Array{Float64}: 2-e⁻ integrals for restricted orbitals fcidump.int2aa::Array{Float64}: αα 2-e⁻ integrals for unrestricted orbitals fcidump.int2bb::Array{Float64}: ββ 2-e⁻ integrals for unrestricted orbitals fcidump.int2ab::Array{Float64, 4}: αβ 2-e⁻ integrals for unrestricted orbitals fcidump.int1::Matrix{Float64}: 1-e⁻ integrals for restricted orbitals fcidump.int1a::Matrix{Float64}: α 1-e⁻ integrals for unrestricted orbitals fcidump.int1b::Matrix{Float64}: β 1-e⁻ integrals for unrestricted orbitals fcidump.int0::Float64: core energyhead::ElemCo.FciDumps.FDumpHeader: header of fcidump file, a dictionary of arrays.origin::String: path of the original fcidump file, empty if created from scratch.modified::Bool:⟨false⟩has the integrals been modified after reading?uhf::Bool:⟨false⟩a convinience variable, has to coincide withhead["IUHF"][1] > 0.
Exported functions
ElemCo.FciDumps.fd_ismodified — Method
fd_ismodified(fd::FDump)Return true if the object has been modified after reading
ElemCo.FciDumps.fd_origin — Method
fd_origin(fd::FDump)Return the path of the original fcidump file, empty if created from scratch.
ElemCo.FciDumps.headvar — Method
headvar(fd::FDump, key::String)Check header for key, return value if a list, or the element or nothing if not there.
ElemCo.FciDumps.headvar — Method
headvar(head::FDumpHeader, key::String)Check header for key, return value if a list, or the element or nothing if not there.
ElemCo.FciDumps.headvar — Method
headvar(fd::FDump, key::String, ::Type{T}) where {T}Check header for key, return the first element or nothing if not there.
ElemCo.FciDumps.headvar — Method
headvar(head::FDumpHeader, key::String, ::Type{T}) where {T}Check header for key of type T, return the first element or nothing if not there.
ElemCo.FciDumps.headvars — Method
headvars(fd::FDump, key::String, ::Type{T}) where {T}Check header for key, return a vector of values or nothing if not there.
ElemCo.FciDumps.headvars — Method
headvars(head::FDumpHeader, key::String, ::Type{T}) where {T}Check header for key of type T, return a vector of values or nothing if not there.
ElemCo.FciDumps.int1_npy_filename — Function
int1_npy_filename(fd::FDump, spincase::Symbol=:α)Return filename for 1-e integrals in npy format. spincase can be :α or :β for UHF fcidump.
ElemCo.FciDumps.int2_npy_filename — Function
int2_npy_filename(fd::FDump, spincase::Symbol=:α)Return filename for 2-e integrals in npy format. spincase can be :α, :β or :αβ for UHF fcidump.
ElemCo.FciDumps.integ1 — Function
integ1(fd::FDump, spincase::Symbol=:α)Return 1-e⁻ integrals (for UHF fcidump: for spincase). spincase can be :α or :β.
ElemCo.FciDumps.integ2 — Function
integ2(fd::FDump, spincase::Symbol=:α)Return 2-e⁻ integrals (for UHF fcidump: for spincase). spincase can be :α, :β or :αβ.
Use type-stable versions instead: integ2_ss for same-spin integrals and integ2_os for opposite-spin integrals.
ElemCo.FciDumps.integ2_os — Method
integ2_os(fd::FDump)Return αβ 2-e⁻ integrals for UHF fcidump
ElemCo.FciDumps.integ2_ss — Function
integ2_ss(fd::FDump, spincase::Symbol=:α)Return 2-e⁻ integrals (for UHF fcidump: for spincase). spincase can be :α or :β.
ElemCo.FciDumps.is_similarity_transformed — Method
is_similarity_transformed(fd::FDump)Return true if the fcidump is similarity transformed
ElemCo.FciDumps.modify_header! — Method
modify_header!(fd::FDump, norb, nelec; ms2=-1, isym=-1, orbsym=[])Modify header of FDump object
ElemCo.FciDumps.read_fcidump — Method
read_fcidump(fcidump::String)Read ascii file (possibly with integrals in npy files) to TFDump object.
ElemCo.FciDumps.read_fcidump — Method
read_fcidump(fcidump::String, ::Val{N})Read ascii file (possibly with integrals in npy files).
ElemCo.FciDumps.reorder_orbs_int2 — Method
reorder_orbs_int2(int2::AbstractArray, orbs)Reorder orbitals in 2-e integrals according to orbs.
orbscan be a subset of orbitals or a permutation of orbitals. Return int2[orbs[p],orbs[q],orbs[r],orbs[s]] or the triangular version.
ElemCo.FciDumps.transform_fcidump! — Method
transform_fcidump!(fd::FDump, Tl::SpinMatrix, Tr::SpinMatrix)Transform integrals to new basis using Tl and Tr transformation matrices. If Tl and Tr are unrestricted, then the function transforms rhf fcidump to uhf fcidump.
ElemCo.FciDumps.write_fcidump — Method
write_fcidump(fd::FDump, fcidump::String; tol=-1.0, format=:ascii)Write fcidump file.
If tol >= 0.0, integrals with absolute value smaller than tol are omitted. If format is :npy, integrals are written to npy files in the same directory, otherwise if format is :ascii, integrals are written to ascii fcidump file.
Internal functions
ElemCo.FciDumps.FDumpHeader — Type
FDumpHeaderHeader of fcidump file
ElemCo.FciDumps.copy2npy — Method
copy2npy(fd::FDump, dir::AbstractString)Copy integrals to npy files in dir.
ElemCo.FciDumps.is_triang — Method
is_triang(fd::FDump)
If true: an uppertriangular index for last two indices of 2e⁻ integrals is used.
ElemCo.FciDumps.mmap_integrals — Method
mmap_integrals(fd::FDump, dir::AbstractString, key::AbstractString, ::Array{T,N})Memory-map integral file (from head[key])
ElemCo.FciDumps.print_int_value — Method
print_int_value(fdf, integ, i1, i2, i3, i4)Print integral value to fdf file.
ElemCo.FciDumps.read_header — Method
read_header(fdfile::IOStream)Read header of fcidump file.
ElemCo.FciDumps.read_integrals! — Method
read_integrals!(fd::FDump, dir::AbstractString)Read integrals from npy files.
Returns true if successful.
ElemCo.FciDumps.read_integrals! — Method
read_integrals!(fd::FDump{N}, fdfile::IOStream)Read integrals from fcidump file
Returns true if successful.
ElemCo.FciDumps.set_int2! — Method
set_int2!(int2::Array{Float64,3}, i1, i2, i3, i4, integ, simtra, ab)Set 2-e integral in int2 array to integ considering permutational symmetries.
For not ab: particle symmetry is assumed. Integrals are stored in physicists' notation.
ElemCo.FciDumps.set_int2! — Method
set_int2!(int2::Array{Float64,4}, i1, i2, i3, i4, integ, simtra, ab)Set 2-e integral in int2 array to integ considering permutational symmetries.
For not ab: particle symmetry is assumed. Integrals are stored in physicists' notation.
ElemCo.FciDumps.set_zero! — Function
set_zero!(fd::FDump, norb::Int=0)Set all integrals to zero.
If norb is not provided, the integrals are set to zero with the same dimensions as before.
ElemCo.FciDumps.transform_int1 — Method
transform_int1(int1::AbstractArray, Tl::AbstractArray, Tr::AbstractArray)Transform 1-e integrals to new basis using Tl and Tr transformation matrices.
ElemCo.FciDumps.transform_int2 — Method
transform_int2(int2::Array{Float64,3}, Tl::AbstractArray, Tl2::AbstractArray,
Tr::AbstractArray, Tr2::AbstractArray)Transform 2-e integrals to new basis using Tl/Tl2 and Tr/Tr2 transformation matrices.
$v_{pq}^{rs} = v_{p'q'}^{r's'}$* Tl[p',p] * Tl2[q',q] * Tr[r',r] * Tr2[s',s]
The last two indices are stored as a single uppertriangular index.
ElemCo.FciDumps.transform_int2_Q — Method
transform_int2_Q(int2::Array{Float64,3}, Tl::AbstractArray, Tl2::AbstractArray,
Tr::AbstractArray, Tr2::AbstractArray)Transform 2-e integrals to new basis using Tl/Tl2 and Tr/Tr2 transformation matrices.
$v_{pq}^{rs} = v_{p'q'}^{r's'}$* Tl[p',p] * Tl2[q',q] * Tr[r',r] * Tr2[s',s]
The result is a full 4-index tensor.
ElemCo.FciDumps.write_header — Method
write_header(fd::FDump, fdf; npy=false)Write header of fcidump file.
If npy is true, write NPY file names for integrals.
ElemCo.FciDumps.write_integrals — Method
write_integrals(fd::FDump, fdf, tol)Write integrals to fdf file.
ElemCo.FciDumps.write_integrals1 — Method
write_integrals1(int1, fdf, tol, simtra)Write 1-e integrals to fdf file.
ElemCo.FciDumps.write_integrals2 — Method
write_integrals2(int2::Array{Float64,3}, fdf, tol, simtra)Write 2-e integrals to fdf file.