unitaryfund / pyqrack

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library
MIT License
16 stars 8 forks source link

WASM/Android/iOS support #3

Closed WrathfulSpatula closed 2 years ago

WrathfulSpatula commented 3 years ago

Sorry to bloat the package slightly, (at <32MB in total,) but I decided to include default shared and static library builds for WebAssembly, Android, and iOS. The problem is, I don't yet know how to detect these platforms, in Python.

So you have the necessary Qrack build libraries already, when you pip install pyqrack! But, if any community member actually has an environment set up, and a reason, to build any of these additional platforms, please update https://github.com/vm6502q/pyqrack/blob/main/pyqrack/qrack_system/qrack_system.py in the pypi_package (release) branch in order to switch between the appropriate binaries, and open a pull request.

In fact, shortly, I'll add the option to specify an arbitrary path for the shared library, for the QrackSystem class. We can't do this in the interpreter, as I'd like to do it, because QrackSystem is instantiated as a global Qrack instance singleton. However, an environment variable would work, here.

I'll add the environment variable. Please, if you build for WebAssembly, Android, or iOS, I'd really appreciate if you experimented with the QrackSystem constructor a little bit, just to identify the platform and machine information that works to automatically detect the environment to load the right shared library.

WrathfulSpatula commented 2 years ago

Closed for inactivity, and being out-of-date. There are ways to make this work, but they first need to be demanded.