qiboteam / qibo

A framework for quantum computing
https://qibo.science
Apache License 2.0
287 stars 58 forks source link

CVXPY transitive dependency not working on Mac M* #1019

Open alecandido opened 1 year ago

alecandido commented 1 year ago

We depend on CVXPY only in the tests: https://github.com/qiboteam/qibo/blob/21a4f2023c307e5a7cd23fa6152256a251a611ae/pyproject.toml#L49-L52 and only because of a single test: https://github.com/qiboteam/qibo/blob/21a4f2023c307e5a7cd23fa6152256a251a611ae/src/qibo/quantum_info/metrics.py#L901-L981

However, because of its transitive dep qdldl, it is required to have CMake on your machine to compile from source the package (since wheels are only available for MacOS x86).

https://github.com/qiboteam/qibo/blob/21a4f2023c307e5a7cd23fa6152256a251a611ae/poetry.lock#L889 https://github.com/qiboteam/qibo/blob/21a4f2023c307e5a7cd23fa6152256a251a611ae/poetry.lock#L2561 https://github.com/qiboteam/qibo/blob/21a4f2023c307e5a7cd23fa6152256a251a611ae/poetry.lock#L3516-L3518

I'm pointing out this isolated dependence, because it increases the number of upstreams project. However, there is no priority for this in the short term.

alecandido commented 12 months ago

A reasonable alternative could be:

https://docs.scipy.org/doc/scipy/tutorial/optimize.html#constrained-minimization-of-multivariate-scalar-functions-minimize