random_quadratic_hamiltonian#
- random_quadratic_hamiltonian(n_orbitals, num_conserving=False, seed=None)[source]#
Generate a random instance of QuadraticHamiltonian.
- Parameters:
n_orbitals (int) – The number of orbitals.
num_conserving (bool) – Whether the Hamiltonian should conserve particle number.
seed (Any | None) – The pseudorandom number generator or seed. Should be a valid input to
numpy.random.default_rng()
.
- Returns:
The sampled QuadraticHamiltonian.
- Return type: