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

Function demo_getInlinePauliStr

examples/isolated/initialising_paulis.cpp:23–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23void demo_getInlinePauliStr() {
24
25 reportStr("[demo_getInlinePauliStr]");
26
27 // can specify indices as {...} without temporary-array syntax
28 PauliStr a = getInlinePauliStr("XYZII", {4,3,2,1,0});
29 reportPauliStr(a);
30
31 // additionally accept 0-3 and lowercase
32 reportPauliStr(
33 getInlinePauliStr("0123ixyzIXYZ", {11,10,9,8, 7,6,5,4, 3,2,1,0})
34 );
35
36 // can specify arbitrary qubit indices of Paulis
37 reportPauliStr(
38 getInlinePauliStr("XXYYZZ", {5,50, 10,60, 30,40})
39 );
40}
41
42
43void demo_getPauliStr() {

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

reportStrFunction · 0.85
reportPauliStrFunction · 0.85

Tested by

no test coverage detected