Hi Miles,
I am using your function to obtain the elements of a QDiagReal storage
auto func = [](QDiagReal const& d)
{
std::vector<double> spectrum;
for(auto& el : d.store) {
spectrum.push_back(el);
}
return spectrum;
};
with
auto spectrum = applyFunc(func,D.store());
I get the elements of the QDiagReal D, but information about the QN is lost. Is there a simply way to keep also track of the quantum numbers associated with the eigenvalues? For exampl, to get for each quantum number a corresponding list with its values.
For example, D has a structure like this
QDiagReal
1<In>QN({"Sz",2}), 1<Out>QN({"Sz",2})
(1,1) 0.1
2<In>QN({"Sz",0}), 2<Out>QN({"Sz",0})
(2,2) 0.2
(3,3) 0.3
1<In>QN({"Sz",-2}), 1<Out>QN({"Sz",-2})
(4,4) 0.4
and I would like to obtain the following list (vectors):
spectrum= [ 0.1, 0.2, 0.3, 0.4]
SZ_QN = [ -2 , 0, 0 , 2 ]
Thank you!