ffsim.UCCSDOpUnrestrictedReal

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

Bases: SupportsApplyUnitary, SupportsApproximateEquality

Real unrestricted unitary coupled cluster, singles and doubles operator.

t1

The t1 amplitudes, as a pair of Numpy arrays (t1_a, t1_b) with shapes (nocc_a, nvrt_a) and (nocc_b, nvrt_b).

Type:

tuple[np.ndarray, np.ndarray]

t2

The t2 amplitudes, as a tuple of Numpy arrays (t2_aa, t2_ab, t2_bb) with shapes (nocc_a, nocc_a, nvrt_a, nvrt_a), (nocc_a, nocc_b, nvrt_a, nvrt_b), and (nocc_b, nocc_b, nvrt_b, nvrt_b).

Type:

tuple[np.ndarray, np.ndarray, np.ndarray]

final_orbital_rotation

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

Type:

np.ndarray | None

Parameters:
  • validate (InitVar) – 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) – Relative numerical tolerance for validation checks.

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

Methods

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

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

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

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, nelec, 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.

  • nelec (tuple[int, int]) – The numbers of spin alpha and spin beta fermions.

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

Return type:

UCCSDOpUnrestrictedReal

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, nelec, *, 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.

  • nelec (tuple[int, int]) – The numbers of spin alpha and spin beta fermions.

  • 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.

Attributes

atol

final_orbital_rotation

norb

The number of spatial orbitals.

rtol

validate

t1

t2