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

Function mem_getMaxNumQuregQubitsBeforeIndexOverflow

quest/src/core/memory.cpp:98–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98int mem_getMaxNumQuregQubitsBeforeIndexOverflow(bool isDensityMatrix) {
99
100 // cannot store more amplitudes than can be counted by the qindex type (even when distributed)
101 qindex maxNumAmps = std::numeric_limits<qindex>::max();
102 int maxNumQubits = std::floor(std::log2(maxNumAmps) / static_cast<qreal>((isDensityMatrix)? 2 : 1));
103 return maxNumQubits;
104}
105
106int mem_getMaxNumMatrixQubitsBeforeIndexOverflow(bool isDenseMatrix) {
107

Calls

no outgoing calls

Tested by

no test coverage detected