Skip to content

Commit

Permalink
Fix OpenQASM output formatting of Rx and Ry
Browse files Browse the repository at this point in the history
  • Loading branch information
singular-value committed Jun 30, 2018
1 parent 720b0db commit 9d2cca7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scaffold/GenOpenQASM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ void GenQASM::genQASM(Function* F)
std::replace(fToPrint.begin(), fToPrint.end(), '.', '_');
std::replace(fToPrint.begin(), fToPrint.end(), '-', '_');

if(fToPrint.find("rz") != string::npos) {
if(fToPrint.find("rx") != string::npos || fToPrint.find("ry") != string::npos || fToPrint.find("rz") != string::npos) {
qGateArg angleArg = mapFunction[mIndex].qArgs.back();
mapFunction[mIndex].qArgs.pop_back();
errs()<<fToPrint<<"(";
Expand Down
4 changes: 2 additions & 2 deletions test_cases/All_Gates_Example/all_gates.qasm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ t q[0];
s q[0];
tdg q[0];
sdg q[0];
rx q[0],3.141590e+00;
ry q[0],3.141590e+00;
rx(3.141590e+00) q[0];
ry(3.141590e+00) q[0];
rz(3.141590e+00) q[0];
reset q[0];
h q[0];
Expand Down

0 comments on commit 9d2cca7

Please sign in to comment.