- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
Promote FrozenCircuit.tags to AbstractCircuit #7476
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
Conversation
          Codecov ReportAll modified and coverable lines are covered by tests ✅ 
 Additional details and impacted files@@           Coverage Diff            @@
##             main    #7476    +/-   ##
========================================
  Coverage   98.68%   98.68%            
========================================
  Files        1092     1092            
  Lines       96694    96799   +105     
========================================
+ Hits        95425    95529   +104     
- Misses       1269     1270     +1     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing my half-written feature!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small fixes needed, please see inline.
Otherwise LGTM, thank you for contributing this!
| 
           @pavoljuhas addressed all comments, PTAL  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about more comments, but I realized we are somewhat inconsistent in how are circuit tags propagated in methods that produce new circuits.  For example, factorize copies tags from self to the split circuits, but zip and concat_ragged drop them.  The addition c1 + c1 preserves tags from c1, but 2 * c1 does not.
I suppose the simplest consistent behavior would be to propagate  tags from the first, ie, self Circuit in all methods that return one or more new Circuits.
Can you please preserve circuit tags from self also for
__mul____rmul____pow____radd__concat_raggedwith_noisezip
          
 Done, also added tests for this. PTAL  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a two final nits. Thank you for adding this!
Co-authored-by: Pavol Juhas <[email protected]>
First step towards fixing quantumlib#7454. This PR just adds the `tags` attribute to `AbstractCircuit`, along with some of the logic (e.g. `__eq__`, `_json_dict_`, etc). After this we have to add support in the proto serialization itself. Partially implements quantumlib#7454 --------- Co-authored-by: Pavol Juhas <[email protected]>
First step towards fixing #7454. This PR just adds the
tagsattribute toAbstractCircuit, along with some of the logic (e.g.__eq__,_json_dict_, etc). After this we have to add support in the proto serialization itself.Partially implements #7454