| 1180 | // T can be Qureg (.isDistributed=1, .isDensityMatrix=0) or FullStateDiagMatr |
| 1181 | template <class T> |
| 1182 | void populateDistributedVectorRowLabels(vector<string> &upperRowLabels, vector<string> &lowerRowLabels, T obj, MatrixQuadrantInds inds) { |
| 1183 | |
| 1184 | // these might already contain kets; resize preserves existing elems |
| 1185 | upperRowLabels.resize(inds.numUpperLeftRows); |
| 1186 | lowerRowLabels.resize(inds.numLowerLeftRows); |
| 1187 | |
| 1188 | // to ensure rank aligns nicely, pad existing labels with the widest elem (which is the last one) |
| 1189 | int len = (lowerRowLabels.empty()? upperRowLabels : lowerRowLabels).back().length(); |
| 1190 | for (auto &label : upperRowLabels) label += string(len - label.length(), MATRIX_SPACE_CHAR); |
| 1191 | for (auto &label : lowerRowLabels) label += string(len - label.length(), MATRIX_SPACE_CHAR); |
| 1192 | |
| 1193 | int lastRank = -1; |
| 1194 | setRowLabelsToRanks(upperRowLabels, lastRank, inds.upperStartRow, obj); |
| 1195 | setRowLabelsToRanks(lowerRowLabels, lastRank, inds.lowerStartRow, obj); |
| 1196 | } |
| 1197 | |
| 1198 | |
| 1199 | // T can be any 1D type, e.g. Qureg (.isDensityMatrix=0), FullStateDiagMatr, DiagMatr/1/2 |
no test coverage detected