ffsim.UCCSDOpUnrestrictedReal¶
- class ffsim.UCCSDOpUnrestrictedReal(t1, t2, final_orbital_rotation=None, validate=True, rtol=1e-05, atol=1e-08)[source]¶
Bases:
SupportsApplyUnitary,SupportsApproximateEqualityReal-valued unrestricted unitary coupled cluster, singles and doubles operator.
UCCSD operator with real-valued t-amplitudes. Note that the final orbital rotation, if included, is allowed to be complex-valued.
The operator is \(\exp(T - T^\dagger)\) followed by the optional final orbital rotation, where
\[T = \sum_{ia} t^{(\alpha)}_{ia} a^\dagger_{a\alpha} a_{i\alpha} + \sum_{IA} t^{(\beta)}_{IA} a^\dagger_{A\beta} a_{I\beta} + \frac14 \sum_{ijab} t^{(\alpha\alpha)}_{ijab} a^\dagger_{a\alpha} a^\dagger_{b\alpha} a_{j\alpha} a_{i\alpha} + \sum_{iJaB} t^{(\alpha\beta)}_{iJaB} a^\dagger_{a\alpha} a^\dagger_{B\beta} a_{J\beta} a_{i\alpha} + \frac14 \sum_{IJAB} t^{(\beta\beta)}_{IJAB} a^\dagger_{A\beta} a^\dagger_{B\beta} a_{J\beta} a_{I\beta}.\]Here \(i, j\) index occupied spin-up orbitals, \(a, b\) index virtual spin-up orbitals, \(I, J\) index occupied spin-down orbitals, and \(A, B\) index virtual spin-down orbitals. The same-spin t2 amplitudes
t2_aaandt2_bbmust be antisymmetric in the occupied indices and in the virtual indices.- 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
The optional final orbital rotation, as a Numpy array of shape
(2, norb, norb).The number of spatial orbitals.
The t1 amplitudes, as a pair of Numpy arrays
(t1_a, t1_b)with shapes(nocc_a, nvrt_a)and(nocc_b, nvrt_b).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).- final_orbital_rotation: ndarray | None = None¶
The optional final orbital rotation, as a Numpy array of shape
(2, norb, norb).
- norb¶
The number of spatial orbitals.
- t1: tuple[ndarray, ndarray]¶
The t1 amplitudes, as a pair of Numpy arrays
(t1_a, t1_b)with shapes(nocc_a, nvrt_a)and(nocc_b, nvrt_b).
- t2: tuple[ndarray, ndarray, ndarray]¶
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). The same-spin amplitudest2_aaandt2_bbmust be antisymmetric in the occupied indices and in the virtual indices.
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.
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:
- Return type:
- 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.