Skip to content

Commit

Permalink
faults matrix now accounts for rank-deficient ECCs (#196)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Co-authored-by: Stefan Krastanov <stefan@krastanov.org>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 16cd6c0 commit f402e31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

# News

## v0.8.17 - 2023-10-16
## v0.8.18 - 2023-11-22

- `ECC.faults_matrix` detects and warns when encountery codes with redundant checks.

## v0.8.17 - 2023-10-17

- **(fix)** Some `affectedqubits` methods were returning single integers instead of a one-tuple.
- The non-public `ECC` module has seen a few improvements (a `naive_encoding_circuit` implementation and a few new codes), as well as some breaking changes to API.

Expand Down
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ DocStringExtensions = "0.8, 0.9"
Graphs = "1.4.1"
HostCPUFeatures = "0.1.6"
ILog2 = "0.2.3"
InteractiveUtils = "1"
LinearAlgebra = "1"
MacroTools = "0.5.9"
Makie = "0.19.7"
Nemo = "0.34, 0.35, 0.36"
Expand All @@ -50,6 +52,7 @@ PrecompileTools = "1"
Quantikz = "1.3.1"
QuantumInterface = "0.3.0"
QuantumOpticsBase = "0.4"
Random = "1"
SIMD = "3.4.0"
SumTypes = "0.4.4, 0.5"
julia = "1.9"
6 changes: 4 additions & 2 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ We just gather all our syndrome measurement **and logical observables** from the
and then use them with the fault matrix in the syndrome decoding simulation.
"""
function faults_matrix(c::Stabilizer)
md = MixedDestabilizer(c)
s, n = size(c)
k = n-s
r = rank(md)
k = n - r
k == n-s || @warn "`faults_matrix` was called on an ECC that has redundant rows (is rank-deficient). `faults_matrix` corrected for that, however this is a frequent source of mistakes and inefficiencies. We advise you remove redundant rows from your ECC."
O = falses(2k, 2n)
md = MixedDestabilizer(c)
logviews = [logicalxview(md); logicalzview(md)]
errors = [one(Stabilizer,n; basis=:X);one(Stabilizer,n)]
for i in 1:2k
Expand Down

2 comments on commit f402e31

@Krastanov
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95827

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.18 -m "<description of version>" f402e31a065fb99362d586902cf1506f75ef93c9
git push origin v0.8.18

Please sign in to comment.