Skip to content
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

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Benzillaist
Copy link
Contributor

A few small changes were made that will improve the .ECC module:

  • Fixed errors with the generation of Unicycle codes:
  • Added a few tests to check the validity of bicycle and unicycle codes
  • Added docstrings to bicycle and unicycle codes that include examples of how to use the codes

Benzillaist and others added 18 commits October 31, 2023 19:40
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
Copy link
Member

@Krastanov Krastanov left a 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.

Comment on lines +1 to +2
{
}
Copy link
Member

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"
Copy link
Member

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

Comment on lines +4 to +17
<<<<<<< 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
Copy link
Member

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

Comment on lines +1 to +2
# Currently just has Bicycle and Unicycle codes, but open to all types of rudimentary sparse codes

Copy link
Member

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
Copy link
Member

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)`
Copy link
Member

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"""
Copy link
Member

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)
Copy link
Member

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.

Comment on lines +78 to +84
@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
Copy link
Member

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

Comment on lines +12 to +33
<<<<<<< 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
Copy link
Member

Choose a reason for hiding this comment

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

merge conflict

@Krastanov Krastanov marked this pull request as draft April 2, 2024 20:02
@Krastanov Krastanov added the ECC Having to do with the ECC submodule label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECC Having to do with the ECC submodule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants