| 346 | |
| 347 | |
| 348 | qmatrix getExponentialOfPauliMatrix(qcomp arg, qmatrix m) { |
| 349 | |
| 350 | // exp(-i arg/2 m) where m = prod(paulis) |
| 351 | qmatrix id = getIdentityMatrix(m.size()); |
| 352 | qmatrix out = std::cos(arg/2)*id - 1_i*std::sin(arg/2)*m; |
| 353 | return out; |
| 354 | } |
| 355 | |
| 356 | |
| 357 | qmatrix getExponentialOfNormalisedPauliVector(qreal arg, qreal x, qreal y, qreal z) { |
no test coverage detected