-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add C++ decomposition with
scipy_openblas32
(#995)
### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [x] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** [sc-78187] & [sc-53754] The `blas/lapack` support is a long standing issue for `lightning`. The main challenge is the wheels building for the `windows` platform, which does not support a `fortran` compiler natively. Recently, the `scipy` team release the standalone `scipy-openblas32` wheel for `linux`, `windows` and `macos` platform. This could solve the win support issue. There are a few technical discussions on how to add the `scipy-openblas32` support to `lightning`: - Dynamic loading vs static linking? Dynamic loading was chosen and the `relative path` to the `libscipy_openblas` is added to the `runpath` of the shared lib object of installations from wheel. In this case, `scipy-openblas32` is required to be installed in the same `site-packages` dir. However, for the direct C++ usage as well as `pip editable install`, the absolute path to `libscipy_openblas` is still needed to ensure the `libscipy_openblas` lib can be found and loaded. - As a result, `scipy-openblas32` is a dependency of `lightning`. - This implementation does not support `conda-forge`. This PR also brings a few other changes: - `BLASLib` loading is handled by a singleton class `BLASLibLoaderManager`, instead of the `compute_diagonalizing_gates` API. - The `openblas` support is tested against `macos`, `linux` and `windows` for the C++ tests on CIs and integration with `catalyst` locally. - An additional `cmake option`: `PY_INSTALL` is added to identify if the pip installation is editable or not. This `PY_INSTALL` is `ON` if `not self.editable_mode`. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <[email protected]> Co-authored-by: lillian542 <[email protected]> Co-authored-by: Ali Asadi <[email protected]>
- Loading branch information
1 parent
f9e8f62
commit 705fe89
Showing
42 changed files
with
297 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.