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

Function getOuterProduct

tests/utils/linalg.cpp:220–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220qmatrix getOuterProduct(qvector ket, qvector bra) {
221 DEMAND( bra.size() == ket.size() );
222
223 qmatrix out = getZeroMatrix(bra.size());
224
225 for (size_t i=0; i<ket.size(); i++)
226 for (size_t j=0; j<ket.size(); j++)
227 out[i][j] = ket[i] * std::conj(bra[j]);
228
229 return out;
230}
231
232
233

Callers 7

getRandomDensityMatrixFunction · 0.85
getReferencePurityFunction · 0.85
getMixtureFunction · 0.85
SECTIONFunction · 0.85
SECTIONFunction · 0.85
SECTIONFunction · 0.85

Calls 1

getZeroMatrixFunction · 0.70

Tested by

no test coverage detected