Skip to content

Commit

Permalink
🔀 Merge pull request #134 from DVLab-NTU/fix/qcir_equiv_prematurely_a…
Browse files Browse the repository at this point in the history
…pplies_todd

🐛 fix qcir equiv prematurely applies TODD
  • Loading branch information
JoshuaLau0220 committed Jun 2, 2024
2 parents b5f5531 + 0b51084 commit d0474cd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/tableau/tableau_optimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,14 @@ void merge_rotations(Tableau& tableau) {
return;
}

auto& clifford = std::get<StabilizerTableau>(tableau.front());
auto& rotations = std::get<std::vector<PauliRotation>>(tableau.back());

merge_rotations(rotations);
absorb_clifford_rotations(clifford, rotations);
auto& clifford = std::get<StabilizerTableau>(tableau.front());
auto& rotations = std::get<std::vector<PauliRotation>>(tableau.back());
auto n_rotations = SIZE_MAX;
do { // NOLINT(cppcoreguidelines-avoid-do-while)
n_rotations = rotations.size();
merge_rotations(rotations);
absorb_clifford_rotations(clifford, rotations);
} while (rotations.size() < n_rotations);
}

// phase polynomial optimization
Expand Down

0 comments on commit d0474cd

Please sign in to comment.