qiskit/test/python/quantum_info/operators/channel
Jake Lishman 2327fdeb91
Fix compatibility issues with SciPy 1.14 (#13358)
* Fix compatibility issues with SciPy 1.14

The main change here is that SciPy 1.14 on macOS now uses the system
Accelerate rather than a bundled OpenBLAS by default.  These have
different characteristics for several LAPACK drivers, which caused
numerical instability in our test suite.  Fundamentally, these problems
existed before; it was always possible to switch out the BLAS/LAPACK
implementation that SciPy used, but in practice, the vast majority of
users (and our CI) use the system defaults.

The modification to `Operator.power` to shift the branch cut was
suggested by Lev.  As a side-effect of how it's implemented, it fixes
an issue with `Operator.power` on non-unitary matrices, which Sasha had
been looking at.

The test changes to the Kraus and Stinespring modules are to cope with
the two operators only being defined up to a global phase, which the
test previously did not account for.  The conversion to Kraus-operator
form happens to work fine with OpenBLAS, but caused global-phase
differences on macOS Accelerate.  A previous version of this commit
attempted to revert the Choi-to-Kraus conversion back to using `eigh`
instead of the Schur decomposition, but the `eigh` instabilities noted
in fdd5603af7 (gh-3884) (the time of Scipy 1.1 to 1.3, with OpenBLASes
around 0.3.6) remain with Scipy 1.13/1.14 and OpenBLAS 0.3.27.

Co-authored-by: Lev S. Bishop <18673315+levbishop@users.noreply.github.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>

* Expose `branch_cut_rotation` parameter in `Operator.power`

The rotation used to stabilise matrix roots has an impact on which
matrix is selected as the principal root.  Exposing it to users to allow
control makes the most sense.

---------

Co-authored-by: Lev S. Bishop <18673315+levbishop@users.noreply.github.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
2024-10-25 11:04:36 +00:00
..
__init__.py Remove coding: utf-8 per PEP 3120 (#4914) 2020-08-12 08:29:16 -04:00
channel_test_case.py Switch to using black for code formatting (#6361) 2021-05-05 09:53:39 -04:00
test_adjoint.py Switch to using black for code formatting (#6361) 2021-05-05 09:53:39 -04:00
test_chi.py Alias BaseOperator.__mul__ to BaseOperator._multiply in quantum_info (#8007) 2022-05-09 01:55:17 +00:00
test_choi.py Alias BaseOperator.__mul__ to BaseOperator._multiply in quantum_info (#8007) 2022-05-09 01:55:17 +00:00
test_evolve.py Bump black version and relax constraint (#7615) 2022-02-03 18:07:22 +00:00
test_kraus.py Fix compatibility issues with SciPy 1.14 (#13358) 2024-10-25 11:04:36 +00:00
test_linearops.py Switch to using black for code formatting (#6361) 2021-05-05 09:53:39 -04:00
test_ptm.py Alias BaseOperator.__mul__ to BaseOperator._multiply in quantum_info (#8007) 2022-05-09 01:55:17 +00:00
test_stinespring.py Fix compatibility issues with SciPy 1.14 (#13358) 2024-10-25 11:04:36 +00:00
test_superop.py Alias BaseOperator.__mul__ to BaseOperator._multiply in quantum_info (#8007) 2022-05-09 01:55:17 +00:00
test_tensor_compose.py Switch to using black for code formatting (#6361) 2021-05-05 09:53:39 -04:00
test_transformations.py Switch to using black for code formatting (#6361) 2021-05-05 09:53:39 -04:00