Skip to content

Order of tags: should TaggedOperation(op, "tag1", "tag2")==TaggedOperation(op, "tag2", "tag1")? #7289

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

Open
babacry opened this issue Apr 19, 2025 · 2 comments
Labels
area/tags triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet

Comments

@babacry
Copy link
Collaborator

babacry commented Apr 19, 2025

Now

TaggedOperation(op, "tag1", "tag2")!=TaggedOperation(op, "tag2", "tag1")
and
TaggedOperation(op, "tag1", "tag2")==TaggedOperation(op, "tag1", "tag2")

wonder why does the order of tags matter? if not, should serialization/deserialization take tag sorting into consideration?

@mhucka mhucka added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Apr 22, 2025
@mhucka
Copy link
Contributor

mhucka commented Apr 30, 2025

Discussed in Cirq Cynq 2025-04-30: trying to recall the reasons for the current design (which is a tuple, not a set), the sense is that it was probably created at a time when people weren't thinking about multiple tags. This is likely not an intentional behavior, but rather a bug.

@mhucka mhucka added triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Apr 30, 2025
@babacry
Copy link
Collaborator Author

babacry commented Apr 30, 2025

Some context: I am writing some tag transformers in #7306, in tests, I need to do some extra steps to compare TaggedOperation, it's not a blocker for me, but looks like it's a bug, so I am asking here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tags triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet
Projects
None yet
Development

No branches or pull requests

2 participants