Promote FrozenCircuit.tags to AbstractCircuit#7476
Promote FrozenCircuit.tags to AbstractCircuit#7476pavoljuhas merged 6 commits intoquantumlib:mainfrom
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:
|
dstrain115
left a comment
There was a problem hiding this comment.
Thanks for fixing my half-written feature!
pavoljuhas
left a comment
There was a problem hiding this comment.
Couple of small fixes needed, please see inline.
Otherwise LGTM, thank you for contributing this!
|
@pavoljuhas addressed all comments, PTAL |
pavoljuhas
left a comment
There was a problem hiding this comment.
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 |
pavoljuhas
left a comment
There was a problem hiding this comment.
LGTM with a two final nits. Thank you for adding this!
Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
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 <pavol.juhas@gmail.com>
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