Skip to content

Commit

Permalink
Fixed qasm synth to omit outputing identity gates
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlambert committed May 15, 2024
1 parent 0b0b471 commit 6dfb465
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/staq/transformations/qasm_synth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class QASMSynthImpl final : public ast::Replacer {
public:
QASMSynthImpl(const GridSynthOptions& opt)
: synthesizer_(make_synthesizer(opt)), w_count_(0), check_(opt.check),
details_(opt.details), verbose_(opt.verbose){};
details_(opt.details), verbose_(opt.verbose) {};
~QASMSynthImpl() = default;

void run(ast::ASTNode& node) { node.accept(*this); }
Expand Down Expand Up @@ -115,6 +115,8 @@ class QASMSynthImpl final : public ast::Replacer {
} else {
w_count_ += 2;
}
} else if (c == 'I' || c == 'i') { // ignore identity elements
continue;
} else {
ret.emplace_back(
make_gate(std::string(1, tolower(c)), gate));
Expand Down

0 comments on commit 6dfb465

Please sign in to comment.