-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
218 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "QuantumClifford" | ||
uuid = "0525e862-1e90-11e9-3e4d-1b39d7109de1" | ||
authors = ["Stefan Krastanov <[email protected]>"] | ||
version = "0.8.15" | ||
version = "0.8.16" | ||
|
||
[deps] | ||
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" | ||
|
@@ -47,7 +47,7 @@ Makie = "0.19.7" | |
Nemo = "0.34, 0.35" | ||
Plots = "1.38.0" | ||
PrecompileTools = "1" | ||
Quantikz = "1.3" | ||
Quantikz = "1.3.1" | ||
QuantumInterface = "0.3.0" | ||
QuantumOpticsBase = "0.4" | ||
SIMD = "3.4.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Test | ||
using QuantumClifford | ||
using QuantumClifford: mul_left! | ||
using QuantumClifford.ECC: AbstractECC, Steane7, Shor9, Bitflip3, naive_syndrome_circuit, encoding_circuit, shor_syndrome_circuit, code_n, code_s | ||
|
||
codes = [ | ||
Bitflip3(), | ||
Steane7(), | ||
Shor9(), | ||
] | ||
|
||
## | ||
|
||
function pframe_naive_vs_shor_syndrome(code) | ||
ecirc = encoding_circuit(code) | ||
naive_scirc, naive_ancillaries = naive_syndrome_circuit(code) | ||
shor_cat_scirc, shor_scirc, shor_ancillaries, shor_bits = shor_syndrome_circuit(code) | ||
nframes = 10 | ||
dataqubits = code_n(code) | ||
syndromebits = code_s(code) | ||
naive_qubits = dataqubits + syndromebits | ||
shor_qubits = dataqubits + shor_ancillaries | ||
# no noise | ||
naive_frames = PauliFrame(nframes, naive_qubits, syndromebits) | ||
shor_frames = PauliFrame(nframes, shor_qubits, last(shor_bits)) | ||
naive_circuit = [ecirc..., naive_scirc...] | ||
shor_circuit = [ecirc..., shor_cat_scirc..., shor_scirc...] | ||
pftrajectories(naive_frames, naive_circuit) | ||
pftrajectories(shor_frames, shor_circuit) | ||
@test pfmeasurements(naive_frames) == pfmeasurements(shor_frames)[:,shor_bits] | ||
# with errors | ||
for _ in 1:10 | ||
naive_frames = PauliFrame(nframes, naive_qubits, syndromebits) | ||
shor_frames = PauliFrame(nframes, shor_qubits, last(shor_bits)) | ||
pftrajectories(naive_frames, ecirc) | ||
pftrajectories(shor_frames, [ecirc..., shor_cat_scirc...]) | ||
# manually injecting the same type of noise in the frames -- not really a user accessible API | ||
p = random_pauli(dataqubits, realphase=true) | ||
pn = embed(naive_qubits, 1:dataqubits, p) | ||
ps = embed(shor_qubits, 1:dataqubits, p) | ||
mul_left!(naive_frames.frame, pn) | ||
mul_left!(shor_frames.frame, ps) | ||
# run the syndrome circuits using the public API | ||
pftrajectories(naive_frames, naive_scirc) | ||
pftrajectories(shor_frames, shor_scirc) | ||
@test pfmeasurements(naive_frames) == pfmeasurements(shor_frames)[:,shor_bits] | ||
end | ||
end | ||
|
||
@testset "naive and shor measurement circuits" begin | ||
for c in codes | ||
pframe_naive_vs_shor_syndrome(c) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters