ffsim.random.random_double_factorized_hamiltonian¶
- ffsim.random.random_double_factorized_hamiltonian(norb, *, rank=None, z_representation=False, real=False, seed=None)[source]¶
Sample a random double-factorized Hamiltonian.
The two-body part of the Hamiltonian is a sum of
rankterms, each built from an independent random orbital rotation and an independent random diagonal Coulomb matrix sampled from the Gaussian orthogonal ensemble (seerandom_real_symmetric_matrix()). The diagonal Coulomb matrices are divided by the square root of the rank so that the scale of the two-body part does not depend on the rank: the terms are independent and have mean zero, so their sum fluctuates on the scale of the square root of the number of terms.- Parameters:
norb (
int) – The number of spatial orbitals.rank (
int|None) – The desired number of terms in the two-body part of the Hamiltonian. If not specified, it will be set tonorb * (norb + 1) // 2.z_representation (
bool) – Whether to return a Hamiltonian in the “Z” representation.real (
bool) – Whether to sample a real-valued object rather than a complex-valued one.seed – A seed to initialize the pseudorandom number generator. Should be a valid input to
np.random.default_rng.
- Return type:
- Returns:
The sampled double-factorized Hamiltonian.