ffsim.random.random_fermion_hamiltonian

ffsim.random.random_fermion_hamiltonian(norb, n_terms=None, seed=None)[source]

Sample a random fermion Hamiltonian.

A fermion Hamiltonian is hermitian and conserves particle number and spin Z.

Parameters:
  • norb (int) – The number of spatial orbitals.

  • n_terms (int | None) – The number of terms to include in the operator. If not specified, norb is used.

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

Return type:

FermionOperator

Returns:

The sampled fermion Hamiltonian.