Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI failing with scipy 1.14.0 release #12655

Closed
ElePT opened this issue Jun 25, 2024 · 1 comment · Fixed by #13358
Closed

CI failing with scipy 1.14.0 release #12655

ElePT opened this issue Jun 25, 2024 · 1 comment · Fixed by #13358
Labels
bug Something isn't working

Comments

@ElePT
Copy link
Contributor

ElePT commented Jun 25, 2024

Environment

  • Qiskit version: 1.2
  • Python version: 3.12
  • Operating system: CI

What is happening?

The following failures have been detected in relation with scipy==1.14.0:

2024-06-24T21:17:04.2026840Z ==============================
2024-06-24T21:17:04.2027540Z Failed 4 tests - output below:
2024-06-24T21:17:04.2027870Z ==============================
2024-06-24T21:17:04.2028030Z 
2024-06-24T21:17:04.2028220Z test.python.circuit.test_gate_power.TestGateSqrt.test_unitary_sqrt
2024-06-24T21:17:04.2028870Z ------------------------------------------------------------------
2024-06-24T21:17:04.2029100Z 
2024-06-24T21:17:04.2029170Z Captured traceback:
2024-06-24T21:17:04.2029410Z ~~~~~~~~~~~~~~~~~~~
2024-06-24T21:17:04.2029610Z     Traceback (most recent call last):
2024-06-24T21:17:04.2029790Z 
2024-06-24T21:17:04.2030740Z       File "/Users/runner/work/qiskit/qiskit/test/python/circuit/test_gate_power.py", line 116, in test_unitary_sqrt
2024-06-24T21:17:04.2031760Z     self.assertEqual(Operator(result), Operator(expected))
2024-06-24T21:17:04.2032000Z 
2024-06-24T21:17:04.2032410Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 885, in assertEqual
2024-06-24T21:17:04.2033040Z     assertion_func(first, second, msg=msg)
2024-06-24T21:17:04.2033240Z 
2024-06-24T21:17:04.2033690Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 878, in _baseAssertEqual
2024-06-24T21:17:04.2034470Z     raise self.failureException(msg)
2024-06-24T21:17:04.2034720Z 
2024-06-24T21:17:04.2034920Z     AssertionError: Operator([[ 0.5-0.5j, -0.5+0.5j],
2024-06-24T21:17:04.2035340Z           [ 0.5-0.5j, [51 chars](2,)) != Operator([[ 0.5+0.5j,  0.5+0.5j],
2024-06-24T21:17:04.2035800Z           [-0.5-0.5j, [51 chars](2,))
2024-06-24T21:17:04.2035970Z 
2024-06-24T21:17:04.2035980Z 
2024-06-24T21:17:04.2036220Z test.python.quantum_info.operators.channel.test_kraus.TestKraus.test_circuit_init
2024-06-24T21:17:04.2036900Z ---------------------------------------------------------------------------------
2024-06-24T21:17:04.2037200Z 
2024-06-24T21:17:04.2037270Z Captured traceback:
2024-06-24T21:17:04.2037560Z ~~~~~~~~~~~~~~~~~~~
2024-06-24T21:17:04.2037770Z     Traceback (most recent call last):
2024-06-24T21:17:04.2038010Z 
2024-06-24T21:17:04.2038930Z       File "/Users/runner/work/qiskit/qiskit/test/python/quantum_info/operators/channel/test_kraus.py", line 71, in test_circuit_init
2024-06-24T21:17:04.2039700Z     self.assertEqual(op, target)
2024-06-24T21:17:04.2039890Z 
2024-06-24T21:17:04.2040430Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 885, in assertEqual
2024-06-24T21:17:04.2041110Z     assertion_func(first, second, msg=msg)
2024-06-24T21:17:04.2041320Z 
2024-06-24T21:17:04.2041800Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 878, in _baseAssertEqual
2024-06-24T21:17:04.2042480Z     raise self.failureException(msg)
2024-06-24T21:17:04.2042720Z 
2024-06-24T21:17:04.2043360Z     AssertionError: Kraus([[[ 0. +0.j,  0. +0.j,  0.5+0.j,  0.5+0.j,  0. +[785 chars], 2)) != Kraus([[[ 0.        +0.j        ,  0.        +0.j     [1889 chars], 2))
2024-06-24T21:17:04.2043910Z 
2024-06-24T21:17:04.2044100Z 
2024-06-24T21:17:04.2044440Z test.python.quantum_info.operators.channel.test_stinespring.TestStinespring.test_circuit_init
2024-06-24T21:17:04.2045300Z ---------------------------------------------------------------------------------------------
2024-06-24T21:17:04.2045650Z 
2024-06-24T21:17:04.2045720Z Captured traceback:
2024-06-24T21:17:04.2045890Z ~~~~~~~~~~~~~~~~~~~
2024-06-24T21:17:04.2046090Z     Traceback (most recent call last):
2024-06-24T21:17:04.2046270Z 
2024-06-24T21:17:04.2046770Z       File "/Users/runner/work/qiskit/qiskit/test/python/quantum_info/operators/channel/test_stinespring.py", line 64, in test_circuit_init
2024-06-24T21:17:04.2047450Z     self.assertEqual(op, target)
2024-06-24T21:17:04.2047650Z 
2024-06-24T21:17:04.2048030Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 885, in assertEqual
2024-06-24T21:17:04.2048610Z     assertion_func(first, second, msg=msg)
2024-06-24T21:17:04.2048860Z 
2024-06-24T21:17:04.2049400Z       File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py", line 878, in _baseAssertEqual
2024-06-24T21:17:04.2050020Z     raise self.failureException(msg)
2024-06-24T21:17:04.2050240Z 
2024-06-24T21:17:04.2050690Z     AssertionError: Stinespring([[ 0. +0.j,  0. +0.j,  0.5+0.j,  0.5+0.j,  0. +[865 chars], 2)) != Stinespring([[ 0.        +0.j        ,  0.        +0.j     [2049 chars], 2))
2024-06-24T21:17:04.2051280Z 
2024-06-24T21:17:04.2051290Z 
2024-06-24T21:17:04.2051660Z test.python.quantum_info.operators.symplectic.test_sparse_pauli_op.TestSparsePauliOpConversions.test_to_matrix_zero
2024-06-24T21:17:04.2052670Z -------------------------------------------------------------------------------------------------------------------
2024-06-24T21:17:04.2052950Z 
2024-06-24T21:17:04.2053020Z Captured traceback:
2024-06-24T21:17:04.2053190Z ~~~~~~~~~~~~~~~~~~~
2024-06-24T21:17:04.2053390Z     Traceback (most recent call last):
2024-06-24T21:17:04.2053640Z 
2024-06-24T21:17:04.2054240Z       File "/Users/runner/work/qiskit/qiskit/test/python/quantum_info/operators/symplectic/test_sparse_pauli_op.py", line 274, in test_to_matrix_zero
2024-06-24T21:17:04.2055150Z     np.testing.assert_array_equal(zero_sparse.A, zero_numpy)
2024-06-24T21:17:04.2055500Z                                   ^^^^^^^^^^^^^
2024-06-24T21:17:04.2055730Z 
2024-06-24T21:17:04.2055990Z     AttributeError: 'csr_matrix' object has no attribute 'A'
2024-06-24T21:17:04.2056250Z 

How can we reproduce the issue?

CI tests using Python 3.12

What should happen?

No failures :)

Any suggestions?

Pinning scipy until issues are resolved (#12654).

@ElePT ElePT added the bug Something isn't working label Jun 25, 2024
@jakelishman
Copy link
Member

Coming back to this: this is macOS, and I think the first three failures are all because SciPy 1.14 switched to use Accelerate as its default BLAS. The problems of #13305 are likely the simplest reproducer of those failures.

The last one is just because the .A attribute on sparse matrices was deprecated and removed. Apparently I introduced that in #11388, and we haven't been seeing the warnings for some reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants