Skip to content

Commit

Permalink
regen docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Nov 20, 2023
1 parent ce8fd23 commit e9a2e62
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
14 changes: 8 additions & 6 deletions doc/python_api_reference_vDev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ def to_qasm(
"""Creates an equivalent OpenQASM implementation of the circuit.
Args:
open_qasm_version: Defaults to 3. The version of OpenQASM to target.
open_qasm_version: The version of OpenQASM to target.
This should be set to 2 or to 3.
Differences between the versions are:
Expand Down Expand Up @@ -2404,25 +2404,27 @@ def to_qasm(
>>> import stim
>>> circuit = stim.Circuit("""
... R 0 1
... X 0
... H 0
... CX 0 1
... M 0 1
... DETECTOR rec[-1] rec[-2]
... """);
>>> qasm = circuit.to_qasm();
>>> qasm = circuit.to_qasm(open_qasm_version=3);
>>> print(qasm.strip().replace('\n\n', '\n'))
OPENQASM 3.0;
include "stdgates.inc";
qubit q[2];
bit m[2];
bit rec[2];
bit dets[1];
reset q[0];
reset q[1];
x q[0];
h q[0];
cx q[0], q[1];
measure q[0] -> m[0];
measure q[1] -> m[1];
dets[0] = rec[1] ^ rec[0] ^ 0;
measure q[0] -> rec[0];
measure q[1] -> rec[1];
dets[0] = rec[1] ^ rec[0] ^ 1;
"""
```

Expand Down
14 changes: 8 additions & 6 deletions doc/stim.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ class Circuit:
"""Creates an equivalent OpenQASM implementation of the circuit.
Args:
open_qasm_version: Defaults to 3. The version of OpenQASM to target.
open_qasm_version: The version of OpenQASM to target.
This should be set to 2 or to 3.
Differences between the versions are:
Expand Down Expand Up @@ -1753,25 +1753,27 @@ class Circuit:
>>> import stim
>>> circuit = stim.Circuit("""
... R 0 1
... X 0
... H 0
... CX 0 1
... M 0 1
... DETECTOR rec[-1] rec[-2]
... """);
>>> qasm = circuit.to_qasm();
>>> qasm = circuit.to_qasm(open_qasm_version=3);
>>> print(qasm.strip().replace('\n\n', '\n'))
OPENQASM 3.0;
include "stdgates.inc";
qubit q[2];
bit m[2];
bit rec[2];
bit dets[1];
reset q[0];
reset q[1];
x q[0];
h q[0];
cx q[0], q[1];
measure q[0] -> m[0];
measure q[1] -> m[1];
dets[0] = rec[1] ^ rec[0] ^ 0;
measure q[0] -> rec[0];
measure q[1] -> rec[1];
dets[0] = rec[1] ^ rec[0] ^ 1;
"""
def to_tableau(
self,
Expand Down
14 changes: 8 additions & 6 deletions glue/python/src/stim/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ class Circuit:
"""Creates an equivalent OpenQASM implementation of the circuit.
Args:
open_qasm_version: Defaults to 3. The version of OpenQASM to target.
open_qasm_version: The version of OpenQASM to target.
This should be set to 2 or to 3.
Differences between the versions are:
Expand Down Expand Up @@ -1753,25 +1753,27 @@ class Circuit:
>>> import stim
>>> circuit = stim.Circuit("""
... R 0 1
... X 0
... H 0
... CX 0 1
... M 0 1
... DETECTOR rec[-1] rec[-2]
... """);
>>> qasm = circuit.to_qasm();
>>> qasm = circuit.to_qasm(open_qasm_version=3);
>>> print(qasm.strip().replace('\n\n', '\n'))
OPENQASM 3.0;
include "stdgates.inc";
qubit q[2];
bit m[2];
bit rec[2];
bit dets[1];
reset q[0];
reset q[1];
x q[0];
h q[0];
cx q[0], q[1];
measure q[0] -> m[0];
measure q[1] -> m[1];
dets[0] = rec[1] ^ rec[0] ^ 0;
measure q[0] -> rec[0];
measure q[1] -> rec[1];
dets[0] = rec[1] ^ rec[0] ^ 1;
"""
def to_tableau(
self,
Expand Down

0 comments on commit e9a2e62

Please sign in to comment.