Skip to content

Commit

Permalink
fix minimals
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumjim committed Feb 16, 2024
1 parent 8260983 commit dbc0e27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/qiskit_qec/circuits/intern/arctools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ std::vector<int> check_nodes(
// list the colours with the max error one first
// (unless we do min only)
std::vector<int> cs;
cs.push_back(min_color);
if (not minimal){
cs.push_back((min_color+1)%2);
}
cs.push_back(min_color);
// determine which flipped logicals correspond to which colour
std::vector<std::set<int>> color_logicals = {{}, {}};
for (auto & q: z_logicals){
Expand Down
20 changes: 10 additions & 10 deletions test/code_circuits/test_rep_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,23 +250,23 @@ def single_error_test(
minimal,
"Error: Single error creates too many nodes",
)
neutral, flipped_logicals, num = code.check_nodes(nodes)
# check that the nodes are neutral
neutral, flipped_logicals, _ = code.check_nodes(nodes)
self.assertTrue(
neutral and flipped_logicals == [],
"Error: Single error nodes are not neutral for string "
+ string
+ " which yeilds "
+ " which yields "
+ str(code.check_nodes(nodes)),
)
# and caused by at most a single error
self.assertTrue(
num <= 1,
"Error: Nodes seem to be caused by more than one error for "
+ string
+ " which yields "
+ str(code.check_nodes(nodes)),
)
# and that the given flipped logical makes sense
for node in nodes:
if not node.is_logical:
for logical in flipped_logicals:
self.assertTrue(
logical in node.qubits,
"Error: Single error appears to flip logical is not part of nodes.",
)

def test_graph_construction(self):
"""Test single errors for a range of layouts"""
Expand Down

0 comments on commit dbc0e27

Please sign in to comment.