Closed jarrodmcc closed 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.
Good point @jarrodmcc is in charge of helping us fix this
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