ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 24 forks source link

Fix support for zero-cut orderings. #285

Closed 95-martin-orion closed 4 years ago

95-martin-orion commented 4 years ago

Fixes an issue spotted in #284.

Previously, having zero cuts would cause this tool to spit out a blank contraction ordering. This PR adds an initial pass before applying cuts to ensure that zero-cut requests generate an ordering.

One side effect of this is that it is now possible for the auto-ordering tool to stop at zero cuts if adding the first cut fails to improve total cost (although such an occurrence is rare).

95-martin-orion commented 4 years ago

I'll include tests in this PR as well - please hold off on review/merge until then.

95-martin-orion commented 4 years ago

I'll include tests in this PR as well - please hold off on review/merge until then.

Tests added, ready for review.