Unverified Commit 9898fb89 authored by Mccaskey, Alex's avatar Mccaskey, Alex Committed by GitHub

Merge pull request #238 from tnguyen-ornl/tnguyen/fix-gate-merge-bug

Fixed gate merge bug during circuit rewrite
parents b0f31e08 bfa3828e
Pipeline #113108 passed with stage
in 15 minutes and 2 seconds
......@@ -109,11 +109,12 @@ void MergeSingleQubitGatesOptimizer::apply(std::shared_ptr<CompositeInstruction>
}
else
{
const auto locationToInsert = sequence[0];
auto locationToInsert = sequence[0];
for (auto& newInst: zyz->getInstructions())
{
newInst->setBits({bitIdx});
program->insertInstruction(locationToInsert, newInst->clone());
locationToInsert++;
}
}
......@@ -283,11 +284,12 @@ void MergeTwoQubitBlockOptimizer::apply(std::shared_ptr<CompositeInstruction> pr
}
else
{
const auto locationToInsert = sequence[0];
auto locationToInsert = sequence[0];
for (auto& newInst: kak->getInstructions())
{
newInst->setBits(remapBits(newInst->bits()));
program->insertInstruction(locationToInsert, newInst->clone());
locationToInsert++;
}
}
// Jump forward since we don't want to re-analyze this block.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment