quantumlib / OpenFermion-FQE

The Fermionic Quantum Emulator (FQE) is a fermionic simulation research tool specializing in quantum circuits emulating fermion dynamics.
Apache License 2.0
61 stars 25 forks source link

Improved preset for exit #84

Closed ncrubin closed 3 years ago

ncrubin commented 3 years ago

Wavefunction expansion criteria set to 0 was never being reached. Numerical zero is a better preset.

Also I think we want the max(30,expansion) instead of min(30, expansion) to set the max_expansion.

The min(30, expansion) never let's the user specify a larger expansion than 30.

shiozaki commented 3 years ago

Hi Nick - just noticed, you do not anticipate a use case in which a user sets max_expansion to a number smaller than 30? Like always truncating at rank 10. Maybe there is no physical reason to do that, but just wanted to make sure.

ncrubin commented 3 years ago

this is a good point. There are certainly times when the expansion limit should be set lower. Probably the correct fix should have been to default the max_expansion to something like 30 but remove the min/max line that was in there. For some exact evolution Iw as doing I required ~200 terms in the expansion. I'll make the appropriate change in a new PR.

shiozaki commented 3 years ago

Cool, agreed with the proposed solution.