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

Function setRandomPauliSum

tests/deprecated/test_utilities.cpp:1370–1377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1368}
1369
1370void setRandomPauliSum(qreal* coeffs, pauliOpType* codes, int numQubits, int numTerms) {
1371 int i=0;
1372 for (int n=0; n<numTerms; n++) {
1373 coeffs[n] = getRandomReal(-5, 5);
1374 for (int q=0; q<numQubits; q++)
1375 codes[i++] = (pauliOpType) getRandomInt(0,4);
1376 }
1377}
1378
1379void setRandomPauliSum(PauliHamil hamil, int numQubits) {
1380

Callers 1

Calls 3

getRandomRealFunction · 0.70
getRandomIntFunction · 0.70
getRandomPauliStrFunction · 0.70

Tested by

no test coverage detected