Overview

SciPy 1.11, released on June 26, 2023, improves Array API compatibility and sparse matrix operations.

Main Features

Array API compatibility

SciPy 1.11 progresses toward Array API compliance, allowing alternative backends like CuPy or JAX for scientific computing.

python
from scipy import linalg
import numpy as np

# LU decomposition
A = np.array([[2, 5, 8], [4, 6, 3], [7, 1, 9]])
P, L, U = linalg.lu(A)
print(f'L diagonal: {np.diag(L)}')

# Verify: P @ L @ U == A
print(np.allclose(P @ L @ U, A))  # True

Sparse improvements

The scipy.sparse module benefits from new optimized operations and better integration with linear solvers.

python
from scipy import sparse
from scipy.sparse.linalg import spsolve
import numpy as np

n = 1000
A = sparse.diags([-1, 2, -1], [-1, 0, 1], shape=(n, n),
                  format='csr')
b = np.ones(n)
x = spsolve(A, b)
print(f'Solution min/max: {x.min():.2f} / {x.max():.2f}')

Sources