ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 25 forks source link

fix memory management #9

Open dlyongemallo opened 5 years ago

dlyongemallo commented 5 years ago

Pointer ownership should be clarified using, e.g., std::unique_ptr. Right now, scratch pointers are being passed around all over the place, and it's not clear what the chain of ownership is. (The pointers are also just NULLed at the end, without any deletes.)