Coupled-cluster tools


A collection of tools for working with coupled cluster theory.

Exported functions

calc_deco_doubles_norm(T2, tT2=Float64[])

Calculate squared norm of doubles (for decomposed doubles: without contravariant!) T2 are decomposed doubles amplitudes T2[X,Y]=$T_{XY}$ or full doubles amplitudes T2[a,b,i,j]=$T^{ij}_{ab}$.

If the contravariant amplitude tT2 is provided, the norm will be calculated as $T_{XY} T̃_{XY}$.

calc_singles_energy_using_dfock(EC::ECInfo, T1; fock_only=false)

Calculate coupled-cluster closed-shell singles energy using dressed fock matrix.

if fock_only is true, the energy will be calculated using only non-dressed fock matrix. Returns total energy, SS, OS, and Openshell (0.0) contributions as a NamedTuple (E, ESS, EOS, EO).

read_starting_guess4amplitudes(EC::ECInfo, level::Int, spins...)

Read starting guess for excitation level.

The guess will be read from T_vo, T_VO, T_vvoo etc files. If the file does not exist, the guess will be a zeroed-vector.

save_current_doubles(EC::ECInfo, T2a, T2b, T2ab; prefix="T")

Save current doubles amplitudes T2a, T2b, and T2ab to files prefix*"_vvoo", prefix*"_VVOO", and prefix*"_vVoO"

save_current_singles(EC::ECInfo, T1a, T1b; prefix="T")

Save current singles amplitudes T1a and T1b to files prefix*"_vo" and prefix*"_VO"

spin_project!(EC::ECInfo, T1a, T1b, T2a, T2b, T2ab)

Spin-project singles and doubles amplitudes/residuals.

Only possible for high-spin states.

spin_project_amplitudes(EC::ECInfo, with_singles=true)

Spin-project singles (if withsingles) and doubles amplitudes from files `"Tvo","TVO","Tvvoo","TVVOO"and"TvVoO"`.

starting_amplitudes(EC::ECInfo, method::ECMethod)

Prepare starting amplitudes for coupled cluster calculation.

The starting amplitudes are read from files T_vo, T_VO, T_vvoo, etc. If the files do not exist, the amplitudes are initialized to zero. The order of amplitudes is as follows:

  • singles: α, β
  • doubles: αα, ββ, αβ
  • triples: ααα, βββ, ααβ, αββ

Return a list of vectors of starting amplitudes and a list of ranges for excitation levels.

try2save_amps!(EC::ECInfo, excitation_level, amps...; type="T")

Save amplitudes (type="T") or Lagrange multipliers (type="LM") to file[_lm]*"_excitation_level".

try2save_doubles!(EC::ECInfo, doubles...; type="T")

Save doubles amplitudes (type="T") or Lagrange multipliers (type="LM") to file[_lm]*"_2".

try2save_singles!(EC::ECInfo, singles...; type="T")

Save singles amplitudes (type="T") or Lagrange multipliers (type="LM") to file[_lm]*"_1".

try2start_amps(EC::ECInfo, excitation_level; type="T")

Read amplitudes (type="T") or Lagrange multipliers (type="LM") from file[_lm]*"_excitation_level".

try2start_doubles(EC::ECInfo; type="T")

Read doubles amplitudes (type="T") or Lagrange multipliers (type="LM") from file[_lm]*"_2".

try2start_singles(EC::ECInfo; type="T")

Read singles amplitudes (type="T") or Lagrange multipliers (type="LM") from file[_lm]*"_1".

update_deco_doubles(EC, R2; use_shift=true)

Update decomposed doubles amplitudes.

If R2 is $R^{ij}_{ab}$, the update is calculated using update_doubles(EC, R2, use_shift=use_shift).

update_deco_triples(EC, R3, use_shift=true)

Update decomposed triples amplitudes.

Note that the sign of the residual is opposite to the usual definition of the triples residual and therefore the update is calculated using a positive denominator...

update_doubles!(EC::ECInfo, T2a, T2b, T2ab, R2a, R2b, R2ab)

Update doubles amplitudes in T2a, T2b, T2ab with R2a, R2b, R2ab.

update_doubles(EC::ECInfo, R2; spincase::Symbol=:α, antisymmetrize=false, use_shift=true)

Calculate update for doubles amplitudes for a given spincase∈{,,:αβ}.

update_singles(EC::ECInfo, R1; spincase::Symbol=:α, use_shift=true)

Calculate update for singles amplitudes for a given spincase∈{,}.

update_triples!(EC::ECInfo, T3a, T3b, T3aab, T3abb, R3a, R3b, R3aab, R3abb)

Update triples amplitudes in T3a, T3b, T3aab and T3abb with R3a, R3b, R3aab and R3abb.

Internal functions

add_singles2doubles!(T2, T1; make_contravariant=true)

Add singles to doubles amplitudes.

If make_contravariant is true, the amplitudes will be made contravariant.

save_or_start_file(EC::ECInfo, type, excitation_level, save=true)

Return filename and description for saving or starting amplitudes/lagrange multipliers.

type is either "T" for amplitudes or "LM" for Lagrange multipliers. excitation_level is the excitation level of the amplitudes (1, 2 etc.) If save is true, the filename for saving is returned, otherwise the filename for starting.

update_triples(EC::ECInfo, R3; spincase::Symbol=:α, antisymmetrize=false, use_shift=true)

Calculate update for triples amplitudes for a given spincase∈{,,:ααβ,:αββ}.