Skip to content

Commit

Permalink
fix a bug to generate a diagonal gate in the end of circuit (Qiskit#1294
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hhorii authored Jul 20, 2021
1 parent 45caa49 commit 1cfa05e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transpile/fusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,10 @@ bool DiagonalFusion::aggregate_operations(oplist_t& ops,
continue;

std::vector<uint_t> fusing_op_idxs;
for (; op_idx < next_diagonal_start; ++op_idx)
while(op_idx < next_diagonal_start && op_idx < fusion_end) {
fusing_op_idxs.push_back(op_idx);
++op_idx;
}

--op_idx;
allocate_new_operation(ops, op_idx, fusing_op_idxs, method, true);
Expand Down

0 comments on commit 1cfa05e

Please sign in to comment.