Dax Fohl
Dax Fohl
If we want this optimization during simulation, we could invert the above option. Have the `record_measurement_result` function record it in a packed array (which will be only a single code...
Note we've got a very basic implementation already in the test case for custom_simulator: https://github.com/quantumlib/Cirq/blob/master/cirq-core/cirq/contrib/custom_simulators/custom_state_simulator_test.py I recommend starting there, copying it to its own non-test file, and then fleshing out...
Correct, @cduck's implementation has the proper state transition logic. My example shows how to integrate into the custom simulator infrastructure so that you get subcircuit traversal, classical control, etc. for...
Using protocols, like https://github.com/cduck/cirqtools/blob/master/cirqtools/classical_simulator.py#L118-L149.
I see, yeah you could make a new protocol like `apply_to_bitstring(bitstring) -> bitstring` and supplement cduck's method like ```python if cirq.has_application_to_bitstring(op): state = cirq.apply_to_bitstring(op, state, indices) elif cirq.has_unitary(op): self._simulate_unitary(op, state,...
Yes, looks like it was from https://github.com/quantumlib/Cirq/pull/5332. The `with_operations` below is what does it. `Moment.with_operations` creates a new Moment even if the input list is empty. https://github.com/quantumlib/Cirq/blob/65ebb4a4d4a7b8b15e766b486e19582c634c1641/cirq-core/cirq/circuits/circuit.py#L1823 You could either...
@kevinsung Is the idea here that we want to specify ahead of time that you only care about when measurement m1 is 1, so retry until that happens? If that's...
Makes sense. As soon as I posted that I realized there's probably a deterministic operation.
Yes, following it (or, at least the previous diagramming PRs). I've merged and updated the classical control diagram tests in my branch accordingly.
Quick FYI -- balopat is no longer here (much), and I'm not a maintainer. But that aside, I think (1) sounds nice, though I think if a CircuitOperation has only...