Skip to content

Commit

Permalink
Bump stim git tag to latest version of stim
Browse files Browse the repository at this point in the history
- Add prefixes for enums that become class enums
- Fix a few struct-vs-class disagreements
  • Loading branch information
Strilanc committed Dec 14, 2023
1 parent 19410c1 commit c229262
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FetchContent_MakeAvailable(googletest)

FetchContent_Declare(stim
GIT_REPOSITORY https://github.com/quantumlib/stim.git
GIT_TAG c135a6129963031b5c05f974e9c5e8def83f8316)
GIT_TAG 3e38d12d0a0fb3022646b694137b733a4700d300)
FetchContent_MakeAvailable(stim)
if (NOT (MSVC))
target_compile_options(libstim PRIVATE -fno-strict-aliasing -fPIC ${ARCH_OPT})
Expand Down
4 changes: 3 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "stim",
commit = "c135a6129963031b5c05f974e9c5e8def83f8316",
commit = "3e38d12d0a0fb3022646b694137b733a4700d300",
remote = "https://github.com/quantumlib/stim.git",
)

Expand Down Expand Up @@ -37,7 +37,9 @@ http_archive(
)

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

load("@pybind11_bazel//:python_configure.bzl", "python_configure")

python_configure(name = "local_config_python")
8 changes: 4 additions & 4 deletions src/pymatching/sparse_blossom/driver/mwpm_decoding.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DecodingTestCase load_test_case(
fclose(dem_file);

auto reader = stim::MeasureRecordReader<stim::MAX_BITWORD_WIDTH>::make(
shots_in, stim::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());
shots_in, stim::SampleFormat::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());

std::ifstream is(find_test_data_file(weights_fn).c_str());
std::istream_iterator<int> start(is), end;
Expand Down Expand Up @@ -441,7 +441,7 @@ TEST(MwpmDecoding, NegativeEdgeWeightFromStim) {
size_t num_distinct_weights = 1000;
auto mwpm = pm::detector_error_model_to_mwpm(dem, num_distinct_weights);
auto reader = stim::MeasureRecordReader<stim::MAX_BITWORD_WIDTH>::make(
shots_in, stim::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());
shots_in, stim::SampleFormat::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());

stim::SparseShot sparse_shot;
size_t num_mistakes = 0;
Expand Down Expand Up @@ -474,7 +474,7 @@ TEST(MwpmDecoding, NegativeEdgeWeightFromStimDecodeToEdges) {
size_t num_distinct_weights = 1000;
auto mwpm = pm::detector_error_model_to_mwpm(dem, num_distinct_weights, true);
auto reader = stim::MeasureRecordReader<stim::MAX_BITWORD_WIDTH>::make(
shots_in, stim::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());
shots_in, stim::SampleFormat::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());

stim::SparseShot sparse_shot;
size_t num_mistakes = 0;
Expand Down Expand Up @@ -520,7 +520,7 @@ TEST(MwpmDecoding, InvalidSyndromeForToricCode) {
size_t num_distinct_weights = 1000;
auto mwpm = pm::detector_error_model_to_mwpm(dem, num_distinct_weights);
auto reader = stim::MeasureRecordReader<stim::MAX_BITWORD_WIDTH>::make(
shots_in, stim::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());
shots_in, stim::SampleFormat::SAMPLE_FORMAT_B8, 0, dem.count_detectors(), dem.count_observables());

stim::SparseShot sparse_shot;
size_t num_shots = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/pymatching/sparse_blossom/flooder/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace pm {

class GraphFillRegion;
struct GraphFillRegion;

/// A collection of detector nodes. It's expected that all detector nodes in the graph
/// will only refer to other detector nodes within the same graph.
Expand Down
2 changes: 1 addition & 1 deletion src/pymatching/sparse_blossom/flooder/match.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace pm {

class GraphFillRegion;
struct GraphFillRegion;

/// A Match is a partnered graph fill region.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace pm {

struct DetectorNode;
class DetectorNode;

/// A compressed edge is a summary of a path between two detection events.
/// Specifically, it tracks which observables the path has crossed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace pm {

struct DetectorNode;
class DetectorNode;
struct GraphFillRegion;

struct RegionHitRegionEventData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace pm {

class GraphFillRegion;
struct GraphFillRegion;

struct RegionEdge {
GraphFillRegion* region;
Expand Down
2 changes: 1 addition & 1 deletion src/pymatching/sparse_blossom/matcher/alternating_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace pm {

class AltTreeNode;
class GraphFillRegion;
struct GraphFillRegion;

struct AltTreeEdge {
AltTreeNode* alt_tree_node;
Expand Down
2 changes: 1 addition & 1 deletion src/pymatching/sparse_blossom/matcher/mwpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace pm {

struct AltTreeNode;
class AltTreeNode;

struct MatchingResult {
pm::obs_int obs_mask;
Expand Down
4 changes: 2 additions & 2 deletions src/pymatching/sparse_blossom/tracker/flood_check_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

namespace pm {

struct DetectorNode;
class DetectorNode;
struct GraphFillRegion;
struct SearchDetectorNode;
class SearchDetectorNode;

enum FloodCheckEventType : uint8_t {
/// A placeholder value indicating there was no event.
Expand Down

0 comments on commit c229262

Please sign in to comment.