You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if QuantumClifford.CliffordOperator(bpgate) and QuantumOptics.Operator(bpgate) worked out of the box. Here is the current workaround
julia> using QuantumOpticsBase, QuantumClifford, BPGates
julia> cnotperm = CNOTPerm(3,4,1,2); # a gate you want converted
julia> accumulate = one(CliffordOperator,2); # an identity operator which we will multiply by the Cliffords that make up cnotperm
X₁ ⟼ + X_
X₂ ⟼ + _X
Z₁ ⟼ + Z_
Z₂ ⟼ + _Z
julia> for gate in BPGates.toQCcircuit(cnotperm) # we are building up the transpiled Clifford from the
accumulate = gate*accumulate
end
julia> accumulate # this is the Clifford gate you want
X₁ ⟼ + Z_
X₂ ⟼ + _Z
Z₁ ⟼ + X_
Z₂ ⟼ + _X
julia> Operator(accumulate) # and here it is converted to a unitary gate representation
Operator(dim=4x4)
basis: [Spin(1/2) ⊗ Spin(1/2)]
0.5+0.0im 0.5+0.0im 0.5+0.0im 0.5+0.0im
0.5+0.0im -0.5+0.0im 0.5+0.0im -0.5+0.0im
0.5+0.0im 0.5+0.0im -0.5+0.0im -0.5+0.0im
0.5+0.0im -0.5+0.0im -0.5+0.0im 0.5+0.0im
The text was updated successfully, but these errors were encountered:
It would be nice if
QuantumClifford.CliffordOperator(bpgate)
andQuantumOptics.Operator(bpgate)
worked out of the box. Here is the current workaroundThe text was updated successfully, but these errors were encountered: