Replies: 3 comments 6 replies
-
Note: If device have one-way CX gate, staq will automatically use Hadamard gate . |
Beta Was this translation helpful? Give feedback.
-
Thanks @WATLE , we kept it symbolic whenever possible, so we can do more aggressive optimizations. Would it be useful to have a compiler option that evaluates everything? If yes, can you please tell us a use case? |
Beta Was this translation helpful? Give feedback.
-
We've added the staq option |
Beta Was this translation helpful? Give feedback.
-
This program produces the following output
U(pi/2,0,pi) q[2];
U(0,0,pi/4) q[2];
CX q[3],q[2];
U(0,0,-pi/4) q[2];
U(0,0,pi/4) q[1];...
I want the following output
U(1.5707963267949,0,3.14159274101257) q[2];
U(0,0,0.785398185253143) q[2];
CX q[3],q[2];
U(0,0,-0.785398185253143) q[2];
U(0,0,0.785398185253143) q[1];
I made "qelib2.inc" .
qelib2.inc is placed in the same location as the qasm file
I used qelib2.inc instead of "qelib1.inc".
The first 11 lines of qelib2 are:
// Quantum Experience (QE) Standard Header
// file: qelib2.inc
// --- QE Hardware primitives ---
// 3-parameter 2-pulse single qubit gate
gate u3(theta,phi,lambda) q { U(theta+1.0-1.0,phi+1.0-1.0,lambda+1.0-1.0) q; }
// 2-parameter 1-pulse single qubit gate
gate u2(phi,lambda) q { U(pi/2+1.0-1.0,phi+1.0-1.0,lambda+1.0-1.0) q; }
// 1-parameter 0-pulse single qubit gate
gate u1(lambda) q { U(0.0,0.0,lambda+1.0-1.0) q; }
The rest is the same as qelib1.inc
In this way I got a real output.
Because pi + 1.0-1.0 = 3.14159 ...
Note: If the original file has a pi in the U function, it won't work as it won't be converted.
Beta Was this translation helpful? Give feedback.
All reactions