Skip to content

polish docs, minor compact fixes, and add makefile for automatic setup #56

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Jun 14, 2025

This PR addresses several minor improvements to documentation and testing:

  • Fixes existing documentation, test, doctest errors. Adds some minor documentation.

Adds a Makefile to:

  • Run tests with make test (without using the REPL).
  • Format source files using JuliaFormatter via make format.
  • Test documentation builds with make docs.

We can skip the build, manifest in the docs folder as well by adding a .gitignore in docs.

make format can help catch syntax errors, such as in this line:

degree(C.G[r, c]) == C.vi[r] && (G_h[r, c] 1;)

I have changed this to degree(C.G[r, c]) == C.vi[r] && (G_h[r, c] = 1)

Changed this

err = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

to

err = zeros(Int, 254)
err[81] = 1

Changed @warn to !!! note in product codes. The @warn was causing issues in doctests by warnings errors during test execution. Replaced with!!! notefor cleaner documentation output.

Error in PlanarSurfaceCode

I ran most of the misc quantum codes, it appears there is bug in planer surface code.

Edit: It occurs due to a metacheck in setlogicals! : _has_equivalent_row_spaces(vcat(S.logs_mat, S.stabs), vcat(L, S.stabs)) || error("The current logicals are not equivalent to the input."). In this case, the second output might be more revealing as it shows indexing error

julia> PlanarSurfaceCode(2,2)
ERROR: The current logicals are not equivalent to the input.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] set_logicals!(::HasLogicals, S::StabilizerCodeCSS, L::Nemo.fpMatrix)
   @ CodingTheory ~/Desktop/New Folder14/ct/2/CodingTheory/src/Quantum/subsystem_code.jl:1405                                                           
 [3] set_logicals!(S::StabilizerCodeCSS, L::Nemo.fpMatrix)


julia> PlanarSurfaceCode(5,3)
ERROR: BoundsError: attempt to access 11x23 fpMatrix at index [12, 18]
Stacktrace:
 [1] throw_boundserror(A::fpMatrix, I::Tuple{Int64, Int64})
   @ Base ./essentials.jl:14
 [2] _checkbounds
   @ ~/.julia/packages/AbstractAlgebra/5aJmh/src/Matrix.jl:69 [inlined]
 [3] setindex!
   @ ~/.julia/packages/Nemo/tYNqm/src/flint/gfp_mat.jl:33 [inlined]
 [4] PlanarSurfaceCode(d_x::Int64, d_z::Int64)

@Fe-r-oz Fe-r-oz changed the title 📝 polish documentation, and add makefile for automatic setup polish docs, minor compact fixes, and add makefile for automatic setup Jun 14, 2025
@Fe-r-oz Fe-r-oz marked this pull request as ready for review June 14, 2025 21:58
@Fe-r-oz
Copy link
Contributor Author

Fe-r-oz commented Jun 14, 2025

Hi @esabo, I hope you're doing well! Please help review this PR, Thank you!!

Summary of changes: I noticed some documentation build errors and test failures on master, so I fixed them. I also verified that most of the miscellaneous quantum code examples are running correctly. As a minor improvement, I’ve added a Makefile to simplify the build, debug and test process. Ran the JuliaFormatter via make format so that's why the changes. Removed build folder and manifest from docs by adding .gitigore. And some other minor changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant