MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / reportKrausMap

Function reportKrausMap

quest/src/api/channels.cpp:467–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465
466
467extern "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}

Callers 7

demo_setKrausMapFunction · 0.85
demo_syncKrausMapFunction · 0.85
demo_setInlineKrausMapFunction · 0.85
demo_setKrausMapFunction · 0.85
demo_syncKrausMapFunction · 0.85

Calls 8

validate_krausMapFieldsFunction · 0.85
print_headerFunction · 0.85
print_elemsFunction · 0.85
print_oneFewerNewlinesFunction · 0.85

Tested by

no test coverage detected