| 327 | } |
| 328 | |
| 329 | QMatrix getExponentialOfPauliMatrix(qreal angle, QMatrix a) { |
| 330 | QMatrix iden = getIdentityMatrix(a.size()); |
| 331 | QMatrix expo = (cos(angle/2) * iden) + ((qcomp) -1i * sin(angle/2) * a); |
| 332 | return expo; |
| 333 | } |
| 334 | |
| 335 | void setSubMatrix(QMatrix &dest, QMatrix sub, size_t r, size_t c) { |
| 336 | DEMAND( sub.size() + r <= dest.size() ); |
no test coverage detected