New answers tagged

3

No, there's no simple built-in way. You have to do it for yourself. This was an intentional design choice, which I will now attempt to justify because I do realize it's inconvenient. Stim has no concept of an error model separate from the concept of a circuit. Errors are nothing more than a certain type of instruction that can appear in a circuit file. You ...


2

You can use stim.TableauSimulator.set_inverse_tableau to change the tableau simulator's state to a random tableau. For example: import stim random_tableau = stim.Tableau.random(10) simulator = stim.TableauSimulator() simulator.set_inverse_tableau(random_tableau**-1) assert simulator.current_inverse_tableau() == random_tableau**-1 Computing the inverse isn'...


3

The simplest thing to do would be to make a pair of collections.Counters, sample the circuit millions of times, and add the result-flipped cases into one counter and result-not-flipped to the other. Then for decoding you would look up the current case to see which one had more counts: flip or don't flip. circuit = ... assert circuit.num_observables == 1 ...


Top 50 recent answers are included