From 542027ade4a7a2c20ae08821dfc190e7cdf42e22 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Thu, 19 May 2022 02:21:36 -0400 Subject: [PATCH] Fixes related to QuantumCliffor v0.5.0 Signed-off-by: Stefan Krastanov --- Project.toml | 2 +- src/QuantumCliffordPlots.jl | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 0c0a60b..3cfa0f1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "QuantumCliffordPlots" uuid = "4eeed724-23be-436c-a322-a8540588cc9f" authors = ["Stefan Krastanov and contributors"] -version = "0.1.2" +version = "0.1.3" [deps] Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" diff --git a/src/QuantumCliffordPlots.jl b/src/QuantumCliffordPlots.jl index e19f137..a0ea068 100644 --- a/src/QuantumCliffordPlots.jl +++ b/src/QuantumCliffordPlots.jl @@ -108,13 +108,19 @@ function Quantikz.QuantikzOp(op::SparseGate) end end Quantikz.QuantikzOp(op::AbstractOperation) = Quantikz.MultiControlU(affectedqubits(op)) -Quantikz.QuantikzOp(op::BellMeasurement) = Quantikz.ParityMeasurement(["\\mathtt{$(string(o))}" for o in op.pauli], op.indices) +Quantikz.QuantikzOp(op::sCNOT) = Quantikz.CNOT(affectedqubits(op)...) +Quantikz.QuantikzOp(op::sCPHASE) = Quantikz.CPHASE(affectedqubits(op)...) +Quantikz.QuantikzOp(op::sSWAP) = Quantikz.SWAP(affectedqubits(op)...) +Quantikz.QuantikzOp(op::BellMeasurement) = Quantikz.ParityMeasurement(["\\mathtt{$(string(typeof(o))[3])}" for o in op.measurements], affectedqubits(op)) Quantikz.QuantikzOp(op::NoisyBellMeasurement) = Quantikz.QuantikzOp(op.meas) Quantikz.QuantikzOp(op::ConditionalGate) = Quantikz.ClassicalDecision(affectedqubits(op),op.controlbit) Quantikz.QuantikzOp(op::DecisionGate) = Quantikz.ClassicalDecision(affectedqubits(op),Quantikz.ibegin:Quantikz.iend) -Quantikz.QuantikzOp(op::DenseGate) = Quantikz.MultiControlU(affectedqubits(op)) -Quantikz.QuantikzOp(op::DenseMeasurement) = Quantikz.Measurement("\\begin{array}{c}$(lstring(op.pauli))\\end{array}",affectedqubits(op),op.storagebit) -Quantikz.QuantikzOp(op::SparseMeasurement) = Quantikz.Measurement("\\begin{array}{c}$(lstring(op.pauli))\\end{array}",affectedqubits(op),op.storagebit) +#Quantikz.QuantikzOp(op::DenseGate) = Quantikz.MultiControlU(affectedqubits(op)) +Quantikz.QuantikzOp(op::PauliMeasurement) = Quantikz.Measurement("\\begin{array}{c}$(lstring(op.pauli))\\end{array}",affectedqubits(op),op.storagebit) +Quantikz.QuantikzOp(op::sMX) = Quantikz.Measurement("\\begin{array}{c}\\mathtt{X}\\end{array}",affectedqubits(op),op.bit) +Quantikz.QuantikzOp(op::sMY) = Quantikz.Measurement("\\begin{array}{c}\\mathtt{Y}\\end{array}",affectedqubits(op),op.bit) +Quantikz.QuantikzOp(op::sMZ) = Quantikz.Measurement("\\begin{array}{c}\\mathtt{Z}\\end{array}",affectedqubits(op),op.bit) +#Quantikz.QuantikzOp(op::SparseMeasurement) = Quantikz.Measurement("\\begin{array}{c}$(lstring(op.pauli))\\end{array}",affectedqubits(op),op.storagebit) Quantikz.QuantikzOp(op::NoisyGate) = Quantikz.QuantikzOp(op.gate) Quantikz.QuantikzOp(op::VerifyOp) = Quantikz.MultiControlU("\\begin{array}{c}\\mathrm{Verify:}\\\\$(lstring(op.good_state))\\end{array}",affectedqubits(op)) function Quantikz.QuantikzOp(op::Reset) # TODO This is complicated because quantikz requires $$ for some operators but not all of them... Fix in Quantikz.jl