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

Function getRandomDiagonalMatrix

tests/utils/random.cpp:279–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277
278
279qmatrix getRandomDiagonalMatrix(size_t dim) {
280
281 qmatrix out = getZeroMatrix(dim);
282
283 for (size_t i=0; i<dim; i++)
284 out[i][i] = getRandomComplex();
285
286 return out;
287}
288
289
290

Callers 3

SECTIONFunction · 0.85
SECTIONFunction · 0.85
SECTIONFunction · 0.85

Calls 2

getZeroMatrixFunction · 0.70
getRandomComplexFunction · 0.70

Tested by

no test coverage detected