| 389 | |
| 390 | |
| 391 | bool 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 |
no outgoing calls
no test coverage detected