ProjectQ-Framework / FermiLib

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

Changes to molecular data structure #113

Closed jarrodmcc closed 7 years ago

jarrodmcc commented 7 years ago

This adds memoized loading of all non-scalar variables in our molecular data structure, which prevents excessive memory footprints from undesired data as well as facilitates interaction with the data as if the attributes are in memory. Additionally added gzip compression to all non-scalar variables for increased compactness and faster loading times for larger molecules. Slight change for uniformity on CC amplitudes with respect to the rest of data that should be reflected in the plugin updates as well.

babbush commented 7 years ago

Hey Jarrod, thanks for doing this! I will take a closer look tomorrow. One immediate comment is that we recently updated the coveralls requirements; contributions are no longer allowed to decrease test coverage. Can you add one or two more tests? There is a lot that isn't covered in molecular_data.py so this shouldn't be too bad.

jarrodmcc commented 7 years ago

I actually thought it might decrease more due to moving everything into decorated getters and setters. It was hard to imagine every line would be hit, but I will try to find the missing lines tomorrow and add some tests for them.

jarrodmcc commented 7 years ago

Don't accept this yet, it has a peculiar bug that was not caught by tests.

jarrodmcc commented 7 years ago

Okay I fixed that and added a test for it. We had no tests that loaded molecular data using only the file name (and no geom spec etc), so I added a line for that and fixed the issue that happened when we did.