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 Ansatz type-hierarchy to a trait system #184

Closed
mofeing opened this issue Aug 13, 2024 · 0 comments · Fixed by #223 · May be fixed by #204
Closed

Move Ansatz type-hierarchy to a trait system #184

mofeing opened this issue Aug 13, 2024 · 0 comments · Fixed by #223 · May be fixed by #204
Labels
breaking-change question Further information is requested triage Needs group consensus

Comments

@mofeing
Copy link
Member

mofeing commented Aug 13, 2024

⚠️ This is an idea I had that can be implemented in the future. We can experiment with it in other branch and decide on it in the future.

Currently, a Ansatz Tensor Network object cannot change its Ansatz type; you need to create a new object because the Ansatz is a part of its type (and the type of an object cannot be changed in Julia).

The motivation for being able to dynamically change the Ansatz of a Tensor Network is that during execution, operations performed into it can change its representation. Some examples are:

  • (Mixed-)Canonization of a MPS/MPO
  • MPS contraction of PEPS
  • ...

In order to allow it, the way to go would be to stop the TensorNetwork type hierarchy in Ansatz, make Ansatz a concrete type and add a mutable field with the ansatz trait on it. The ansatz trait object type would be used for dynamic dispatch and its fields could be used for ansatz information (e.g. the orthogonality center in a mixed-canonized MPS).

@mofeing mofeing added enhancement New feature or request question Further information is requested triage Needs group consensus breaking-change and removed enhancement New feature or request labels Aug 13, 2024
@mofeing mofeing linked a pull request Nov 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change question Further information is requested triage Needs group consensus
Projects
None yet
1 participant