quantumlib / OpenFermion

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

scipy > 1.9.3 breaks QuarticFermionicSimulationGate decompose method. #815

Closed fdmalone closed 8 months ago

fdmalone commented 1 year ago

Tracking this here. A bug was introduced into scipy for linalg.sqrtm for complex valued matrices which appears starting v1.10.0 (see #18250). This causes our tests to fail for QuarticFermionicSimulationGate due to loss of precision. I'll pin the scipy dependency to < 1.10.0 for the moment.

yurivict commented 10 months ago

@fdmalone

Do you know if there is a fix for this?

fdmalone commented 10 months ago

It hasn't been fixed in scipy yet, but there does look to be an open PR. If there's no more activity there we may need to implement our own OR relax our test thresholds. The square root function is only used once in openfermion.

mpharrigan commented 8 months ago

This is becoming increasingly more of an issue, xref #851 . It's not clear from the linked issue whether there will be a fix or not.

Can we just bump our input precision to complex256?

fdmalone commented 8 months ago

I'll look into it. Worst case we could probably just write a custom square root function.

fdmalone commented 8 months ago

Fixed with #864