FCIDump files

ElemCo.FciDumpsModule

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.FDumpType
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 energy

  • head::ElemCo.FciDumps.FDumpHeader: header of fcidump file, a dictionary of arrays.

  • uhf::Bool: ⟨false⟩ a convinience variable, has to coincide with head["IUHF"][1] > 0.

Exported functions

ElemCo.FciDumps.headvarMethod
headvar(fd::FDump, key::String)

Check header for key, return value if a list, or the element or nothing if not there.

ElemCo.FciDumps.headvarMethod
headvar(head::FDumpHeader, key::String)

Check header for key, return value if a list, or the element or nothing if not there.

ElemCo.FciDumps.headvarMethod
headvar(fd::FDump, key::String, ::Type{T}) where {T}

Check header for key, return the first element or nothing if not there.

ElemCo.FciDumps.headvarMethod
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.headvarsMethod
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.headvarsMethod
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_filenameFunction
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_filenameFunction
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.integ1Function
integ1(fd::FDump, spincase::Symbol=:α)

Return 1-e⁻ integrals (for UHF fcidump: for spincase). spincase can be or .

ElemCo.FciDumps.integ2Function
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_ssFunction
integ2_ss(fd::FDump, spincase::Symbol=:α)

Return 2-e⁻ integrals (for UHF fcidump: for spincase). spincase can be or .

ElemCo.FciDumps.read_fcidumpMethod
read_fcidump(fcidump::String)

Read ascii file (possibly with integrals in npy files) to TFDump object.

ElemCo.FciDumps.reorder_orbs_int2Method
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_fcidumpMethod
transform_fcidump(fd::FDump, Tl::AbstractArray, Tr::AbstractArray)

Transform integrals to new basis using Tl and Tr transformation matrices. For UHF fcidump, Tl and Tr are arrays of matrices for α and β spin. If Tl and Tr are arrays of arrays, then the function transforms rhf fcidump to uhf fcidump.

Internal functions

ElemCo.FciDumps.is_triangMethod

is_triang(fd::FDump)

If true: an uppertriangular index for last two indices of 2e⁻ integrals is used.

ElemCo.FciDumps.mmap_integralsMethod
mmap_integrals(fd::FDump, dir::AbstractString, key::AbstractString, ::Array{T,N})

Memory-map integral file (from head[key])

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_int1Method
transform_int1(int1::AbstractArray, Tl::AbstractArray,  Tr::AbstractArray)

Transform 1-e integrals to new basis using Tl and Tr transformation matrices.

ElemCo.FciDumps.transform_int2Method
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_QMethod
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.