unitaryfund / pyqrack

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

feature request: versioning and cmake options at build time visible in pyqrack #30

Open twobombs opened 1 month ago

twobombs commented 1 month ago

PyQrack is a python wrapper for Qrack

Qrack can be compiled for PyQrackwith a lot of features, and out of the box this has been done with a 'best of all worlds' settings in mind but are not always obvious nor visible to the user.

Also, some scenarios require different options, and then we need to compile the Qrack binaries and link them (again) to the PyQrack wrapper

We then find ourselves in the stuation what version and what settings the PyQrack at runtime we are looking at as well.

For that reason a feature request is proposed:

I suggest we do not make it too verbose, but still usefull for parsing by scripts to make decisions based on the output

WrathfulSpatula commented 1 week ago

Sorry I've let this languish, but there's a complicating factor: PyQrack itself is not a command-line program. It's a library, rather. However, the following command should tell you the PyQrack version:

pip3 freeze | grep pyqrack

Further, the Qrack version number is given by the shared library *.so file version number:

ls `python3 -m site --user-site`/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.*.*.*

This command probably won't work correctly if you're using venv, but the solution in that case is to check the package cache of the virtual environment, the same way.