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

Function assertQuregNotDistributedOverTooManyNodes

quest/src/core/validation.cpp:1603–1618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1601}
1602
1603void assertQuregNotDistributedOverTooManyNodes(int numQubits, int isDensMatr, int isDistrib, QuESTEnv env, const char* caller) {
1604
1605 // only validate when distribution is forced (auto-deployer will never over-distribute)
1606 if (isDistrib != 1)
1607 return;
1608
1609 // make message specific to statevector or density matrix
1610 string msg = (isDensMatr)? report::NEW_DISTRIB_DENSMATR_QUREG_HAS_TOO_FEW_AMPS : report::NEW_DISTRIB_STATEVEC_QUREG_HAS_TOO_FEW_AMPS;
1611 tokenSubs vars = {
1612 {"${NUM_QUBITS}", numQubits},
1613 {"${NUM_NODES}", env.numNodes},
1614 {"${MIN_QUBITS}", std::floor(std::log2(env.numNodes))}};
1615
1616 int minQubits = mem_getMinNumQubitsForDistribution(env.numNodes);
1617 assertThat(numQubits >= minQubits, msg, vars, caller);
1618}
1619
1620void assertQuregFitsInCpuMem(int numQubits, int isDensMatr, int isDistrib, QuESTEnv env, const char* caller) {
1621

Callers 1

validate_newQuregParamsFunction · 0.85

Calls 2

assertThatFunction · 0.85

Tested by

no test coverage detected