Skip to content

Fix dynamic qubit allocation

Compare
Choose a tag to compare
@WrathfulSpatula WrathfulSpatula released this 03 Jun 15:47
· 277 commits to master since this release
b99fca5

For now, the Catalyst back end is still under development. However, in this release, the PyQrack-based back end manages its "endianness" slightly differently, to correctly support dynamic qubit allocation and deallocation. Specifically, PennyLane expects that state vector and sample order is "big-endian," whereas most quantum computer simulators assume these to be "little-endian." Instead of mapping in reverse, as previously, the PyQrack back end now maps "forward" but reverses qubit order in reporting state vectors and samples across the full simulator width. This way, qubit labels are fully respected if qubits are dynamically allocated according to an arbitrary wire map, while the reporting endianness remains correct as it was for static allocation before.