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

Function getPauliMatrix

tests/utils/qmatrix.cpp:52–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52qmatrix getPauliMatrix(int id) {
53 DEMAND( id >= 0 );
54 DEMAND( id <= 3 );
55
56 if (id == 0)
57 return {{1 ,0}, {0, 1}};
58
59 if (id == 1)
60 return {{0, 1}, {1, 0}};
61
62 if (id == 2)
63 return {{0, -1_i}, {1_i, 0}};
64
65 if (id == 3)
66 return {{1, 0}, {0, -1}};
67
68 // unreachable
69 return {{-1}};
70}
71
72
73/*

Callers 4

getMatrixFunction · 0.85
operations.cppFile · 0.85
SECTIONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected