Skip to content

Commit

Permalink
Add support of comment line and empty line to Graph::from_qasm_file
Browse files Browse the repository at this point in the history
  • Loading branch information
xumingkuan committed Oct 24, 2022
1 parent 07fab41 commit 626225e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/quartz/tasograph/tasograph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,10 +1380,14 @@ Graph::_from_qasm_stream(Context *ctx,
std::stringstream ss(line);
std::string command;
std::getline(ss, command, ' ');
if (command == "OPENQASM") {
continue; // ignore this line
if (command == "//") {
continue; // comment, ignore this line
} else if (command == "") {
continue; // empty line, ignore this line
} else if (command == "OPENQASM") {
continue; // header, ignore this line
} else if (command == "include") {
continue; // ignore this line
continue; // header, ignore this line
} else if (command == "creg") {
continue; // ignore this line
} else if (command == "qreg") {
Expand Down

0 comments on commit 626225e

Please sign in to comment.