Closed WrathfulSpatula closed 3 years ago
Come to think of it, if a "non-intuitive" qubit order is used, QUnit
in the underlying C++ will have to resort to quick sort via full-cost quantum SWAP
operators, if the qubits aren't Schmidt decomposed. However, I think users will understand or at least tolerate that monotonic, contiguous arithmetic register ordering is "easier" for the underlying library than some really "random" ordering of qubit indices, though it's a great feature, and simple enough, to still offer the arbitrary qubit index lists inputs.
Specifically, if the user starts using a particular qubit order for arithmetic, we can assume that they're likely to repeat the use of that exact order, or a subset or super-set, and it happens that we can make the SWAP
sort a one-time cost, in that case.
This is implemented in v0.3.0
and up.
I'm working, in off hours, on a set of Jupyter notebooks to demonstrate useful applications of
pyqrack
. Big, obviously interesting examples include Shor's algorithm and Grover's algorithm. Both of these are much more easily implemented if Qrack's optimized "ALU" is exposed to the shared library, (that is, the arithmetic methods).I'll be iterating to v0.3.0 within the next day or two, or no later than the end of the upcoming weekend, specifically to expose the ALU methods, via a regularized set of signatures. Since we now have a constant time
SWAP
gate, (believe it or not,) there's no performance disincentive to letting users supply Python lists of arbitrary-order qubit indices, for arithmetic methods.