ProjectQ-Framework / FermiLib

FermiLib: Open source software for analyzing fermionic quantum simulation algorithms
https://projectq.ch/
Apache License 2.0
86 stars 38 forks source link

Improve active space selection #67

Closed jarrodmcc closed 7 years ago

jarrodmcc commented 7 years ago

This makes it more convenient to specify an active space that selects arbitrary victuals. It importantly also corrects a strange bug of unknown origin that was preventing PyTest from finding the _lih_integration_test.py despite it being in the correct place and being a valid test file.

damiansteiger commented 7 years ago

Before the first release, I turned the _lih_integration_test.py off by renaming it _lih_integration_test_.py. The reason is that it is a very expensive tests to run and will increase the runtime on Travis significantly from 2-3min to 4-5min.

Is there a faster way to tests the same functionality? If not I am fine with turning this tests on, as it is already written and waiting 5mins is too much yet.

idk3 commented 7 years ago

This is a good point, does the LiH test really do something significant beyond the H2 test?

damiansteiger commented 7 years ago

You could check by clicking the link to Travis and compare versus previous runs.

On my notebook lih test takes about 40s, which is very large for a single test. But at this point I prefer to including this test again as it is already written. Travis runtime is still around 5-6min for all tests so it is still okay but it should not grow to 10min as this might be very annoying...

jarrodmcc commented 7 years ago

The LiH test is significant in a few ways. It's the only non-trivial test of the active space functionality in the code as H2 has no core. It's also significant in a few tangential ways, in that there are a surprising number of things you can get wrong and still have it look correct with H2 because of its relatively simplicity and high symmetry. As a result it's worth writing a lot of integration tests to play with LiH instead of H2. However, as you point out, performance starts to become an issue. As LiH is on the small side of what we expect to really use FermiLib for, it's perhaps an opportunity to identify performance bottlenecks rather than cut it out for now. If the run time becomes too heinous though, we might have to rework it in other ways.

damiansteiger commented 7 years ago

Great points.