From 054e2d0fc3573d53c424a96e671aada15dba62cf Mon Sep 17 00:00:00 2001 From: Vlad Gheorghiu Date: Tue, 5 Sep 2023 14:17:11 -0400 Subject: [PATCH] fixed errors in OpenQASM examples --- examples/bad.qasm | 6 +++--- examples/inline_test.qasm | 4 ++-- examples/mapping_test.qasm | 30 +++++++++++++++--------------- examples/multi-ancilla_test.qasm | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/bad.qasm b/examples/bad.qasm index 25085396..51390416 100644 --- a/examples/bad.qasm +++ b/examples/bad.qasm @@ -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; diff --git a/examples/inline_test.qasm b/examples/inline_test.qasm index d0e7f012..13925fd8 100644 --- a/examples/inline_test.qasm +++ b/examples/inline_test.qasm @@ -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; @@ -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]; diff --git a/examples/mapping_test.qasm b/examples/mapping_test.qasm index 3fdae1d6..dd323470 100644 --- a/examples/mapping_test.qasm +++ b/examples/mapping_test.qasm @@ -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]; diff --git a/examples/multi-ancilla_test.qasm b/examples/multi-ancilla_test.qasm index 2732d247..4746ecaf 100644 --- a/examples/multi-ancilla_test.qasm +++ b/examples/multi-ancilla_test.qasm @@ -8,5 +8,5 @@ gate foo a { cx a,c[0]; } -qreg x[2]; -foo x[0]; +qreg q[2]; +foo q[0];