Skip to content

Commit

Permalink
fixed errors in OpenQASM examples
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Sep 5, 2023
1 parent 0a466aa commit 054e2d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions examples/bad.qasm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OPENQASM 2.0;
include "qelib1.inc";

qreg x[2];
qreg y[3];
qreg q1[2];
qreg q2[3];

CX x,y;
CX q1,q2;
4 changes: 2 additions & 2 deletions examples/inline_test.qasm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OPENQASM 2.0;
include "qelib1.inc";

qreg x[2];
qreg q[2];

gate cphase(theta) a,b {
rz(theta/2) a;
Expand All @@ -11,4 +11,4 @@ gate cphase(theta) a,b {
cx a,b;
}

cphase(pi/4) x[0],x[1];
cphase(pi/4) q[0],q[1];
30 changes: 15 additions & 15 deletions examples/mapping_test.qasm
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
OPENQASM 2.0;
include "qelib1.inc";

qreg x[4];
qreg y[4];
qreg q1[4];
qreg q2[4];

cx x[0],x[1];
cx x[1],x[2];
cx x[2],x[3];
cx x[3],x[0];
cx q1[0],q1[1];
cx q1[1],q1[2];
cx q1[2],q1[3];
cx q1[3],q1[0];

t x[1];
t q1[1];

cx x[0],y[0];
cx x[1],y[1];
cx x[2],y[2];
cx x[3],y[3];
cx q1[0],q2[0];
cx q1[1],q2[1];
cx q1[2],q2[2];
cx q1[3],q2[3];

cx y[0],y[1];
cx y[1],y[2];
cx y[2],y[3];
cx y[3],y[0];
cx q2[0],q2[1];
cx q2[1],q2[2];
cx q2[2],q2[3];
cx q2[3],q2[0];
4 changes: 2 additions & 2 deletions examples/multi-ancilla_test.qasm
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ gate foo a {
cx a,c[0];
}

qreg x[2];
foo x[0];
qreg q[2];
foo q[0];

0 comments on commit 054e2d0

Please sign in to comment.