ffsim.UCJAnglesOpSpinBalanced¶
- class ffsim.UCJAnglesOpSpinBalanced(norb, num_num_ansatz_ops, givens_ansatz_ops, final_givens_ansatz_op=None)[source]¶
Bases:
SupportsApplyUnitary,SupportsApproximateEqualityA spin-balanced UCJ operator parameterized by gate rotation angles.
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.
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:
- 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:
- static from_ucj_op(ucj_op)[source]¶
Initialize the angles-based UCJ operator from a matrix-based UCJ operator.
- Return type:
- 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:
Attributes
final_givens_ansatz_opn_repsThe number of ansatz repetitions.
norbnum_num_ansatz_opsgivens_ansatz_ops