Class CC

Nested Relationships

Nested Types

Class Documentation

class CC

CC is a derivation engine for the coupled-cluster method.

Public Types

enum class Ansatz

Values:

enumerator T

traditional ansatz

enumerator oT

traditional orbital-optimized (singles-free) ansatz

enumerator U

unitary ansatz

enumerator oU

unitary orbital-optimized (singles-free) ansatz

Public Functions

explicit CC(size_t n)

constructs CC engine with default options (traditional ansatz, screening enabled, topological optimization enabled)

Parameters:

n – coupled cluster excitation rank

explicit CC(size_t n, const Options &opts)

constructs CC engine with custom options

See also

CC::Options

Parameters:
  • n – coupled cluster excitation rank

  • opts – configuration options

Ansatz ansatz() const
Returns:

the type of ansatz

bool unitary() const
Returns:

true if the ansatz is unitary

std::optional<size_t> hbar_comm_rank() const
Returns:

the maximum of nested commutators in H̄; returns std::nullopt if not set

bool skip_singles() const
Returns:

true if singles amplitudes are excluded from \( \hat{T} \) and \( \hat{\Lambda} \)

bool screen() const
Returns:

whether screening is on or not

bool use_topology() const
Returns:

whether topological optimization is used in WickTheorem

ExprPtr hbar(std::optional<size_t> truncation_rank = std::nullopt) const

computes similarity transformed Hamiltonian, \( \bar{H} = e^{-\hat{\sigma}} \hat{H} e^{\hat{\sigma}} \). The form of \( \sigma \) depends on the Ansatz choice.

Parameters:

truncation_rank – maximum order of nested commutators to include in the expansion; if not specified, will use the value of member hbar_comm_rank. If that is also not specified, will use 4 as the default value. If provided, will override all defaults.

ExprPtr energy(std::optional<size_t> comm_rank = std::nullopt) const

derives the CC energy expression \( \langle 0|\bar{H}|0 \rangle \) at the requested commutator truncation, WITHOUT deriving the projected amplitude equations (avoids deriving the full t() manifold just to read t().at(0)).

Parameters:

comm_rank – optional H̄ commutator-truncation override, forwarded to hbar (defaults to the engine’s hbar_comm_rank, else 4).

Returns:

the energy expression \( \langle 0|\bar{H}|0 \rangle \)

std::vector<ExprPtr> t(size_t pmax = std::numeric_limits<size_t>::max(), size_t pmin = 0) const

derives t amplitude equations, \( \langle P|\bar{H}|0 \rangle = 0 \)

Parameters:
  • pmax – highest particle rank of the projector manifold \f \langle P | \f; the default value is to use the cluster operator rank of this engine

  • pmin – lowest particle rank of the projector manifold \f \langle P | \f; the default value is 0

Returns:

vector of t amplitude equations, with element k containing equation \( \langle k |\bar{H}|0 \rangle = 0 \) for k in the [pmin,pmax] range, and null value otherwise

std::vector< ExprPtr > λ () const

derives λ amplitude equations, \( \langle 0| (1 + \hat{\Lambda}) \frac{d \bar{H}}{d \hat{T}_P} |0 \rangle = 0 \)

Returns:

vector of λ amplitude equations, with element k containing equation \( \langle 0| (1 + \hat{\Lambda}) \frac{d \bar{H}}{d \hat{T}_k} |0 \rangle = 0 \) for k in the [1,N] range; element 0 contains the λ pseudoenergy, computed as the CC energy with \( \hat{T} \) replaced by \( \hat{\Lambda}^{\dagger} \)

std::vector< ExprPtr > (size_t rank=1, size_t order=1, std::optional< size_t > nbatch=std::nullopt) const

derives perturbed t amplitude equations

Parameters:
  • rank – rank of perturbation operator. r = 1 means one-body perturbation operator

  • order – order of perturbation

  • nbatch – optional batching index rank for perturbation operators

Pre:

rank==1 && order==1, only first order perturbation and one-body perturbation operator is supported now

Returns:

std::vector of perturbed t amplitude equations

std::vector< ExprPtr > λʼ (size_t rank=1, size_t order=1, std::optional< size_t > nbatch=std::nullopt) const

derives perturbed λ amplitude equations

Parameters:
  • rank – rank of perturbation operator. r = 1 means one-body perturbation operator

  • order – order of perturbation

  • nbatch – optional batching index rank for perturbation operators

Pre:

rank==1 && order==1, only first order perturbation and one-body perturbation operator is supported now

Returns:

std::vector of perturbed λ amplitude equations

std::vector< ExprPtr > eom_r (nₚ np, nₕ nh) const

derives right-side sigma equations for EOM-CC

Parameters:
  • np – number of particle creators in R operator

  • nh – number of hole creators in R operator

Returns:

vector of right side sigma equations, element 0 is always null

std::vector< ExprPtr > eom_l (nₚ np, nₕ nh) const

derives left-side sigma equations for EOM-CC

Parameters:
  • np – number of particle annihilators in L operator

  • nh – number of hole annihilators in L operator

Returns:

vector of left side sigma equations, element 0 is always null

struct Options

Configuration options for CC class.

Public Members

Ansatz ansatz = Ansatz::T

type of CC ansatz. see CC::Ansatz

std::optional<bool> skip_singles = std::nullopt

if true, singles amplitudes are excluded from \( \hat{T} \) and \( \hat{\Lambda} \); if not specified, defaults to true for orbital-optimized ansätze (oT, oU) and false otherwise. Must be true for orbital-optimized ansätze.

bool screen = true

if true, uses Operator level screening before applying WickTheorem. This propagates to all ref_av() calls

bool use_topology = true

if true, uses topological optimizations in WickTheorem

std::optional<size_t> hbar_comm_rank = std::nullopt

maximum order of nested commutators in H̄; must be specified if unitary ansatz is used

std::optional<size_t> pertbar_comm_rank = std::nullopt

maximum order of nested commutators in the similarity transformed perturbation operator; must be specified if unitary ansatz is used in perturbed amplitude derivation