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

Function demo_createPauliStrSumFromFile

examples/isolated/initialising_paulis.cpp:169–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168
169void demo_createPauliStrSumFromFile() {
170
171 reportStr("[demo_createPauliStrSumFromFile]");
172
173 std::string fn = "test.txt";
174
175 // file contents can be identical to createInlinePauliStrSum input
176 if (getQuESTEnv().rank == 0) {
177 std::ofstream file;
178 file.open(fn);
179 file << R"(
180 + 5E2-1i XYZ
181 - 1E-50i IXY
182 + 1 - 6E-5i IIX
183 0 III
184 5. IXX
185 .5 ZYX
186 )";
187 file.close();
188 }
189 syncQuESTEnv();
190
191 PauliStrSum a = createPauliStrSumFromFile(fn);
192 reportPauliStrSum(a);
193 destroyPauliStrSum(a);
194}
195
196
197void demo_createPauliStrSumFromReversedFile() {

Callers 1

mainFunction · 0.70

Calls 6

reportStrFunction · 0.85
getQuESTEnvFunction · 0.85
syncQuESTEnvFunction · 0.85
reportPauliStrSumFunction · 0.85
destroyPauliStrSumFunction · 0.85

Tested by

no test coverage detected