ffsim.random.random_num_num_ansatz_op_spin_balanced

ffsim.random.random_num_num_ansatz_op_spin_balanced(norb, *, interaction_pairs=None, seed=None)[source]

Sample a random spin-balanced number-number interaction ansatz operator.

The angles of the operator are sampled uniformly from the interval \([-\pi, \pi)\). The angles enter the operator as 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 (tuple[list[tuple[int, int]], list[tuple[int, int]]] | None) – The orbital pairs to apply the number-number interactions to. If specified, interaction_pairs should be a pair of lists, for alpha-alpha and alpha-beta interactions, in that order. Each list should contain pairs of integers representing the orbitals that interact, and each integer pair must be upper triangular, that is, of the form \((i, j)\) where \(i \leq j\). If not specified, all pairs of orbitals interact, including the interaction of an orbital with itself.

  • seed – A seed to initialize the pseudorandom number generator. Should be a valid input to np.random.default_rng.

Return type:

NumNumAnsatzOpSpinBalanced

Returns:

The sampled number-number interaction ansatz operator.