From 79b1432ff82277f5fc7c14ac2635753d6f32f38e Mon Sep 17 00:00:00 2001 From: adminlip Date: Thu, 14 May 2026 14:38:43 +0000 Subject: [PATCH] Add type hints to Hubbard constructors --- src/openfermion/hamiltonians/hubbard.py | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/openfermion/hamiltonians/hubbard.py b/src/openfermion/hamiltonians/hubbard.py index ae7cbbe82..ddd22b05a 100644 --- a/src/openfermion/hamiltonians/hubbard.py +++ b/src/openfermion/hamiltonians/hubbard.py @@ -17,16 +17,16 @@ def fermi_hubbard( - x_dimension, - y_dimension, - tunneling, - coulomb, - chemical_potential=0.0, - magnetic_field=0.0, - periodic=True, - spinless=False, - particle_hole_symmetry=False, -): + x_dimension: int, + y_dimension: int, + tunneling: complex, + coulomb: complex, + chemical_potential: complex = 0.0, + magnetic_field: complex = 0.0, + periodic: bool = True, + spinless: bool = False, + particle_hole_symmetry: bool = False, +) -> FermionOperator: r"""Return symbolic representation of a Fermi-Hubbard Hamiltonian. The idea of this model is that some fermions move around on a grid and the @@ -229,14 +229,14 @@ def _spinless_fermi_hubbard_model( def bose_hubbard( - x_dimension, - y_dimension, - tunneling, - interaction, - chemical_potential=0.0, - dipole=0.0, - periodic=True, -): + x_dimension: int, + y_dimension: int, + tunneling: complex, + interaction: complex, + chemical_potential: complex = 0.0, + dipole: complex = 0.0, + periodic: bool = True, +) -> BosonOperator: r"""Return symbolic representation of a Bose-Hubbard Hamiltonian. In this model, bosons move around on a lattice, and the