Skip to content

Commit

Permalink
fix pybind tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mcewen committed Dec 7, 2023
1 parent 62c0c1a commit 73c3d79
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/stim/simulators/frame_simulator_pybind_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,44 +261,51 @@ def test_apply_pauli_errors():
stim.PauliString("+_ZX"),
stim.PauliString("+ZYZ")
]

# do it again with ints
sim = stim.FlipSimulator(
batch_size=2,
num_qubits=3,
disable_stabilizer_randomization=True,
)
sim.apply_pauli_errors(
pauli=1, # X
pauli=1,
mask=np.asarray([
[False, False],
[True, False],
[False, False],
[True, True]]
),
)
peek = sim.peek_pauli_flips()
assert peek == [
stim.PauliString("+_Z_"),
stim.PauliString("+ZYY")
stim.PauliString("+X_X"),
stim.PauliString("+__X")
]
sim.apply_pauli_errors(
pauli=2, # Y
pauli=3,
mask=np.asarray([
[False, True],
[False, True],
[False, True]]
[True, True],
[True, False],
[False, False]]
),
)
peek = sim.peek_pauli_flips()
assert peek == [
stim.PauliString("+_Z_"),
stim.PauliString("+X__")
stim.PauliString("+YZX"),
stim.PauliString("+Z_X")
]
sim.apply_pauli_errors(
pauli=3, # Z
pauli=2,
mask=np.asarray([
[False, False],
[True, False],
[False, True],
[False, True]]
),
)
peek = sim.peek_pauli_flips()
assert peek == [
stim.PauliString("+___"),
stim.PauliString("+Y__")
stim.PauliString("+_ZX"),
stim.PauliString("+ZYZ")
]


Expand Down

0 comments on commit 73c3d79

Please sign in to comment.