We're celebrating World Quantum Day 2022! Join us

openfermion.testing.random_interaction_operator_term

Generates a random interaction operator with non-zero coefficients only

on terms corresponding to the given number of unique orbitals.

The number of orbitals is equal to the given order.

order How many unique orbitals the non-zero terms should correspond to.
real Whether or not the coefficients should be real. Defaults to True.
seed The seed. If None (default), uses np.random.