Skip to content

Inconsistent use of the new Hamiltonians interface #332

@mtsch

Description

@mtsch

When preparing PRs #331, I ran into a major issues with the new Hamiltonian interface. This is the situation:

  • A majority of our tests (including doctests) still use the old interface. If a Hamiltonian is updated to the new interface, a lot of work needs to be done to fix them. The docstrings showing the old interface (see for example most doctests in Interfaces/hamiltonians.jl) must be confusing for new users as well.
  • Some code still uses the old interface. I tried to fix this where I could, but I think there are still cases I missed.
  • Updating a Hamiltonian to the new interface breaks user code that still relies on the old interface making what should be a non-breaking change breaking.

To fix this we should either create fallbacks for the old interface that creates an operator_column in the background or eliminate all traces of the old interface from our code.

The first option is non-breaking and easy to do, but will result in some circular definitions. The second option is a lot of work (since we'd need to update all of our Hamiltonians) and breaking, but will result in less convoluted code and may be less confusing to new users.

@joachimbrand @jamie-tay thoughts?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions