Skip to content

Commit

Permalink
improve parity check figures
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov committed Apr 13, 2024
1 parent 4078b3d commit 863f211
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 5 deletions.
3 changes: 2 additions & 1 deletion _0.helpers_and_metadata/hodgepodge/hodgepodge_codes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Hodgepodge

using QuantumClifford
using QuantumClifford.ECC
import QuantumClifford.ECC: AbstractECC, parity_checks, parity_checks_x, parity_checks_z
import QuantumClifford.ECC: AbstractECC, parity_checks, parity_checks_x, parity_checks_z, iscss

abstract type HodgepodgeCode <: QuantumClifford.ECC.AbstractECC end

Expand All @@ -28,5 +28,6 @@ _nithincode() = CSS(load_nithin(joinpath((@__DIR__), "nithin/QC_dv4dc8_psto_29_1
parity_checks(::NithinCode) = parity_checks(_nithincode())
parity_checks_x(::NithinCode) = parity_checks_x(_nithincode())
parity_checks_z(::NithinCode) = parity_checks_z(_nithincode())
iscss(::NithinCode) = true

end
40 changes: 36 additions & 4 deletions _2.markdown_generation_pass/figures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module CodeFigures

using Makie, CairoMakie
using Quantikz
using QuantumClifford.ECC: TableDecoder, stabilizerplot_axis, parity_checks
using QuantumClifford: stab_to_gf2
using QuantumClifford.ECC: TableDecoder, stabilizerplot_axis, parity_checks, iscss, parity_checks_z, parity_checks_x

include("../_0.helpers_and_metadata/helpers.jl")
include("../_0.helpers_and_metadata/db_helpers.jl")
Expand Down Expand Up @@ -102,9 +103,40 @@ function prep_figures(code_metadata)
# Plotting code instances
for c in codes
# Plotting stabilizer
f = Figure(size=(400,400))
sf = f[1,1]
stabilizerplot_axis(sf, parity_checks(c))
f = Figure(size=(600,300))
sf = f[1:2,1]
_,ax,p = stabilizerplot_axis(sf, parity_checks(c))
ax.title = "Parity Check Tableau\n(a.k.a. Stabilizer Generators)"
cm = Makie.cgrad([:lightgray,:black], 2, categorical = true)
hz, hx, tz, tx = if iscss(c)
parity_checks_z(c)[end:-1:1,:]', parity_checks_x(c)[end:-1:1,:]', "Z parity checks", "X parity checks"
else
h = stab_to_gf2(parity_checks(c))
h[:,end÷2+1:end][end:-1:1,:]', h[:,1:end÷2][end:-1:1,:]', "Z components", "X components"
end
axz = Axis(f[1,2], title=tz)
hmz = Makie.heatmap!(
axz,
collect(hz);
colorrange = (0, 1),
colormap=cm
)
axx = Axis(f[2,2], title=tx)
hmx = Makie.heatmap!(
axx,
collect(hx);
colorrange = (0, 1),
colormap=cm
)
linkxaxes!(axx, axz)
for ax in (axx, axz)
Makie.hidedecorations!(ax)
Makie.hidespines!(ax)
ax.aspect = Makie.DataAspect()
end
colsize!(f.layout, 1, Relative(0.6))
colsize!(f.layout, 2, Aspect(1, 1))
colgap!(f.layout, 1, Relative(0.15))
save("codes/$(codetypename)/$(instancenameof(c)).png", f)
# Plotting circuits
continue # skip circuit plots
Expand Down
Binary file modified codes/Cleve8/Cleve8().png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Gottesman/Gottesman(3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Gottesman/Gottesman(4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Gottesman/Gottesman(5).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Gottesman/Gottesman(6).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/NithinCode/NithinCode().png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/NithinCode/totalsummary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Perfect5/Perfect5().png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Shor9/Shor9().png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Steane7/Steane7().png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(10, 10).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(12, 12).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(3, 3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(4, 4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(6, 6).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Surface/Surface(8, 8).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(10, 10).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(12, 12).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(3, 3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(4, 4).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(6, 6).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified codes/Toric/Toric(8, 8).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 863f211

Please sign in to comment.