Skip to content
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
4 changes: 2 additions & 2 deletions docs/how_tos/1-how-to-create-codes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -290,7 +290,7 @@
"# Load the minifold to be tiled\n",
"from qiskit_qec.geometry.plane import Plane\n",
"\n",
"# Load the lattive class to tile against\n",
"# Load the lattice class to tile against\n",
"from qiskit_qec.geometry.lattice import Lattice\n",
"\n",
"# Create a code factory\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/QEC_Framework_IEEE_2022.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@
"![image13.png](attachment:0e37e976-1396-41e9-9f73-d1be2788bc48.png)\n",
"\n",
"\n",
"TileFactories use a simplified approach where by the region on the surface is tiled using a choosen tile relative to a lattice on that region. For example the second tiling above used the four square tile bedlow with the regulat lattive $\\mathbb{Z}^2$:"
"TileFactories use a simplified approach where by the region on the surface is tiled using a choosen tile relative to a lattice on that region. For example the second tiling above used the four square tile bedlow with the regulat lattice $\\mathbb{Z}^2$:"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/qiskit_qec/analysis/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _minimum_distance_2_python(stabilizer: np.ndarray, gauge: np.ndarray, max_we
stabilizer is a symplectic matrix generating the stabilizer group.
gauge is a symplectic matrix generating the gauge group, if any.

Second method based on parititioning errors.
Second method based on partitioning errors.

Restrictions: n < 63 to avoid overflows in numpy

Expand Down Expand Up @@ -194,7 +194,7 @@ def _minimum_distance_2_compiled(stabilizer: np.ndarray, gauge: np.ndarray, max_
stabilizer is a symplectic matrix generating the stabilizer group.
gauge is a symplectic matrix generating the gauge group, if any.

Second method based on parititioning errors, using compiled implementation.
Second method based on partitioning errors, using compiled implementation.

Returns the minimum distance of the code, or 0 if greater than max_weight.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/analysis/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

logger = logging.getLogger(__name__)

# Load extensions if available and set appriate indicator flags
# Load extensions if available and set appropriate indicator flags

try:
from qiskit_qec.analysis._c_analysis import _CErrorPropagator # pylint: disable=unused-import
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/analysis/faultenumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
else:
self.model = model
if method not in self.AVAILABLE_METHODS:
raise QiskitQECError("fmethod {method} is not supported.")
raise QiskitQECError(f"method {method} is not supported.")
self.method = method
self.location_types = self.model.get_operations()
self.pauli_error_types = self.model.get_pauli_error_types()
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/analysis/faultsampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
"""
self.model = model
if method not in self.AVAILABLE_METHODS:
raise QiskitQECError("fmethod {methid} is not supported.")
raise QiskitQECError(f"method {method} is not supported.")
self.method = method

self.location_types = self.model.get_operations()
Expand Down
6 changes: 3 additions & 3 deletions src/qiskit_qec/circuits/css_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def __init__(
'n' (number of qubits),
T: Number of syndrome measurement rounds
basis: basis for encoding ('x' or 'z')
round_schedule: Order in which to measureme gauge operators ('zx' or 'xz')
round_schedule: Order in which to measurement gauge operators ('zx' or 'xz')
noise_model: Pauli noise model used in the construction of noisy circuits.
If a tuple, a pnenomological noise model is used with the entries being
probabity of depolarizing noise on code qubits between rounds and
If a tuple, a phenomenological noise model is used with the entries being
probability of depolarizing noise on code qubits between rounds and
probability of measurement errors, respectively.

Examples:
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/circuits/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

logger = logging.getLogger(__name__)

# Load extensions if available and set appriate indicator flags
# Load extensions if available and set appropriate indicator flags

try:
from qiskit_qec.analysis._c_circuits import _c_check_nodes
Expand Down
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 @@ -27,7 +27,7 @@ std::vector<int> check_nodes(
std::vector<int> output;

// we convert to flat nodes, which are a std::tuple with (q0, q1, boundary/logical)
// here boundary/logical is 0 if the node is neither boundary or logical, 1 for logical, 2 for bounary and 3 for both
// here boundary/logical is 0 if the node is neither boundary or logical, 1 for logical, 2 for boundary and 3 for both
// if we have an even number of corresponding nodes, they cancel
std::map<std::tuple<int, int, int>, int> node_counts;
for (auto & node : nodes) {
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/codes/codebase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _search(
continue
return codes
else:
raise QiskitError("Only mempory method currently implemented")
raise QiskitError("Only memory method currently implemented")

def in_range(self, n, k, index) -> bool:
"""_summary_
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/codes/codebuilders/heavyhex_code_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
dx = d
dz = d
elif dx is None or dz is None:
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be speicifed.")
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be specified.")
elif not bool(dx % 2) or dx < 3 or not bool(dz % 2) or dz < 3:
raise QiskitError(f"dx:{dx} and dz:{dz} must be odd positive integers ≥ 3")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
dx = d
dz = d
elif dx is None or dz is None:
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be speicifed.")
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be specified.")
elif not bool(dx % 2) or dx < 3 or not bool(dz % 2) or dz < 3:
raise QiskitError(f"dx:{dx} and dz:{dz} must be odd positive integers ≥ 3")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
d: distance of code
dx (optional): X distance of code. Default is d.
dz (optional): Z distance of code. Default is d.
ul_op (optional): operator type for upper left corder weight
ul_op (optional): operator type for upper left corner weight
four stabilizer operator.

Examples:
Expand All @@ -61,7 +61,7 @@ def __init__(
dx = d
dz = d
elif dx is None or dz is None:
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be speicifed.")
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be specified.")
elif not bool(dx % 2) or dx < 3 or not bool(dz % 2) or dz < 3:
raise QiskitError(f"dx:{dx} and dz:{dz} must be odd positive integers ≥ 3")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
dx = d
dz = d
elif dx is None or dz is None:
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be speicifed.")
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be specified.")
elif not bool(dx % 2) or dx < 3 or not bool(dz % 2) or dz < 3:
raise QiskitError(f"dx:{dx} and dz:{dz} must be odd positive integers ≥ 3")

Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/codes/codebuilders/surface_code_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
dx = d
dz = d
elif dx is None or dz is None:
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be speicifed.")
raise QiskitError(f"Both dx:{dx} and dz:{dz} must be specified.")
elif not bool(dx % 2) or dx < 3 or not bool(dz % 2) or dz < 3:
raise QiskitError(f"dx:{dx} and dz:{dz} must be odd positive integers ≥ 3")

Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/codes/codebuilders/yzx2_code_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, d: int) -> None:
# Exclude method used to select the required boundary
# pylint: disable=unused-variable, unused-argument
def exclude(vertex_paths, qubit_data: QubitData) -> bool:
"""exlude method for Shell class to use for building boundary operators"""
"""exclude method for Shell class to use for building boundary operators"""

def _weight_len(path) -> int:
"""Find the weight of the operator from the vertex path listing"""
Expand Down
6 changes: 3 additions & 3 deletions src/qiskit_qec/codes/codefactory/tilecodefactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


class TileCodeFactory:
""" "Tile Code Factory"""
"""Tile Code Factory"""

MANIFOLD_PARAMETERS = ["manifold"]
TILE_PARAMETERS = ["tile", "tile_optype"]
Expand Down Expand Up @@ -341,11 +341,11 @@ def plot(
cutter_color (str, optional): _description_. Defaults to "magenta".

Raises:
QiskitError: No shell, cutter or lattive provided
QiskitError: No shell, cutter or lattice provided

"""
if lattice is None and cutter is None and shell is None:
raise QiskitError("No shell, cutter or lattive provided")
raise QiskitError("No shell, cutter or lattice provided")

if figsize is None:
figsize = (10, 10)
Expand Down
4 changes: 2 additions & 2 deletions src/qiskit_qec/codes/stabsubsystemcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(

Args:
gauge_group (optional): Gauge group defining the subsystem. Defaults to None.
shell (optional): Shell definging the subsystem. Defaults to None.
shell (optional): Shell defining the subsystem. Defaults to None.
qubit_data (optional): Qubit data associated with defining shell. Defaults to None.
qubit_count (optional): Qubit count data associated with defining shell. Defaults to None.

Expand Down Expand Up @@ -103,6 +103,6 @@ def generators(self) -> PauliList:
return self.gauge_group.generators

def draw(self, **kwargs) -> None:
"""Draws the subsytem code if a shell exists"""
"""Draws the subsystem code if a shell exists"""
if self.shell is not None:
self.shell.draw(qubit_data=self.qubit_data, qubit_count=self.qubit_count, **kwargs)
6 changes: 3 additions & 3 deletions src/qiskit_qec/decoders/classic/fibonacci_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# 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.
"""Decoder for Spanning Errors on the the ClassicFibonacciCode"""
"""Decoder for Spanning Errors on the ClassicFibonacciCode"""
import copy
import logging
import math
Expand Down Expand Up @@ -142,7 +142,7 @@ def decode_prob(self, syndrome: np.array):
return res[self.fund_hori_probe_indx], res[self.fund_verti_probe_indx], res

def bit_to_rc(self, bit: int):
"""Maps maps from bit index (0 to (L**2)//2) - 1) to (row, column) indexing
"""Maps from bit index (0 to (L**2)//2) - 1) to (row, column) indexing

In bit notation we think of all the bits of the codeword as being in a line:
So we have bit 0, bit 1, ... all the way until the last bit ((L**2)//2) - 1
Expand Down Expand Up @@ -181,7 +181,7 @@ def bit_to_rc(self, bit: int):
return (rindx, cindx)

def rc_to_bit(self, row: int, col: int):
"""Maps maps from (row, column) index to bit index (0 to (L**2)//2) - 1)
"""Maps from (row, column) index to bit index (0 to (L**2)//2) - 1)

In bit notation we think of all the bits of the codeword as being in a line:
So we have bit 0, bit 1, ... all the way until the last bit ((L**2)//2) - 1
Expand Down
6 changes: 3 additions & 3 deletions src/qiskit_qec/decoders/decoding_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, code, brute=False, graph=None, hyperedges=None):
def update_attributes(self):
"""
Calculates properties of the graph used by `node_index` and `edge_in_graph`.
If `graph` is updated this method should called to update these properties.
If `graph` is updated this method should be called to update these properties.
"""
self._edge_set = set(self.graph.edge_list())
self._node_index = {}
Expand All @@ -82,7 +82,7 @@ def update_attributes(self):

def node_index(self, node):
"""
Given a node of `graph`, returns the corrsponding index.
Given a node of `graph`, returns the corresponding index.

Args:
node (DecodingGraphNode): Node of the graph.
Expand Down Expand Up @@ -188,7 +188,7 @@ def get_error_probs(
shots = sum(counts.values())

if method not in self.AVAILABLE_METHODS:
raise QiskitQECError("fmethod {method} is not supported.")
raise QiskitQECError(f"method {method} is not supported.")

# method for edges
if method == self.METHOD_SPITZ:
Expand Down
4 changes: 2 additions & 2 deletions src/qiskit_qec/decoders/pymatching_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _matching(self) -> Matching:
def logical_flips(self, syndrome: Union[List[DecodingGraphNode], List[int]]) -> List[int]:
"""
Args:
syndrome: Either a list of DecodingGraphNode objects returnes by string2nodes,
syndrome: Either a list of DecodingGraphNode objects returned by string2nodes,
or a list of binaries indicating which node is highlighted, e.g.,
the output of a stim detector sampler
Returns: list of binaries indicating which logical is flipped
Expand Down Expand Up @@ -85,7 +85,7 @@ def matched_edges(
) -> List[DecodingGraphEdge]:
"""
Args:
syndrome: Either a list of DecodingGraphNode objects returnes by string2nodes,
syndrome: Either a list of DecodingGraphNode objects returned by string2nodes,
or a list of binaries indicating which node is highlighted.
Returns: list of DecodingGraphEdge-s included in the matching
"""
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/geometry/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __str__(self) -> str:
if self.points is None:
return f"Lattice(u_vec={np.array2string(self.u_vec, separator=', ')},\
v_vec={np.array2string(self.v_vec, separator=', ')})"
outstr = "Lattive["
outstr = "Lattice["
for point in self.points[:-1]:
outstr += np.array2string(point, separator=", ")
outstr += ", "
Expand Down
8 changes: 4 additions & 4 deletions src/qiskit_qec/geometry/model/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ def exclude(vertex_paths: List[List[Vertex]], qubit_data: QubitData) -> bool:
pass

Will return a True value if the given operator (given by the vertex_paths)
is to be excluded. Deflault always returns False. That is exlude nothing
is to be excluded. Default always returns False. That is exclude nothing
extra.
boundary_strategy (str, optional): _description_. Defaults to "combine".
debug (optional) : With debug set to True a range of intermediate details are printed. Used
for debuging the addition of features to the method.
for debugging the addition of features to the method.

Returns:
Tuple[Shell, QubitData, QubitCount]: _description_
Expand Down Expand Up @@ -157,7 +157,7 @@ def _find_restricted_path(s_vertex: Vertex) -> List[Vertex]:
vertex_path.append(n_vertex)

if n_vertex == v_start:
# Path is a cycle returing to start
# Path is a cycle returning to start
return vertex_path

edges_of_n_vertex = n_vertex.parents
Expand All @@ -173,7 +173,7 @@ def _find_restricted_path(s_vertex: Vertex) -> List[Vertex]:

if r_vertex == n_vertex:
if is_inside[r_vertex]:
# self loop at end of path (should not really happend but just in case)
# self loop at end of path (should not really happened but just in case)
vertex_path.append(r_vertex)
return vertex_path

Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/geometry/model/wireframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, edges: List[Edge]) -> None:
"""Inits WireFrame

A wireframe should have only a single connected component (but are not
linited to having a single component)
limited to having a single component)

Args:
edges (List[Edge]): Edges that comprise the WireFrame
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/geometry/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):
@staticmethod
def ison(point):
"""Check that point is on the plane"""
# Qick check that point is on the
# Quick check that point is on the
return point.shape == (2,) and len(point) == 2

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/info/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Properties:
# that is used by the web server database as well as this class. Here
# for now to get things moving. Also these fields are likely to change
# as the final taxonomy is developed. Therefore code should not rely
# on the exact naming etc used below. So for example a used should
# on the exact naming etc used below. So for example a user should
# not use CodeLibrarian.IS_CSS but instead use the string "is_css".

# Boolean Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def generate_spanning_error(
generate_spanning_error will use as a base for it's error
offset (int, optional): Offset for where spanning error begins. Offset will be a
horizontal offset from the left if is_vertical=False and, otherwise,
a vertical offsetfrom the top if is_vertical=True). Defaults to 0.
a vertical offset from the top if is_vertical=True). Defaults to 0.
probability_of_error (float, optional): Error probability. Defaults to 1e-7.
width (int, optional): How wide the error should be. If is_vertical=True, width
willbe how wide the spanning error is across from left to right. Otherwrise, if
will be how wide the spanning error is across from left to right. Otherwise, if
is_vertical=False width will be the height of the spanning error from top to bottom.
Defaults to None.
is_vertical (bool, optional): If true, the error will span top to bottom. Otherwise,
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/structures/gauge_computations.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Guage computations."""
"""Gauge computations."""
2 changes: 1 addition & 1 deletion src/qiskit_qec/utils/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

""" Utililities for Qiskit DAGs"""
""" Utilities for Qiskit DAGs"""

from qiskit.dagcircuit.dagnode import DAGNode

Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/utils/decoding_graph_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DecodingGraphNode:
Attributes:
- is_boundary (bool): whether or not the node is a boundary node.
- is_logical (bool): whether or not the node is a logical node.
- time (int): what syndrome node the node corrsponds to. Doesn't
- time (int): what syndrome node the node corresponds to. Doesn't
need to be set if it's a boundary node.
- qubits (List[int]): List of indices which are stabilized by
this ancilla.
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/utils/decodoku.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, p=0.1, k=2, d=10, process=None, errors=None, nonabelian=False
d (int): Code distance.
process (Callable): Function cluster and decode syndrome.
errors (list): List of tuples of the form `(x0, y0, x1, y1)`, specifying the
coordinates of the plaquttes either side of the error.
coordinates of the plaquettes either side of the error.
nonabelian (bool): Whether to present as non-Abelian anyons.
"""
self.p = p
Expand Down
Loading