quantumlib / OpenFermion

The electronic structure package for quantum computers.
Apache License 2.0
1.51k stars 372 forks source link

Resolves failing cirq pre-release #794

Closed ncrubin closed 2 years ago

ncrubin commented 2 years ago

Apparently prior releases of openfermion were attempting to use scipy.linalg.expm to exponentiate sparse matrices. Until recently the scipy API seem to resolve the issue of using scipy.linalg.expm instead of scipy.sparse.linalg.expm.

This issue was not surfaced until the 1.0.0dev release so some combination of numpy/scipy pinning or depinning has revealed this bug in openfermion. This commit fixes the issue by converting scipy.linalg.expm to scipy.sparse.linalg.expm where appropriate.