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

Function getExponentialOfNormalisedPauliVector

tests/utils/linalg.cpp:357–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355
356
357qmatrix getExponentialOfNormalisedPauliVector(qreal arg, qreal x, qreal y, qreal z) {
358
359 // exp(-arg/2 i [x^ X + y^ Y + z^ Z])
360 qreal n = std::sqrt(x*x + y*y + z*z);
361 x /= n;
362 y /= n;
363 z /= n;
364
365 qmatrix id = getIdentityMatrix(2);
366 qmatrix out = std::cos(arg/2)*id - 1_i*std::sin(arg/2)*(
367 x * getPauliMatrix(1) +
368 y * getPauliMatrix(2) +
369 z * getPauliMatrix(3));
370
371 return out;
372}
373
374
375qmatrix getOrthonormalisedRows(qmatrix matr) {

Callers 1

getReferenceMatrixFunction · 0.85

Calls 2

getPauliMatrixFunction · 0.85
getIdentityMatrixFunction · 0.70

Tested by

no test coverage detected