ffsim.UCJAnglesOpSpinBalanced

class ffsim.UCJAnglesOpSpinBalanced(norb, num_num_ansatz_ops, givens_ansatz_ops, final_givens_ansatz_op=None)[source]

Bases: SupportsApplyUnitary, SupportsApproximateEquality

A spin-balanced UCJ operator parameterized by gate rotation angles.

Attributes

final_givens_ansatz_op: GivensAnsatzOp | None = None
n_reps

The number of ansatz repetitions.

norb: int
num_num_ansatz_ops: list[NumNumAnsatzOpSpinBalanced]
givens_ansatz_ops: list[GivensAnsatzOp]

Methods

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.

from_ucj_op(ucj_op)

Initialize the angles-based UCJ operator from a matrix-based UCJ operator.

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

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

to_parameters()

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

static from_parameters(params, *, norb, n_reps, num_num_interaction_pairs, givens_interaction_pairs, with_final_givens_ansatz_op=False)[source]

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

Return type:

UCJAnglesOpSpinBalanced

static from_t_amplitudes(t2, *, t1=None, n_reps=None, interaction_pairs=None, tol=1e-08)[source]

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

Return type:

UCJAnglesOpSpinBalanced

static from_ucj_op(ucj_op)[source]

Initialize the angles-based UCJ operator from a matrix-based UCJ operator.

Return type:

UCJAnglesOpSpinBalanced

static n_params(norb, n_reps, num_num_interaction_pairs, givens_interaction_pairs, with_final_givens_ansatz_op=False)[source]

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

Return type:

int

to_parameters()[source]

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

Return type:

ndarray