From 8d832a5cef42f2a85f625554900a515bef61ffe8 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Sun, 26 Nov 2023 16:19:21 -0800 Subject: [PATCH] Take strings --- src/stim/circuit/circuit.pybind.cc | 2 +- src/stim/circuit/circuit_pybind_test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stim/circuit/circuit.pybind.cc b/src/stim/circuit/circuit.pybind.cc index e2e7b9e61..47d3d0181 100644 --- a/src/stim/circuit/circuit.pybind.cc +++ b/src/stim/circuit/circuit.pybind.cc @@ -224,7 +224,7 @@ PyPauliString arg_to_pauli_string(const pybind11::object &arg) { return PyPauliString(PauliString(0)); } else if (pybind11::isinstance(arg)) { return pybind11::cast(arg); - } else if (pybind11::isinstance(arg)) { + } else if (pybind11::isinstance(arg)) { return PyPauliString::from_text(pybind11::cast(arg).c_str()); } else { throw std::invalid_argument( diff --git a/src/stim/circuit/circuit_pybind_test.py b/src/stim/circuit/circuit_pybind_test.py index 0b86ed2af..31fe6510f 100644 --- a/src/stim/circuit/circuit_pybind_test.py +++ b/src/stim/circuit/circuit_pybind_test.py @@ -1679,6 +1679,7 @@ def test_has_flow_shorthands(): assert c.has_flow("_Z -> ZZ", measurements=[0, 2]) assert c.has_flow("_Z -> ZZ xor rec[0]", measurements=[2]) + assert c.has_flow(start="X_", end="XX", measurements=[1, 3]) assert not c.has_flow("Z_ -> -Z_") assert not c.has_flow("-Z_ -> Z_") assert not c.has_flow("Z_ -> X_")