quantumsavory / bpgates.jl Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.