Results 121 comments of Dax Fohl

Actually there's a built-in `copy.replace()` now, that works by calling into a user-defined `__replace__` magic method. So that could be an easy fallback. If there's ever a tags feature, then...

Confirmed. This appears to be the same issue as in #6899. The stratify transformer's code naively reverses the circuit by reversing moments, but does not reverse the operations within moments,...

Yeah, the tests should be fixed too in that case. Stratify in general just makes sure that incompatible gate types don't live on the same moment.

Curious if you've considered having Soquets be member attributes on Bloqs instead of passing them in through the builders. For Cirq I spent a bunch of time looking into a...

Confirmed. It looks like the insertion sort transformer skips any measurement key commutativity checks if the qubits are disjoint. https://github.com/quantumlib/cirq/blob/9c376c4e72ec924ee909a6c31147d703e69f1078/cirq-core/cirq/transformers/insertion_sort.py#L57. If I understand the intent correctly it looks like all...

Here's also a simpler repro that only requires two gates and no subcircuits. ```python q0, q1 = cirq.LineQubit.range(2) circuit = cirq.Circuit( cirq.measure(q1, key="c"), cirq.X(q0).with_classical_controls("c") ) print(repr(circuit)) circuit = insertion_sort_transformer(circuit) print(repr(circuit))...

For this, I was thinking there could be "decomposition patterns", which represent the result of a single step of a decomposition. For instance, say you've got a physical `Add256` gate,...

I'd say call the function "reversed" and make it return a copy, and put it on AbstractCircuit instead of just Circuit. . Also probably do the same thing on Moment,...

Yeah, on second thought, don't bother with the extra parameter. If someone wants to just reverse moments then they can use the slice notation, so no need to add explicit...