1D Fermi-Hubbard Hamiltonian

This example shows how to build a 1D Fermi-Hubbard Hamiltonian for analog simulation using fermi_hubbard_1d() (backed by an MPO internally). You can also call fermi_hubbard_1d() directly and wrap the result with from_mpo() for custom workflows.

YAQS supports two representations:

  • Fermionic sites (default): one site with local dimension 4 per physical lattice site. Ladder operators act on a composite ↑/↓ basis per site; this is not a Jordan–Wigner qubit chain across sites, but matches the standard tensor-product embedding of site Fock spaces.

  • Jordan-Wigner Pauli chain (jordan_wigner=True): qubits in the order 1↑, 1↓, 2↑, 2↓, … with local dimension 2 and full JW signs between spin orbitals. Use this mode for Pauli-string / qubit simulators.

The Hamiltonian (open boundaries, no chemical potential) is

\[ H = -t \sum_{i,\sigma} \left(c^\dagger_{i,\sigma} c_{i+1,\sigma} + \mathrm{h.c.}\right) + U \sum_i n_{i,\uparrow} n_{i,\downarrow}. \]

Fermionic Hamiltonian

1from mqt.yaqs.core.data_structures.hamiltonian import Hamiltonian
2
3num_sites = 4
4t = 1.0
5u = 0.5
6
7H = Hamiltonian.fermi_hubbard_1d(num_sites, t=t, u=u)
8print(f"sites={H.length}, local dim={H.mpo.physical_dimension}, matrix shape={H.mpo.to_matrix().shape}")
sites=4, local dim=4, matrix shape=(256, 256)

The single-site basis is \(|0\rangle, |\!\downarrow\rangle, |\!\uparrow\rangle, |\!\uparrow\downarrow\rangle\) (NumPy kron ordering for \(|\!\uparrow\rangle \otimes |\!\downarrow\rangle\)).

Jordan-Wigner Hamiltonian

For the same model on \(L\) physical sites, pass length=2 * L spin orbitals:

1num_orbitals = 2 * num_sites
2
3H_jw = Hamiltonian.fermi_hubbard_1d(num_orbitals, t=t, u=u, jordan_wigner=True)
4print(f"orbitals={H_jw.length}, local dim={H_jw.mpo.physical_dimension}, matrix shape={H_jw.mpo.to_matrix().shape}")
orbitals=8, local dim=2, matrix shape=(256, 256)

Relation to the Trotter circuit helper

create_1d_fermi_hubbard_circuit() builds a digital Trotter circuit on separate ↑ and ↓ registers and can include a chemical potential \(\mu\). The MPO factories above target the analog Hamiltonian without \(\mu\) and use either fermionic operators or an interleaved JW layout.

For digital simulation of the circuit model, use the circuit API; for tensor-network evolution of the Hubbard Hamiltonian, use Hamiltonian.fermi_hubbard_1d with run().