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

Add new Circuit, Gate, Lane, Moment types #282

Merged
merged 13 commits into from
Jan 14, 2025
Merged

Add new Circuit, Gate, Lane, Moment types #282

merged 13 commits into from
Jan 14, 2025

Conversation

mofeing
Copy link
Member

@mofeing mofeing commented Jan 12, 2025

while thinking about adding new features around connectivty between Quantums, Ansatz and so, i needed to add this functionality to better represent quantum circuits or TEBD decompositions.

@jofrevalles this should fix your problem with getting the gates from a circuit in order. the only thing left to do for you to work is to implement a graph traversing o graph walk algorithm on top of Circuit.

notes

  • Gate is nice. it's a Tensor with Site information, just like Quantum is a TensorNetwork with Site information.
  • Lane and Bond are going to be used for helping Ansatz. i need them for the PEPS.
  • Moment can also be used for stacking Quantums in a new type i'm designing for representing compositions of TNs.

to do

we probably need to change the name of Moment because it means other thing in quantum circuit libraries

@mofeing mofeing requested a review from jofrevalles January 12, 2025 20:39
@mofeing
Copy link
Member Author

mofeing commented Jan 14, 2025

in the end, this PR got bigger than what i wanted but everything in here was needed

there is really no breaking changes, except for...

  • Lattice (and thus Ansatz) now uses Lanes and not Site
    • this fixes issues with canonization on Operators like MPO or dual states
    • also it's better defined
  • tensors(; at), tensors(; bond), tensors(; between) now requires you passing a Lane
    • inds(; at) still accepts Site
  • simple_update! now only accepts Gate, and not a "not very-well defined" Quantum

i want these breaking changes to be before 0.8.0 so expect another PR where i better define Ansatz with mapping between Lane to Tensor and Bond to index.

@jofrevalles i'm merging directly because i'm lil bit on a hurry and need this to implement PEPS. this stuff is still not very documented because i don't want it to be public yet: it will be public after some features that can be added on v0.8.x, but meanwhile you can start using Gate and Circuit for your work

tests pass... it's just the Reactant problem right now

@mofeing mofeing merged commit 26dfa93 into master Jan 14, 2025
1 of 2 checks passed
@mofeing mofeing deleted the feature/circuit branch January 14, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants