babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

Pervasive use of deepcopy #61

Closed jarrodmcc closed 7 years ago

jarrodmcc commented 7 years ago

Somehow the use of deepcopy on modest data structures seems to account for a bottleneck in some routines, though not in overall performance of something like a 20 qubit VQE test. As a possible low-priority optimization, consider specializing the copy and deep copy of relevant classes. See here for a discussion of a similar issue:

http://stackoverflow.com/questions/24756712/deepcopy-is-extremely-slow

thomashaener commented 7 years ago

Yes, this is something I also noticed when trying to optimize. In the end, reducing the number of deepcopy-calls resulted in a speedup of 4x, so specializing deepcopy & copy may help a lot.

babbush commented 7 years ago

Good point @jarrodmcc is in charge of helping us fix this