Skip to content

Commit

Permalink
Fix QPager::Compose() bit counting
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jul 10, 2021
1 parent 3897977 commit 1c6be43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/qpager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,17 @@ bitLenInt QPager::Compose(QPagerPtr toCopy, bitLenInt start)
"Cannot instantiate a QPager with greater capacity than environment variable QRACK_MAX_PAGING_QB.");
}

bitLenInt qpp = qubitsPerPage();
// TODO: Avoid CombineEngines();
CombineEngines();

bitLenInt qpp = qubitCount;
bitLenInt tcqpp = toCopy->qubitsPerPage();

if ((qpp + tcqpp) > maxPageQubits) {
tcqpp = (maxPageQubits <= qpp) ? 1U : (maxPageQubits - qpp);
toCopy->SeparateEngines(tcqpp, true);
}

// TODO: Avoid CombineEngines();
CombineEngines();

bitCapIntOcl i;
bitCapIntOcl maxI = ((bitCapIntOcl)toCopy->qPages.size() - 1U);
std::vector<QEnginePtr> nQPages;
Expand Down

0 comments on commit 1c6be43

Please sign in to comment.