quantumlib / OpenFermion

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

Fix doc generation #869

Closed dstrain115 closed 6 months ago

dstrain115 commented 6 months ago

This document errors out with the following error:

"RuntimeError: maximum taylor expansion limit reached"

Changing the time to 0.9 eliminates the error. Better solutions or ideas welcome, but this at least allows the python notebooks to be generated.

fdmalone commented 6 months ago

Do we know when this started to fail?

dstrain115 commented 6 months ago

Do we know when this started to fail?

Not really. At least a month. It's been broken for a while, and we were not checking the email alias for doc generation for a while.

fdmalone commented 6 months ago

My current guess is this accuracy threshold was never met for this example (it's set at 1e-15 (the example reaches 1e-14)). In fqe v0.3.0 this raises an error if the max number of iterations is reached before the threshold is breached. Looking back to v0.1.0 there was no warning raised. The notebook seems to be quite a bit older given that it's being pip installed as a git repo and not as a tagged release (there is a comment about updating this to pip install fqe once v0.1.0 is released).

It seems like the correct fix would be to update the accuracy threshold but this doesn't appear to be a controllable parameter from time_evolve. So for the moment I think your fix is the only way.

WDYT @ncrubin

fdmalone commented 6 months ago

although this seems pretty environment dependent, are there build logs somewhere / environment information. As a side note we should be testing the Openfermion notebooks ourselves periodically.

fdmalone commented 6 months ago

xref #853

dstrain115 commented 6 months ago

Ah, interesting. Maybe we can also create a new issue to plumb out the error_threshold as a parameter as well. Let me know if you would like me to put in this fix for now.

fdmalone commented 6 months ago

Yeah I will open a tracking issue, it's probably best to merge now to fix the docs at least. And we can make the unitary prettier again once the FQE / dependency issue is fixed. It's still not clear to me if this is some dependency change or it's just a flaky thing (although I would think it's deterministic), because I've successfully run the notebook locally in a different environment and can't quite pin down the combination of libraries necessary to reproduce.

fdmalone commented 6 months ago

Will you need a new openfermion release to fully fix this?

dstrain115 commented 6 months ago

Will you need a new openfermion release to fully fix this?

I don't think so. Let's see if the doc generation gets fixed overnight.