This PR moves the unitary decomposition implementation within unitary.h into its own compile unit, to prevent its dependencies (notably Eigen) from having to be parsed/template-expanded for every other compile unit as well. unitary.cc still takes a while to compile, but using incremental compilation this should be less of a problem now, and a parallel build no longer brings my 32GB RAM workstation to its knees. I'm not sure why Eigen is compiling this slowly, requires 4GB of RAM during compilation, and outputs 36MiB of code into libql.a, but figuring that out probably requires looking at the actual algorithm implementation, which is greek to me.
To the best of my ability, I could only find references to size() and decompose() outside of the unitary class itself, so I only copied those into the new wrapper class (the wrapper is more-or-less necessary to prevent the Eigen includes from needing to be in the header file for the private Eigen::Matrix member). I left the class member variables basically as they were.
The only test I could find for unitary decomposition was unitary.py, which seems to be as broken as it was before these changes, I'm guessing because of the other things going on in modular (it's not writing output files when compile() is called).
This PR moves the unitary decomposition implementation within unitary.h into its own compile unit, to prevent its dependencies (notably Eigen) from having to be parsed/template-expanded for every other compile unit as well. unitary.cc still takes a while to compile, but using incremental compilation this should be less of a problem now, and a parallel build no longer brings my 32GB RAM workstation to its knees. I'm not sure why Eigen is compiling this slowly, requires 4GB of RAM during compilation, and outputs 36MiB of code into libql.a, but figuring that out probably requires looking at the actual algorithm implementation, which is greek to me.
To the best of my ability, I could only find references to size() and decompose() outside of the unitary class itself, so I only copied those into the new wrapper class (the wrapper is more-or-less necessary to prevent the Eigen includes from needing to be in the header file for the private Eigen::Matrix member). I left the class member variables basically as they were.
The only test I could find for unitary decomposition was unitary.py, which seems to be as broken as it was before these changes, I'm guessing because of the other things going on in modular (it's not writing output files when compile() is called).