| 289 | |
| 290 | |
| 291 | qmatrix 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 | |
| 309 | qmatrix getPowerOfDiagonalMatrix(qmatrix m, qcomp p) { |
no outgoing calls
no test coverage detected