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

Function mem_canPauliStrSumFitInMemory

quest/src/core/memory.cpp:391–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389
390
391bool mem_canPauliStrSumFitInMemory(qindex numTerms, qindex numBytesPerNode) {
392
393 // awkwardly arranged to avoid overflow when numTerms is too large
394 size_t numBytesPerTerm = sizeof(PauliStr) + sizeof(qcomp);
395 qindex maxNumTerms = numBytesPerNode / numBytesPerTerm; // floors
396 return numTerms <= maxNumTerms;
397}
398
399
400

Calls

no outgoing calls

Tested by

no test coverage detected