Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to a interface system #314

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mofeing
Copy link
Member

@mofeing mofeing commented Feb 4, 2025

The main change is to stop relying on the AbstractTensorNetwork, AbstractQuantum and AbstractAnsatz abstract inheritance system and move to a duck typing system.

Since duck typing cannot be enforced, the way Julia deals with this is by formalizing the interface on the documentation (which you can find in https://bsc-quantic.github.io/Tenet.jl/previews/PR314/manual/interfaces) and testing the interface (which was added on #312).

changes

  • Quantum gets renamed to Pluggable and is abstracted to just an interface (no implementation)
  • the particular functionalities of Ansatz (i.e. mapping between Lane and Tensor) are abstracted to a Ansatz interface (no implementation)
  • the current implementation of Ansatz (which fulfills both the new Pluggable and Ansatz interfaces) get renamed to Quantum

questions

  • are contract and contract! required methods for the interface?

@mofeing mofeing requested a review from jofrevalles February 4, 2025 12:07
@mofeing mofeing force-pushed the refactor/forget-inheritance-move-to-traits branch from 449b006 to ea84402 Compare February 4, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant