| 465 | |
| 466 | |
| 467 | extern "C" void reportKrausMap(KrausMap map) { |
| 468 | validate_krausMapFields(map, __func__); |
| 469 | validate_numReportedNewlinesAboveZero(__func__); // because trailing newline mandatory |
| 470 | |
| 471 | // pedantically demand that the map's SuperOP is GPU-synced, |
| 472 | // even though only the CPU Kraus operators are printed |
| 473 | validate_krausMapIsSynced(map, __func__); |
| 474 | |
| 475 | // determine memory costs (gauranteed not to overflow) |
| 476 | bool isDense = true; |
| 477 | int numNodes = 1; |
| 478 | size_t krausMem = mem_getLocalMatrixMemoryRequired(map.numQubits, isDense, numNodes) * map.numMatrices; |
| 479 | size_t superMem = mem_getLocalSuperOpMemoryRequired(map.superop.numQubits); |
| 480 | size_t strucMem = sizeof(map); |
| 481 | |
| 482 | // gauranteed not to overflow |
| 483 | size_t totalMem = krausMem + superMem + strucMem; |
| 484 | print_header(map, totalMem); |
| 485 | print_elems(map); |
| 486 | |
| 487 | // exclude mandatory newline above |
| 488 | print_oneFewerNewlines(); |
| 489 | } |
no test coverage detected