ffsim.random.random_ucj_op_spin_unbalanced¶
- ffsim.random.random_ucj_op_spin_unbalanced(norb, *, n_reps=1, interaction_pairs=None, with_final_orbital_rotation=False, diag_coulomb_mean=0.0, diag_coulomb_scale=6.283185307179586, diag_coulomb_normal=False, seed=None)[source]¶
Sample a random spin-unbalanced unitary cluster Jastrow (UCJ) operator.
- Parameters:
norb (
int) – The number of orbitals.n_reps (
int) – The number of ansatz repetitions.interaction_pairs (
tuple[list[tuple[int,int]] |None,list[tuple[int,int]] |None,list[tuple[int,int]] |None] |None) – Optional restrictions on allowed orbital interactions for the diagonal Coulomb operators. If specified,interaction_pairsshould be a tuple of 3 lists, for alpha-alpha, alpha-beta, and beta-beta interactions, in that order. Any list can be substituted withNoneto indicate no restrictions on interactions. Each list should contain pairs of integers representing the orbitals that are allowed to interact. These pairs can also be interpreted as indices of diagonal Coulomb matrix entries that are allowed to be nonzero. For the alpha-alpha and beta-beta interactions, each integer pair must be upper triangular, that is, of the form \((i, j)\) where \(i \leq j\).with_final_orbital_rotation (
bool) – Whether to include a final orbital rotation in the operator.diag_coulomb_mean (
float) – Mean of the entries of the diagonal Coulomb matrices. Defaults to0.diag_coulomb_scale (
float) – Scale of the entries of the diagonal Coulomb matrices. Defaults to2 * pi.diag_coulomb_normal (
bool) – Whether to draw the entries of the diagonal Coulomb matrices from a normal distribution, rather than a uniform distribution. If True, then the entries are drawn by callingrng.normal(loc=diag_coulomb_mean, scale=diag_coulomb_scale). If False, then the entries are drawn by callingdiag_coulomb_mean + rng.uniform(-0.5 * diag_coulomb_scale, 0.5 * diag_coulomb_scale).seed – A seed to initialize the pseudorandom number generator. Should be a valid input to
np.random.default_rng.
- Return type:
- Returns:
The sampled UCJ operator.