Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "qLDPC"
version = "0.2.7"
version = "0.2.8"
description = "Tools for constructing and analyzing quantum low density parity check (qLDPC) codes."
readme = "README.md"
license = "Apache-2.0"
Expand Down
9 changes: 6 additions & 3 deletions src/qldpc/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,12 @@ def _split_by_pivots(self, *, allow_non_units: bool = True) -> tuple[RingArray,
for col in np.argwhere(pivot_cols):
row = np.argwhere(self_as_bool[:, col])[0][0]
pivot_rows[row] = allow_non_units or self[row, col][0].inverse()
pivot_matrix = self[pivot_rows].view(RingArray)
non_pivot_matrix = self[~pivot_rows].view(RingArray)
return pivot_matrix, non_pivot_matrix[np.any(non_pivot_matrix, axis=1)]
pivot_matrix = self[pivot_rows]
non_pivot_matrix = self[~pivot_rows]
return (
pivot_matrix.view(RingArray),
non_pivot_matrix[np.any(non_pivot_matrix, axis=1)].view(RingArray),
)

def _remove_linearly_dependent_rows(self) -> RingArray:
"""Remove rows that can be expressed as ring-linear combinations of others.
Expand Down
6 changes: 3 additions & 3 deletions src/qldpc/codes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def get_logical_error_rate(error_rate: float) -> tuple[float, float]:
" max_error_rate."
)
probs = _get_error_probs_by_weight(len(self), error_rate, max_error_weight)
return 1 - probs @ fidelities, np.sqrt(probs**2 @ variances)
return 1 - float(probs @ fidelities), float(np.sqrt(probs**2 @ variances))

return get_logical_error_rate

Expand Down Expand Up @@ -1946,7 +1946,7 @@ def get_logical_error_rate(error_rate: float) -> tuple[float, float]:
" max_error_rate."
)
probs = _get_error_probs_by_weight(len(self), error_rate, max_error_weight)
return 1 - probs @ fidelities, np.sqrt(probs**2 @ variances)
return 1 - float(probs @ fidelities), float(np.sqrt(probs**2 @ variances))

return get_logical_error_rate

Expand Down Expand Up @@ -3033,7 +3033,7 @@ def get_logical_error_rate(error_rate: float) -> tuple[float, float]:
" max_error_rate."
)
probs = _get_error_probs_by_weight(len(self), error_rate, max_error_weight)
return 1 - probs @ fidelities, np.sqrt(probs**2 @ variances)
return 1 - float(probs @ fidelities), float(np.sqrt(probs**2 @ variances))

return get_logical_error_rate

Expand Down