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

Function getConjugateTranspose

tests/utils/linalg.cpp:291–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289
290
291qmatrix getConjugateTranspose(qmatrix m) {
292 DEMAND( m.size() > 0 );
293
294 // unlike most functions which assume qmatrix
295 // is square, this one cheekily handles when
296 // 'm' is non-square, since necessary for
297 // computing partial traces
298
299 qmatrix out(m[0].size(), qvector(m.size()));
300
301 for (size_t r=0; r<out.size(); r++)
302 for (size_t c=0; c<out[0].size(); c++)
303 out[r][c] = std::conj(m[c][r]);
304
305 return out;
306}
307
308
309qmatrix getPowerOfDiagonalMatrix(qmatrix m, qcomp p) {

Callers 5

applyReferenceOperatorFunction · 0.70
isApproxUnitaryFunction · 0.70
getPartialTraceFunction · 0.70
isApproxCPTPFunction · 0.70
SECTIONFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected