1
$\begingroup$

I know that Stim has the option to play a conditioned pulse based on a previous measurment by writing CZ rec[-1] 1 which does a Z gate on qb1 if the last measurment is 1. Now I am wondering whether you could do feedback based on two previous measurments, say if the last two readouts gave 1, play a conditioned pulse on qb1. I tried something like CZ rec[-1]*rec[-2] 1, but this isn't supported unfortunately. Does anyone have an idea if this is possible in Stim? Any help is much appreachiated!

$\endgroup$

1 Answer 1

1
$\begingroup$

You can use stim.TableauSimulator to implement this kind of feedback:

import stim
sim = stim.TableauSimulator()
sim.h(0)
sim.h(1)
a = sim.measure(0)
b = sim.measure(1)
if a and b:
    sim.x(2)

A stim.Circuit has no way to specify double-controlled Paulis. The underlying reason is because double-controlled Paulis prevent bulk sampling based on diffing a reference sample against a Pauli error frame (what stim.FlipSimulator does).

The issue is that a double-controlled Pauli allows errors to escape the simple world of parity flips. A bit flip error propagating into a measurement that's part of a double-controlled Pauli will result in the bit flip error propagating into a bit flip error times a controlled bit flip error. Another double-controlled Pauli can then grow the controlled bit flip error into a doubly-controlled bit flip error. Another double-controlled Pauli can grow the error into a triply-controlled bit flip error. The errors are no longer restricted to being a set of bit flips. They are growing in complexity. They can become equivalent to any classical computation. Tracking all that complexity would be extremely expensive.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.