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

Optimize reorderings by decreasing number of unnecessary copying #32

Open benjaminvillalonga opened 5 years ago

benjaminvillalonga commented 5 years ago

NOT A PRIORITY. Right now general reorderings are split in three simpler ones. Every one of the simpler reorderings copies data from the tensor to scratch and back, so that each of the reorderings is complete and puts the data in the tensor data array. However, each simple reordering doesn't have to be complete in this sense, but only the end result of the three (or fewer, sometimes) simple reorderings. For this reason, a few copying parts of the reordering can be neglected, which can speed it up up to a 20-30% I estimate.