Results 20 issues of Dax Fohl

Previously the DeferredMeasurementTransformer could only work with classical conditions of type KeyCondition (triggered iff the measurement value of that key != zero). This PR enables the transformer to work with...

size: M

**Description of the issue** `Circuit.concat_ragged` allows measurements and classical controls to commute past each other or overlap, resulting in unexpected behavior or invalid circuits. **How to reproduce the issue** ```python...

triage/discuss
kind/bug-report
area/circuits
area/measurements

**Description of the issue** Moment constructor checks for conflicting ops on qubits but not on measurement keys. **How to reproduce the issue** ```python m = cirq.Moment( cirq.measure(cirq.NamedQubit('q1'), key='a'), cirq.measure(cirq.NamedQubit('q2'), key='a'),...

kind/bug-report
triage/accepted
area/circuits
area/measurements
priority/p1-urgent

**Is your feature request related to a use case or problem? Please describe.** The `ignore_measurement_results` argument of `final_density_matrix` is used for calculating the final density matrix without ever collapsing the...

kind/feature-request
triage/accepted
area/simulation
area/density-matrix-simulator
good for learning

**Is your feature request related to a use case or problem? Please describe.** Follow up from https://github.com/quantumlib/Cirq/pull/5917#discussion_r995097628 **Describe the solution you'd like** Similarly to how `unitary_protocol` has `_strat_unitary_from_apply_unitary`, we should...

kind/feature-request
triage/accepted
area/channels
good for learning
priority/p3

Simplify the `SumOfProducts` control value when possible (if there's only a single product in it) when constructing a `ControlledGate`. This allows the `X.controlled() -> CX` optimization when using a `SumOfProducts`...

size: S

As reported in #5916, when repeatedly factoring and kronning a density matrix during simulation, the rounding error caused by partial_trace can propagate and explode after about 15 repetitions. This PR...

size: S

Fixes the deferred measurements transformer in the presence of repeated measurements on the same measurement key by maintaining all those measurements as a list and controlling against the correct qubits...

size: M

`X.controlled` simplifies to `CX` when possible (and Z to CZ). However this does not work when the `control_values` is represented as a `SumOfProducts`, requiring workarounds by any code expecting such...

kind/bug-report
triage/needs-more-evidence
area/gates
needs agreed design

Deferred measurements transformer does not handle some cases currently. This is the umbrella issue for the fixes. * [ ] Sympy expressions: #5824 * [x] Qudits: #5850 * [x] Confusion...

kind/bug-report
triage/accepted
area/transformers
area/measurements