unitaryfund / qrack

Comprehensive, GPU accelerated framework for developing universal virtual quantum processors
https://qrack.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
176 stars 38 forks source link

QPager `test_qunit_paging` bug #824

Closed WrathfulSpatula closed 3 years ago

WrathfulSpatula commented 3 years ago

QPager -> QHybrid stack, for example, fails the test_qunit_paging test. This is likely a significant inaccurate edge case, for stacks involving QPager. Within the QPager implementation, I have determined that the bug is likely within ApplyEitherControlledSingleBit(), or a QPager distributed gate logic method called within it, or else Compose(), or else Prob() or a probability check variant.

I can address this tomorrow.

WrathfulSpatula commented 3 years ago

I think that the bug is in page-wise QPager::Compose(). Following another cup of coffee, I'll hopefully be able to remember how we form these Kronecker product states, extended to separate pages.

WrathfulSpatula commented 3 years ago

I think my paged algorithm could be fixed with a quantum arithmetic shift. Thinking about it.

WrathfulSpatula commented 3 years ago

Similarly, there were bugs in basically all of the Compose() and Decompose() variants of QPager, systemically. However, I've found a fix for Compose(), and Dispose() seems fine. Decompose() was kludged into low-performance but working state, but QUnit relies on Compose() and Dispose() without Decompose(), so I think we're in a tenable state.