Coupled-cluster tools

ElemCo.CCToolsModule
CCTools

A collection of tools for working with coupled cluster theory.

Exported functions

ElemCo.CCTools.calc_deco_doubles_normFunction
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}$.

ElemCo.CCTools.calc_singles_energy_using_dfockMethod
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 OutDict with keys (E, ESS, EOS, EO).

ElemCo.CCTools.read_starting_guess4amplitudesMethod
read_starting_guess4amplitudes(EC::ECInfo, ::Val{level}, 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.

ElemCo.CCTools.save_current_doublesMethod
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"

ElemCo.CCTools.save_current_singlesMethod
save_current_singles(EC::ECInfo, T1a, T1b; prefix="T")

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

ElemCo.CCTools.spin_project!Method
spin_project!(EC::ECInfo, T1a, T1b, T2a, T2b, T2ab)

Spin-project singles and doubles amplitudes/residuals.

Only possible for high-spin states.

ElemCo.CCTools.spin_project_amplitudesFunction
spin_project_amplitudes(EC::ECInfo, with_singles=true)

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

ElemCo.CCTools.try2save_amps!Method
try2save_amps!(EC::ECInfo, ::Val{excitation_level}, amps...; type="T")

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

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

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

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

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

ElemCo.CCTools.try2start_ampsMethod
try2start_amps(EC::ECInfo, ::Val{excitation_level}; type="T")

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

ElemCo.CCTools.try2start_doublesMethod
try2start_doubles(EC::ECInfo; type="T")

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

ElemCo.CCTools.try2start_singlesMethod
try2start_singles(EC::ECInfo; type="T")

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

ElemCo.CCTools.update_deco_doublesMethod
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).

ElemCo.CCTools.update_deco_triplesFunction
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...

ElemCo.CCTools.update_doubles!Method
update_doubles!(EC::ECInfo, T2a, T2b, T2ab, R2a, R2b, R2ab)

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

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

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

ElemCo.CCTools.update_singlesMethod
update_singles(EC::ECInfo, R1; spincase::Symbol=:α, use_shift=true)

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

ElemCo.CCTools.update_triples!Method
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

ElemCo.CCTools.add_singles2doubles!Method
add_singles2doubles!(T2, T1; make_contravariant=true)

Add singles to doubles amplitudes.

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

ElemCo.CCTools.save_or_start_fileFunction
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.

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

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