| 265 | } |
| 266 | |
| 267 | int util_getRankContainingIndex(Qureg qureg, qindex globalInd) { |
| 268 | |
| 269 | // when not distributed, root contains the index (as incidentally do all nodes) |
| 270 | if (!qureg.isDistributed) |
| 271 | return ROOT_RANK; |
| 272 | |
| 273 | // accepts flat density matrix index too |
| 274 | return globalInd / qureg.numAmpsPerNode; // floors |
| 275 | } |
| 276 | int util_getRankContainingIndex(FullStateDiagMatr matr, qindex globalInd) { |
| 277 | |
| 278 | // when not distributed, root contains the index (as incidentally do all nodes) |
no outgoing calls
no test coverage detected