Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/changelog-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
jobs:
# Enforces the update of a changelog file on every pull request
changelog:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: dangoslen/changelog-enforcer@v3

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
9 changes: 5 additions & 4 deletions .github/workflows/ci-julia-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,36 @@
PYTHON: ~
jobs:
test:
name: Julia ${{ matrix.version }} - t=${{ matrix.threads }} - jet=${{ matrix.jet }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - t=${{ matrix.threads }} - tests=${{ matrix.test_args }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x64
version: alpha
threads: 2
jet: 'false'
test_args: general
- os: ubuntu-latest
arch: x64
version: '1'
threads: 2
jet: 'true'
test_args: jet
steps:
- uses: actions/checkout@v7
- uses: julia-actions/install-juliaup@v3
with:
channel: ${{ matrix.version }}~${{ matrix.arch }}
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
test_args: ${{ matrix.test_args }}
env:
JULIA_NUM_THREADS: ${{ matrix.threads }}
JET_TEST: ${{ matrix.jet }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
os: macos-latest
version: '1'
threads: '1'
- arch: x64
os: windows-latest
version: '1'
threads: '1'
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
Expand All @@ -50,6 +46,8 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
# Avoid parallel-GC crashes in the GAP/Oscar-backed Tanner tests.
JULIA_NUM_GC_THREADS: '1'
JULIA_NUM_THREADS: ${{ matrix.threads }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
Expand All @@ -58,6 +56,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
docs:
name: Documentation
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,26 @@ jobs:
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
- name: Disable workspace directives for downgrade run
run: |
julia --color=yes -e '
using TOML
project = TOML.parsefile("Project.toml")
if haskey(project, "workspace")
delete!(project, "workspace")
open("Project.toml", "w") do io
TOML.print(io, project)
end
end
'
- uses: julia-actions/julia-downgrade-compat@v2
with:
skip: Pkg,TOML,InteractiveUtils,Random,LinearAlgebra
skip: Pkg,TOML,InteractiveUtils,Random,LinearAlgebra,SparseArrays
mode: 'forcedeps'
julia_version: ${{ matrix.version }}
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
allow_reresolve: false
force_latest_compatible_version: false
10 changes: 5 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["Feroz Ahmed Mian <fmian@umass.edu>", "Stefan Krastanov <stefan@krast
version = "0.1.0"

[workspace]
projects = ["docs"]
projects = ["docs", "test", "test/projects/jet"]

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -22,12 +22,12 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
DocStringExtensions = "0.9.5"
Graphs = "1.9"
Graphs = "1.12"
LinearAlgebra = "1.10"
Multigraphs = "0.3.0"
Nemo = "0.45.5, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56"
Oscar = "1.1.1"
PrecompileTools = "1.2"
Nemo = "0.52.1, 0.53, 0.54, 0.55, 0.56"
Oscar = "1.5"
PrecompileTools = "1.3"
ProgressMeter = "1.11.0"
QECCore = "0.1.3"
QuantumClifford = "0.11.3"
Expand Down
12 changes: 8 additions & 4 deletions src/quantum_tanner_code_multigraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Returns `(𝒞ˣ, 𝒞ᶻ)` where `𝒞ˣ` is the X-stabilizer matrix and `𝒞
- `rate::Real`: Rate parameter for local codes (C_A has rate ρ, C_B has rate 1-ρ)
- `group`: The group G for the left-right Cayley complex
- `A`: Symmetric generating set A for the left Cayley graph
- `B`: Symmetric generating set B for the right Cayley graph
- `B`: Symmetric generating set B for the right Cayley graph
- `bipartite::Bool`: Whether to use bipartite vertex partitioning (V₀, V₁)
"""
struct GeneralizedQuantumTannerCode <: AbstractCSSCode
Expand Down Expand Up @@ -148,14 +148,18 @@ Generate a good Quantum Tanner code meeting minimum weight requirements.

### Arguments
- `ρ`: Rate parameter for local codes
- `group`, `A`, `B`: Expander graph components
- `group`, `A`, `B`: Expander graph components
- `minweight_x`: Minimum weight for X-stabilizers
- `minweight_z`: Minimum weight for Z-stabilizers
- `max_iterations`: Maximum attempts to find a good code
- `rng`: Random number generator used to construct candidate codes
"""
function gen_good_code(ρ::Real, group::Group, A::Vector{<:GroupElem}, B::Vector{<:GroupElem}; minweight_x=1, minweight_z=1, bipartite=true, use_same_local_code=false, max_iterations=100)
function gen_good_code(ρ::Real, group::Group, A::Vector{<:GroupElem}, B::Vector{<:GroupElem};
minweight_x=1, minweight_z=1, bipartite=true,
use_same_local_code=false, max_iterations=100,
rng::AbstractRNG=GLOBAL_RNG)
for i in 1:max_iterations
𝒞ˣ, 𝒞ᶻ = random_quantum_Tanner_code(ρ, group, A, B; bipartite, use_same_local_code)
𝒞ˣ, 𝒞ᶻ = random_quantum_Tanner_code(ρ, group, A, B; bipartite, use_same_local_code, rng)
x_weight = minimum(unique(sum(𝒞ˣ, dims=1)))
z_weight = minimum(unique(sum(𝒞ᶻ, dims=1)))
if x_weight >= minweight_x && z_weight >= minweight_z
Expand Down
13 changes: 10 additions & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
GraphsColoring = "ed38bb8a-6120-4024-8d1e-8789784f251b"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
IGraphs = "647e90d3-2106-487c-adb4-c91fc07b96ea"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
Multigraphs = "7ebac608-6c66-46e6-9856-b5f43e107bac"
NautyGraphs = "7509a0a4-015a-4167-b44b-0799a1a2605e"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QECCore = "b50d4dc9-2544-401f-bae9-a24ba40d0c7a"
QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
QuantumExpanders = "144928dd-1f60-4b66-8c4c-f5ae7409097b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SimpleGraphAlgorithms = "41400c72-0c58-5c16-8579-4ecbce768449"
SimpleGraphConverter = "205b04f2-f585-4877-a239-566270b3f673"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[compat]
# Pin native HiGHS before ERGO-Code/HiGHS#3141; remove after a fixed release.
HiGHS = "=1.19.3"
StableRNGs = "1"
12 changes: 12 additions & 0 deletions test/projects/jet/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[deps]
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Multigraphs = "7ebac608-6c66-46e6-9856-b5f43e107bac"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
QuantumExpanders = "144928dd-1f60-4b66-8c4c-f5ae7409097b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[sources]
QuantumExpanders = {path = "../../.."}
13 changes: 12 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
const JET_PROJECT = normpath(joinpath(@__DIR__, "projects", "jet"))
const test_args = isempty(ARGS) ? ["general"] : ARGS
const JET_flag = length(test_args) == 1 && startswith(only(test_args), "jet")

if JET_flag
@info "Activating the dedicated JET test environment." project=JET_PROJECT
using Pkg
Pkg.activate(JET_PROJECT)
Pkg.instantiate()
end

using TestItemRunner
using QuantumExpanders

# filter for the test
testfilter = ti -> begin
exclude = Symbol[]

if get(ENV, "JET_TEST", "") == "true"
if JET_flag
return :jet in ti.tags
else
push!(exclude, :jet)
Expand Down
3 changes: 2 additions & 1 deletion test/test_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using QuantumExpanders

using Oscar, Multigraphs

rep = report_package("QuantumExpanders";
rep = report_package(QuantumExpanders;
target_modules=(QuantumExpanders,),
ignored_modules=(
AnyFrameModule(Nemo),
AnyFrameModule(Oscar),
Expand Down
8 changes: 5 additions & 3 deletions test/test_ramanujan_graphs_via_frobenius_groups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using QuantumClifford.ECC
using QuantumClifford.ECC: code_n, code_k
using Nemo: zero_matrix, base_ring, transpose, rank
using StableRNGs: StableRNG

function _is_ramanujanᵧ(g::SimpleGraph, k::Int)
A = adjacency_matrix(g)
Expand Down Expand Up @@ -50,7 +51,7 @@
@test is_ram
end
end

# Frobenius groups with r ≥ 4 of https://arxiv.org/pdf/1503.04075, see Theorem 3.3, page 6.
@testset "Frobenius Groups r ≥ 4" begin
large_primes = [11, 13, 17, 19]
Expand All @@ -70,15 +71,16 @@
end

@testset "Quantum Tanner codes from Frobenius Groups" begin
rng = StableRNG(1234)
primes = [3, 5]
for p in primes
for rate in [0.5, 0.6, 0.7]
G = dihedral_group(2*p)
S = normal_cayley_subset(G)
hx, hz = random_quantum_Tanner_code(rate, G, S, S, bipartite=false)
hx, hz = random_quantum_Tanner_code(rate, G, S, S; bipartite=false, rng)
c = Stabilizer(CSS(hx, hz))
@test stab_looks_good(c, remove_redundant_rows=true)
hx, hz = gen_good_code(rate, G, S, S, use_same_local_code=true, bipartite=false)
hx, hz = gen_good_code(rate, G, S, S; use_same_local_code=true, bipartite=false, rng)
c = Stabilizer(CSS(hx, hz))
@test stab_looks_good(c, remove_redundant_rows=true)
end
Expand Down
Loading