Open
Description
I am not a fan of adding the generateDensityMatrix
flag to a ton of functions.
Unfortunately, C++ does not allow two functions that only differ in their return values. Otherwise it would be rather easy to get rid of this generateDensityMatrix
parameter, which is only relevant for density matrices.
One potential solution for this would be to refactor these methods in the following fashion:
template<class LeftOperandNode, class RightOperandNode, class ResultNode>
void multiply2(const const Edge<LeftOperandNode>& x, const Edge<RightOperandNode>& y, Edge<ResultNode>& result, Qubit var, Qubit start = 0) {
...
}
This would allow for specializations of Matrix * Matrix -> Matrix
and Matrix * Matrix -> Density Matrix
.
Originally posted by @burgholzer in cda-tum/dd_package#72 (comment)