PennyLaneAI / catalyst

A JIT compiler for hybrid quantum programs in PennyLane
https://docs.pennylane.ai/projects/catalyst
Apache License 2.0
110 stars 28 forks source link

Improve how the SciPy BLAS library is found #633

Open dime10 opened 3 months ago

dime10 commented 3 months ago

Catalyst support for certain JAX functions relies on a BLAS runtime library being available, specifically the OpenBLAS library shipped with SciPy. The relevant source code is located in the Python compiler driver: https://github.com/PennyLaneAI/catalyst/blob/72698d8120bd691e7c197bb7c852e1228a261db4/frontend/catalyst/compiler.py#L289-L304

This code snippet is brittle and susceptible to different packaging configurations (for instance the assumption of the folder locations relative to the scipy package location.

At minimum we should raise a user friendly error message that there is a problem with the scipy installation.

Ideally, we would also find ways to make this more robust on the various systems, and also consider conda installations.

dime10 commented 3 months ago

At minimum we should raise a user friendly error message that there is a problem with the scipy installation.

The first part has been completed, but I'll leave this issue open to track the improvement to the library detection system.