ffsim.UCCSDOpSpinless

class ffsim.UCCSDOpSpinless(t1, t2, final_orbital_rotation=None, validate=True, rtol=1e-05, atol=1e-08)[source]

Bases: SupportsApplyUnitary, SupportsApproximateEquality

Spinless unitary coupled cluster, singles and doubles operator.

UCCSD operator with complex-valued t-amplitudes.

The operator is \(\exp(T - T^\dagger)\) followed by the optional final orbital rotation, where

\[T = \sum_{ia} t_{ia} a^\dagger_a a_i + \frac14 \sum_{ijab} t_{ijab} a^\dagger_a a^\dagger_b a_j a_i.\]

Here \(i, j\) index occupied orbitals and \(a, b\) index virtual orbitals. The t2 amplitudes must be antisymmetric in \((i, j)\) and in \((a, b)\).

Parameters:
  • validate (InitVar[bool]) – Whether to validate the operator attributes. Setting this to False skips validation, which is useful if you need to create many instances of this class and are confident that the attributes are valid.

  • rtol (InitVar[float]) – Relative numerical tolerance for validation checks.

  • atol (InitVar[float]) – Absolute numerical tolerance for validation checks.

Attributes

atol

final_orbital_rotation

The optional final orbital rotation, as a Numpy array of shape (norb, norb).

norb

The number of spatial orbitals.

rtol

validate

t1

The t1 amplitudes, as a Numpy array of shape (nocc, nvrt).

t2

The t2 amplitudes, as a Numpy array of shape (nocc, nocc, nvrt, nvrt).

atol: InitVar[float] = 1e-08
final_orbital_rotation: ndarray | None = None

The optional final orbital rotation, as a Numpy array of shape (norb, norb).

norb

The number of spatial orbitals.

rtol: InitVar[float] = 1e-05
validate: InitVar[bool] = True
t1: ndarray

The t1 amplitudes, as a Numpy array of shape (nocc, nvrt).

t2: ndarray

The t2 amplitudes, as a Numpy array of shape (nocc, nocc, nvrt, nvrt). They must be antisymmetric in the occupied indices and in the virtual indices.

Methods

from_parameters(params, *, norb, nocc[, ...])

Initialize the UCCSD operator from a real-valued parameter vector.

n_params(norb, nocc, *[, ...])

Return the number of parameters of an ansatz with given settings.

to_parameters()

Convert the UCCSD operator to a real-valued parameter vector.

static from_parameters(params, *, norb, nocc, with_final_orbital_rotation=False)[source]

Initialize the UCCSD operator from a real-valued parameter vector.

Parameters:
  • params (ndarray) – The real-valued parameter vector.

  • norb (int) – The number of spatial orbitals.

  • nocc (int) – The number of occupied orbitals.

  • with_final_orbital_rotation (bool) – Whether to include a final orbital rotation in the operator.

Return type:

UCCSDOpSpinless

Returns:

The UCCSD operator constructed from the given parameters.

Raises:

ValueError – The number of parameters passed did not match the number expected based on the function inputs.

static n_params(norb, nocc, *, with_final_orbital_rotation=False)[source]

Return the number of parameters of an ansatz with given settings.

Parameters:
  • norb (int) – The number of spatial orbitals.

  • nocc (int) – The number of occupied orbitals.

  • with_final_orbital_rotation (bool) – Whether to include a final orbital rotation in the operator.

Return type:

int

Returns:

The number of parameters of the ansatz.

to_parameters()[source]

Convert the UCCSD operator to a real-valued parameter vector.

Return type:

ndarray

Returns:

The real-valued parameter vector.