Skip to content

Commit

Permalink
CompatHelper: bump compat for Nemo to 0.40, (keep existing compat) (#228
Browse files Browse the repository at this point in the history
)

* CompatHelper: bump compat for Nemo to 0.40, (keep existing compat)


---------

Co-authored-by: CompatHelper Julia <[email protected]>
Co-authored-by: Stefan Krastanov <[email protected]>
Co-authored-by: Stefan Krastanov <[email protected]>
  • Loading branch information
4 people authored Jan 26, 2024
1 parent 995576f commit 3c796e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ QuantumOpticsBase = "4f57444f-1401-5e15-980d-4471b28d5678"

[extensions]
QuantumCliffordGPUExt = "CUDA"
QuantumCliffordLDPCDecodersExt = "LDPCDecoders"
QuantumCliffordMakieExt = "Makie"
QuantumCliffordPlotsExt = "Plots"
QuantumCliffordPyQDecodersExt = "PyQDecoders"
QuantumCliffordQOpticsExt = "QuantumOpticsBase"
QuantumCliffordQuantikzExt = "Quantikz"
QuantumCliffordLDPCDecodersExt = "LDPCDecoders"
QuantumCliffordPyQDecodersExt = "PyQDecoders"

[compat]
CUDA = "4.4.0"
Expand All @@ -53,7 +53,7 @@ LDPCDecoders = "0.1.1"
LinearAlgebra = "1.9"
MacroTools = "0.5.9"
Makie = "0.20"
Nemo = "0.38"
Nemo = "0.38, 0.39, 0.40"
Plots = "1.38.0"
PrecompileTools = "1.2"
PyQDecoders = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion src/entanglement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function entanglement_entropy(state::AbstractStabilizer, subsystem::AbstractVect
graph = Graphs.Graph(state)
adjmat = Graphs.adjacency_matrix(graph)
other_subsystem = filter(i->!(i in collect(subsystem)), 1:Graphs.nv(graph))
subadjmat = Nemo.matrix(Nemo.residue_ring(Nemo.ZZ, 2), collect(adjmat[subsystem,other_subsystem]))
subadjmat = Nemo.matrix(Nemo.GF(2), collect(adjmat[subsystem,other_subsystem]))
LinearAlgebra.rank(subadjmat)
end

Expand Down
6 changes: 2 additions & 4 deletions src/randoms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,8 @@ function precise_inv(a)::Matrix{UInt8}
end

function nemo_inv(a, n)::Matrix{UInt8}
binaryring = Nemo.residue_ring(Nemo.ZZ, 2) # TODO should I use GF(2) instead of ResidueRing(ZZ, 2)?
M = Nemo.matrix_space(binaryring, n, n)
inverted = inv(M(Matrix{Int}(a))) # Nemo is very picky about input data types
return (x->mod(UInt8(x.data),0x2)).(inverted)
inverted = inv(Nemo.matrix(Nemo.GF(2),a))
return collect(UInt8.(inverted.==1)) # maybe there is a better way to do the conversion
end

"""Sample (h, S) from the distribution P_n(h, S) from Bravyi and Maslov Algorithm 1."""
Expand Down
2 changes: 1 addition & 1 deletion test/test_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ end
)
@show rep
@test_broken length(JET.get_reports(rep)) == 0
@test length(JET.get_reports(rep)) <= 20
@test length(JET.get_reports(rep)) <= 25
end

0 comments on commit 3c796e7

Please sign in to comment.