-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing errors with generation of uncycle codes #252
base: master
Are you sure you want to change the base?
Conversation
Added multiple methods: code_generation: - Methods for creating Bicycle and Unicycle codes - Methods for assembling CSS codes - Utility methods for working with codes code_evaluation: - Methods for evaluating codes with a belief propagation decoder
Added the following dependencies: CairoMakie LDPCDecoders SparseArrays Statistics
During discussion with Anthony, he mentioned that he would add his code himself later on
- Fixed naming and organization issued identified. - Limited exports - Added additional methods to easily create unicycle and bicycle codes
- Fixed issues with typing in bicycle gen methods - Fixed issue with incorrectly copied methods for unicycle generation - Fixed imports for Nemo methods
Fixed bugs preventing the generation of Bicycle and Unicycle codes
Remove LDPCDecoders import Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Remove LDPCDecoders import Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Updated use case description Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Remove unused import Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Update use case of Bicycle matrix Co-authored-by: Stefan Krastanov <github.acc@krastanov.org>
Updated CSS struct to use Hx and Hz instead of just the full tableau form. Updated CSS methods to work with the new struct form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this Ben! Looks pretty great!
I have a bunch of minor comments -- final polish type of things that are not really related to the implementation, but just to making sure things are documented cleanly and follow other conventions of the code base.
There are also some leftover merge conflicts.
I will convert this to a draft -- convert it back when you would like another round of review.
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove this file. It seems it got caught up during a git add
@@ -7,6 +7,7 @@ version = "0.9.1" | |||
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" | |||
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | |||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | |||
DotEnv = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to have sneaked in during the merge, could you remove it
<<<<<<< HEAD | ||
using QuantumClifford, SparseArrays | ||
using QuantumClifford: AbstractOperation, AbstractStabilizer, Stabilizer | ||
import QuantumClifford: Stabilizer, MixedDestabilizer | ||
using DocStringExtensions | ||
using Combinatorics: combinations | ||
======= | ||
using QuantumClifford | ||
using QuantumClifford: AbstractOperation, AbstractStabilizer, Stabilizer | ||
import QuantumClifford: Stabilizer, MixedDestabilizer, nqubits | ||
using DocStringExtensions | ||
using Combinatorics: combinations | ||
using SparseArrays: sparse | ||
>>>>>>> 11ae38c7342c76a75ad9201b609b352d38117256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this merge conflict seems to have been skipped
# Currently just has Bicycle and Unicycle codes, but open to all types of rudimentary sparse codes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this comment
# Currently just has Bicycle and Unicycle codes, but open to all types of rudimentary sparse codes | ||
|
||
"""Takes a height and width of matrix and generates a bicycle code to the specified height and width. | ||
Based on codes from this paper: https://ieeexplore.ieee.org/document/1337106 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for papers, add then to the bibtex file in the docs folder and use the [](@cite)
notation so they render nicely in the docs
"""Takes a list of indices and creates the base of the unicycle matrix. | ||
|
||
For example: | ||
`Circ2UnicycleH0([1, 2, 4], 7)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated name
For example: | ||
`Circ2UnicycleH0([1, 2, 4], 7)` | ||
|
||
See https://arxiv.org/abs/quant-ph/0304161 for more details""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reference
`Circ2UnicycleH0([1, 2, 4], 7)` | ||
|
||
See https://arxiv.org/abs/quant-ph/0304161 for more details""" | ||
function circ_to_unicycle_h0(circ_indices::Array{Int}, n::Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to specify Array{Int}
, especially if someone wants to work with Tuple
or array view, or many other array-like objects that are not of type Array.
@testset "do rows commute - required for ECCs" begin | ||
@test stab_looks_good(parity_checks(Bicycle(6, 4))) == true | ||
@test stab_looks_good(parity_checks(Bicycle(18, 14))) == true | ||
@test stab_looks_good(parity_checks(Bicycle(200, 120))) == true | ||
@test stab_looks_good(parity_checks(Unicycle(21, [1, 3, 8, 9, 12]))) == true | ||
|
||
function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these can be removed. These are now tested for all codes in test_ecc_codeproperties
<<<<<<< HEAD | ||
codeexpr in [ | ||
:(Cleve8()), | ||
:(Steane7()), | ||
:(Shor9()), | ||
:(Perfect5()), | ||
:(Bitflip3()), | ||
:(Bicycle(6, 4)), | ||
:(Bicycle(10, 6)), | ||
:(Unicycle(21, [1, 3, 8, 9, 12])), | ||
:(S"Y_"), | ||
:(S"Z_"), | ||
:(S"X_"), | ||
fill(:(random_stabilizer(5,7)), 100)... | ||
======= | ||
code in [ | ||
all_testablable_code_instances()..., | ||
S"Y_", | ||
S"Z_", | ||
S"X_", | ||
[random_stabilizer(5,7) for _ in 1:100]... | ||
>>>>>>> 11ae38c7342c76a75ad9201b609b352d38117256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge conflict
A few small changes were made that will improve the .ECC module: