Results 121 comments of Dax Fohl

@ToastCheng yeah that was my thought too. I started looking at it here https://github.com/quantumlib/Cirq/compare/main...daxfohl:fix-pauli-exponent, and really it just came down to implementing `SingleQubitPauliStringGateOperation.__pow__`, and having that and `__mul__` return `SingleQubitPauliStringGateOperation`...

@ToastCheng I went ahead and split this into two issues. I updated this one so it's just about equality of even/odd exponents, and it may end up being a "will...

So as I was saying IRL, I kind of lean toward option 2. Here's the code that allows them to be equal: https://github.com/quantumlib/Cirq/blob/a165e2dc1c79e07d9a585f4638e3350d11580801/cirq-core/cirq/ops/pauli_string.py#L204-L207 The `_value_equality_values_` function returns the PS as...

Another reason not to expand equality in this case, is that the next issue would be "parity gates don't equal PauliStrings"; i.e. `cirq.XX(q1, q2) != cirq.PauliString({q1: 'x', q2: 'x'})`. It...

Okay, I lean toward not making the change in `_from_moments`. I see a lot of places across the codebase that uses `_from_moments` or `unfreeze` to make a quick copy of...

Updated PR to undo the change to `_from_moments` and also `Circuit(*moments)` constructor to be safe. You can click on the diff link to see how it affects tests. Basically just...

Option 1 left-aligns everything, so requires a bunch more calculation and rearranging. There may be some spot improvements possible, but it's been fairly well optimized. Options 2 and 3 just...

Apparently you can make a metaclass for `Bloq` that automatically makes all subclasses frozen attrs dataclasses (well, here only tested for regular dataclasses, but I'm sure attrs works the same...

Actually that might not be a good option since lots of bloqs also inherit from `cirq.Gate`, which has its own metaclass. Another possibility would be to have a `@bloq` decorator...

The main reason I bring it up is that it'd be nice if `attrs.evolve` (the equivalent of `dataclasses.replace`) could be safely assumed to work for all bloqs. Like if you...