qsharp-community / qsharp-integrations Goto Github PK
View Code? Open in Web Editor NEWThese samples demonstrate how to integrate with the Q# language or compilers
License: MIT License
These samples demonstrate how to integrate with the Q# language or compilers
License: MIT License
People are currently seeing the current QDK one.
The following QASM code
OPENQASM 2.0;
qreg q[1];
U(θ,φ,λ) q[0];
is translated to this Q# code (not complete):
use q = Qubit[1] {
Rx(θ, q[0]);
Ry(φ, q[0]);
Rz(λ, q[0]);
ResetAll(q);
}
This logic is implemented in the following parts of Parser.cs
:
qsharp-integrations/src/OpenQasmReader/Parser.cs
Lines 118 to 121 in 03fcaa2
qsharp-integrations/src/OpenQasmReader/Parser.cs
Lines 740 to 778 in 03fcaa2
However, the definition of QASM's U gate is:
And the above is not equal to Rz(λ)*Ry(φ)*Rx(θ).
See the following gist for more details:
https://gist.github.com/jond01/c942a7358e27e99aa6a68ea7ef42fe65
The correct translation is:
U(θ, φ, λ) = e^{i(φ+λ)/2}*Rz(φ)*Ry(θ)*Rz(λ)
(See Eqs. (1) and (2) in https://arxiv.org/pdf/2104.14722.pdf#page=11.)
It is essential to fix ParseUGate
code and would be nice to implement a Q# operation U that contains the rotations and the global phase.
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.