ffsim.UCJOpSpinBalanced

class ffsim.UCJOpSpinBalanced(diag_coulomb_mats, orbital_rotations, final_orbital_rotation=None, validate=True, rtol=1e-05, atol=1e-08)[source]

Bases: SupportsApplyUnitary, SupportsApproximateEquality

A spin-balanced unitary cluster Jastrow operator.

A unitary cluster Jastrow (UCJ) operator has the form

\[\prod_{k = 1}^L \mathcal{U}_k e^{i \mathcal{J}_k} \mathcal{U}_k^\dagger\]

where each \(\mathcal{U_k}\) is an orbital rotation and each \(\mathcal{J}\) is a diagonal Coulomb operator of the form

\[\begin{split}\mathcal{J} = \frac12\sum_{\substack{ij \\ \sigma \tau}} \mathbf{J}^{(\sigma \tau)}_{ij} n_{i\sigma} n_{j\tau}.\end{split}\]

For the spin-balanced operator, we require that \(\mathbf{J}^{(\alpha \alpha)} = \mathbf{J}^{(\beta \beta)}\) and \(\mathbf{J}^{(\alpha \beta)} = \mathbf{J}^{(\beta \alpha)}\). Therefore, each diagonal Coulomb operator is described by 2 matrices, \(\mathbf{J}^{(\alpha \alpha)}\) and \(\mathbf{J}^{(\alpha \beta)}\), and both of these matrices are symmetric. Furthermore, each orbital rotation is described by a single matrix because the same orbital rotation is applied to both spin alpha and spin beta. The number of terms \(L\) is referred to as the number of ansatz repetitions and is accessible via the n_reps attribute.

To support variational optimization of the orbital basis, an optional final orbital rotation can be included in the operator, to be performed at the end.

diag_coulomb_mats

The diagonal Coulomb matrices, as a Numpy array of shape (n_reps, 2, norb, norb) The last two axes index the rows and columns of the matrices, and the third from last axis, which has 2 dimensions, indexes the spin interaction type of the matrix: alpha-alpha, and then alpha-beta. The first axis indexes the ansatz repetitions.

Type:

np.ndarray

orbital_rotations

The orbital rotations, as a Numpy array of shape (n_reps, norb, norb).

Type:

np.ndarray

final_orbital_rotation

The optional final orbital rotation, as a Numpy array of shape (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_cisd_vec(cisd_vec, *, norb, nocc[, ...])

Initialize the UCJ operator from a CISD vector.

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

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

from_t_amplitudes(t2, *[, t1, n_reps, ...])

Initialize the UCJ operator from t2 (and optionally t1) amplitudes.

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

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

to_parameters(*[, interaction_pairs])

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

Attributes

atol

final_orbital_rotation

n_reps

The number of ansatz repetitions.

norb

The number of spatial orbitals.

rtol

validate

diag_coulomb_mats

orbital_rotations