Skip to content

[WIP] Add CliffordString #910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions file_lists/perf_files
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ src/stim/simulators/dem_sampler.perf.cc
src/stim/simulators/error_analyzer.perf.cc
src/stim/simulators/frame_simulator.perf.cc
src/stim/simulators/tableau_simulator.perf.cc
src/stim/stabilizers/clifford_string.perf.cc
src/stim/stabilizers/pauli_string.perf.cc
src/stim/stabilizers/pauli_string_iter.perf.cc
src/stim/stabilizers/tableau.perf.cc
Expand Down
1 change: 1 addition & 0 deletions file_lists/test_files
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ src/stim/simulators/measurements_to_detection_events.test.cc
src/stim/simulators/sparse_rev_frame_tracker.test.cc
src/stim/simulators/tableau_simulator.test.cc
src/stim/simulators/vector_simulator.test.cc
src/stim/stabilizers/clifford_string.test.cc
src/stim/stabilizers/flex_pauli_string.test.cc
src/stim/stabilizers/flow.test.cc
src/stim/stabilizers/pauli_string.test.cc
Expand Down
1 change: 1 addition & 0 deletions src/stim.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#include "stim/simulators/sparse_rev_frame_tracker.h"
#include "stim/simulators/tableau_simulator.h"
#include "stim/simulators/vector_simulator.h"
#include "stim/stabilizers/clifford_string.h"
#include "stim/stabilizers/flex_pauli_string.h"
#include "stim/stabilizers/flow.h"
#include "stim/stabilizers/pauli_string.h"
Expand Down
12 changes: 6 additions & 6 deletions src/stim/gates/gate_data_period_3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f - i * 0.5f, -0.5f - 0.5f * i}, {0.5f - 0.5f * i, 0.5f + 0.5f * i}},
.flow_data = {"Y", "X"},
.flow_data = {"+Y", "+X"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
S 0
S 0
Expand Down Expand Up @@ -102,7 +102,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f + i * 0.5f, -0.5f + 0.5f * i}, {0.5f + 0.5f * i, 0.5f - 0.5f * i}},
.flow_data = {"-Y", "X"},
.flow_data = {"-Y", "+X"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
S 0
H 0
Expand Down Expand Up @@ -130,7 +130,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f - i * 0.5f, 0.5f + 0.5f * i}, {-0.5f + 0.5f * i, 0.5f + 0.5f * i}},
.flow_data = {"Y", "-X"},
.flow_data = {"+Y", "-X"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
S 0
H 0
Expand Down Expand Up @@ -160,7 +160,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f + i * 0.5f, 0.5f + 0.5f * i}, {-0.5f + 0.5f * i, 0.5f - 0.5f * i}},
.flow_data = {"Z", "Y"},
.flow_data = {"+Z", "+Y"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
H 0
S 0
Expand Down Expand Up @@ -188,7 +188,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f - i * 0.5f, -0.5f + 0.5f * i}, {0.5f + 0.5f * i, 0.5f + 0.5f * i}},
.flow_data = {"-Z", "Y"},
.flow_data = {"-Z", "+Y"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
S 0
S 0
Expand Down Expand Up @@ -218,7 +218,7 @@ Parens Arguments:
Qubits to operate on.
)MARKDOWN",
.unitary_data = {{0.5f - i * 0.5f, 0.5f - 0.5f * i}, {-0.5f - 0.5f * i, 0.5f + 0.5f * i}},
.flow_data = {"Z", "-Y"},
.flow_data = {"+Z", "-Y"},
.h_s_cx_m_r_decomposition = R"CIRCUIT(
H 0
S 0
Expand Down
20 changes: 20 additions & 0 deletions src/stim/mem/bitword.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,26 @@ inline bitword<W> operator^(const bitword<W> &self, int64_t mask) {
return self ^ bitword<W>(mask);
}

template <size_t W>
inline bitword<W> andnot(const bitword<W> &inv, const bitword<W> &val) {
return inv.andnot(val);
}
inline uint64_t andnot(uint64_t inv, uint64_t val) {
return ~inv & val;
}
inline uint32_t andnot(uint32_t inv, uint32_t val) {
return ~inv & val;
}
inline uint16_t andnot(uint16_t inv, uint16_t val) {
return ~inv & val;
}
inline uint8_t andnot(uint8_t inv, uint8_t val) {
return ~inv & val;
}
inline bool andnot(bool inv, bool val) {
return !inv && val;
}

} // namespace stim

#endif
Loading
Loading