Order of tags: should TaggedOperation(op, "tag1", "tag2")==TaggedOperation(op, "tag2", "tag1")?
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?
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.
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.
Drive-by comment, but I believe we have internal code where the order of tags matters.
Discussed with @andbe91 offline, the order of tags is necessary for now, e.g., in the use case of "converting circuits with DetAnnotation into stim", though it's worth discussing the possibility of "setify" tags in the future.
Label the issue for triaging, and consider closing the issue in the triage.
@babacry (I apologize for my ignorance) Can you elaborate about what "setify" tags are?
Due to backwards incompatible and current code relies on the order of tags, we will not do this.