ffsim.random.random_givens_ansatz_op¶
- ffsim.random.random_givens_ansatz_op(norb, *, interaction_pairs=None, with_phis=True, with_phase_angles=True, seed=None)[source]¶
Sample a random Givens rotation ansatz operator.
The angles of the operator are sampled uniformly from the interval \([-\pi, \pi)\). The angles enter the operator as rotation angles and phases, so this window of width \(2 \pi\) samples them uniformly over their full period.
- Parameters:
norb (
int) – The number of spatial orbitals.interaction_pairs (
list[tuple[int,int]] |None) – The orbital pairs to apply the Givens rotations to. If not specified, a brickwork pattern ofnorblayers is used, which is enough to express an arbitrary orbital rotation.with_phis (
bool) – Whether to include complex phases for the Givens rotations.with_phase_angles (
bool) – Whether to include a layer of single-orbital phase gates.seed – A seed to initialize the pseudorandom number generator. Should be a valid input to
np.random.default_rng.
- Return type:
- Returns:
The sampled Givens rotation ansatz operator.