diff --git a/Project.toml b/Project.toml index afbe81c..659884f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Quantikz" uuid = "b0d11df0-eea3-4d79-b4a5-421488cbf74b" authors = ["Stefan Krastanov "] -version = "1.2" +version = "1.3" [deps] EndpointRanges = "340492b5-2a47-5f55-813d-aca7ddf97656" diff --git a/src/Quantikz.jl b/src/Quantikz.jl index 47ee7d5..4a00bad 100644 --- a/src/Quantikz.jl +++ b/src/Quantikz.jl @@ -112,8 +112,15 @@ struct MultiControlU <: QuantikzOp control::ArrayOrRange ocontrol::ArrayOrRange target::ArrayOrRange + target_notU::ArrayOrRange end +function MultiControlU(str::AbstractString, + control::ArrayOrRange, + ocontrol::ArrayOrRange, + target::ArrayOrRange) + MultiControlU(str,control,ocontrol,target,[]) +end MultiControlU(target::ArrayOrRange) = MultiControlU("\\;\\;",[],[],target) MultiControlU(str::AbstractString, target::ArrayOrRange) = MultiControlU(str,[],[],target) MultiControlU(control::ArrayOrRange,ocontrol::ArrayOrRange,target::ArrayOrRange) = MultiControlU("\\;\\;",control,ocontrol,target) @@ -122,15 +129,17 @@ MultiControlU(control::Integer,target::ArrayOrRange) = MultiControlU("\\;\\;",[c MultiControlU(str::AbstractString,control::Integer,target::Integer) = MultiControlU(str,[control],[],[target]) MultiControlU(control::Integer,target::Integer) = MultiControlU("\\;\\;",[control],[],[target]) -affectedqubits(g::MultiControlU) = [g.control...,g.ocontrol...,g.target...] +affectedqubits(g::MultiControlU) = [g.control...,g.ocontrol...,g.target...,g.target_notU...] function update_table!(qtable,step,g::MultiControlU) table = qubitsview(qtable) control = g.control ocontrol = g.ocontrol target = g.target + target_notU = g.target_notU controls = sort([ [("\\ctrl",i) for i in control]..., [("\\octrl",i) for i in ocontrol]..., + [("\\targ{}\\vqw",i) for i in target_notU]..., ], by=e->e[2]) m,M = extrema(target) if length(controls)==0