Skip to content

Commit

Permalink
Merge branch 'main' of github.com:quantumlib/Stim into circuitpop
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/stim/circuit/circuit_pybind_test.py
  • Loading branch information
Strilanc committed Sep 21, 2024
2 parents 0bbd469 + 3ee5bf8 commit 1ed2dcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/stim/circuit/circuit_instruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void CircuitInstruction::validate() const {
"Two qubit gate " + std::string(gate.name) +
" requires an even number of targets but was given "
"(" +
comma_sep(args).str() + ").");
comma_sep(targets).str() + ").");
}
for (size_t k = 0; k < targets.size(); k += 2) {
if (targets[k] == targets[k + 1]) {
Expand Down
5 changes: 5 additions & 0 deletions src/stim/circuit/circuit_pybind_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1897,3 +1897,8 @@ def test_pop():
c = stim.Circuit("H 0\n X 1")
assert c.pop() == stim.CircuitInstruction("X", [1])
assert c.pop() == stim.CircuitInstruction("H", [0])


def test_circuit_create_with_odd_cx():
with pytest.raises(ValueError, match="0, 1, 2"):
stim.Circuit("CX 0 1 2")

0 comments on commit 1ed2dcc

Please sign in to comment.