-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add logical node property * remove unused and untested functions * rename boundary nodes as logical nodes (if associated with a logical) * fix issues * linting * add graph conversion * rename old file * Create pymatching_decoder.py (#415) Creates a matching object which can be used to decode a counts string via the method process. * linting * remove old matching code and tests * remove old matching code and tests * remove old imports * fix fault id issue * standardize stim code circuit * get rid of measured_logicals * remove measuremed_logicals * remove css decoding graph * remove css decoding graph * add graph conversions * make matching work for non-stim * add matching tests * convert to edge graph only when needed * black * update doc string * correct logical nodes * 2 qubit paulis for cx gates * extend beyond cx * allow default check nodes to be used * rename pymatching decoder * add cpp check_nodes * lint * fix building * correct path * add is_cluster_neutral * fix issues * fix is_cluster_neutral * remove legacy methods * add detail to error messages * fix extra logicals * fix minimals * add detail to message" " * thing * initialize frustration * initialize frustration * initialize frustration * limit loop * limit loop * limit loop * limit loop * limit loop * fun stuff * Revert "limit loop" This reverts commit 8036e3c. * revert to 8036e3c * undo reformatting * add heavy-hex decoder test * add heavy-hex decoder test * add heavy-hex decoder test * add heavy-hex decoder test * add heavy-hex decoder test * linting --------- Co-authored-by: Bence Hetényi <[email protected]>
- Loading branch information
1 parent
9bfe64d
commit fb8d9fa
Showing
38 changed files
with
1,207 additions
and
3,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
add_subdirectory(analysis) | ||
add_subdirectory(analysis) | ||
add_subdirectory(circuits) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Code circuit library | ||
cmake_minimum_required(VERSION 3.12) | ||
project(Circuits) | ||
|
||
set(CIRCUITS_SRC | ||
intern/arctools.cpp | ||
|
||
arctools.h | ||
) | ||
|
||
add_library(libcircuits | ||
STATIC | ||
${CIRCUITS_SRC} | ||
) | ||
|
||
target_include_directories(libcircuits | ||
PUBLIC | ||
"${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
if (NOT (MSVC)) | ||
target_compile_options(libcircuits PRIVATE -fno-strict-aliasing -fPIC ${ARCH_OPT}) | ||
else () | ||
target_compile_options(libcircuits PRIVATE -fPIC ${ARCH_OPT}) | ||
endif () | ||
|
||
# Set prefix to "" since lib is already in project name | ||
set_target_properties(libcircuits PROPERTIES PREFIX "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef __ArcTools__ | ||
#define __ArcTools__ | ||
|
||
#include<vector> | ||
#include<tuple> | ||
#include<map> | ||
#include <set> | ||
|
||
std::vector<int> check_nodes( | ||
std::vector<std::tuple<int, int, int, bool>> nodes, bool ignore_extra_logicals, bool minimal, | ||
std::map<std::tuple<int, int>, std::set<int>> cycle_dict, | ||
std::vector<std::tuple<int, int>> link_graph, | ||
std::map<int, std::vector<int>> link_neighbors, | ||
std::vector<int> z_logicals | ||
); | ||
|
||
bool is_cluster_neutral( | ||
std::vector<std::tuple<int, int, int, bool>> nodes, bool ignore_extra_logicals, bool minimal, | ||
std::map<std::tuple<int, int>, std::set<int>> cycle_dict, | ||
std::vector<std::tuple<int, int>> link_graph, | ||
std::map<int, std::vector<int>> link_neighbors, | ||
std::vector<int> z_logicals, | ||
bool linear | ||
); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "arctools.h" | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
namespace py = pybind11; | ||
|
||
PYBIND11_MODULE(_c_circuits, module) | ||
{ | ||
module.doc() = "qiskit-qec code circuit extensions"; | ||
module.def("_c_check_nodes", &check_nodes, "check_nodes in C++"); | ||
module.def("_c_is_cluster_neutral", &is_cluster_neutral, "is_cluster_neutral in C++"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This code is part of Qiskit. | ||
# | ||
# (C) Copyright IBM 2021. | ||
# | ||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE.txt file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
# pylint: disable=unused-import | ||
|
||
"""Code circuit extensions""" | ||
|
||
import logging # for logging! | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
# Load extensions if available and set appriate indicator flags | ||
|
||
try: | ||
from qiskit_qec.analysis._c_circuits import _c_check_nodes | ||
|
||
C_CHECK_NODES = True | ||
except ImportError as import_error: | ||
logger.exception( # pylint: disable=logging-fstring-interpolation | ||
f"from qiskit_qec.analysis._c_circuits import _c_check_nodes \ | ||
failed, raising {import_error}" | ||
) | ||
C_CHECK_NODES = False | ||
|
||
try: | ||
from qiskit_qec.analysis._c_circuits import _c_is_cluster_neutral | ||
|
||
C_IS_CLUSTER_NEUTRAL = True | ||
except ImportError as import_error: | ||
logger.exception( # pylint: disable=logging-fstring-interpolation | ||
f"from qiskit_qec.analysis._c_circuits import _c_is_cluster_neutral \ | ||
failed, raising {import_error}" | ||
) | ||
C_IS_CLUSTER_NEUTRAL = False |
Oops, something went wrong.