Add type hints to Hubbard constructors#1307
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds type hints to the fermi_hubbard and bose_hubbard functions in src/openfermion/hamiltonians/hubbard.py. These hints specify the expected types for dimensions, physical constants like tunneling and interaction terms, and boolean flags, while also defining the return types as FermionOperator and BosonOperator. No review comments were provided for these changes, and I have no further feedback.
|
@adminlip Please identify yourself as a human or a software agent. |
This adds explicit annotations to the public Fermi- and Bose-Hubbard constructor signatures, covering the dimensions, scalar model parameters, boolean options, and concrete operator return types. The change keeps the implementations unchanged while making this Hamiltonian module easier to type-check incrementally as part of the broader type-hinting effort. Verified with
python3 -m compileall -q src/openfermion/hamiltonians/hubbard.py, targeted signature assertions, andgit diff --check.Part of #633