| 167 | |
| 168 | |
| 169 | void 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 | |
| 197 | void demo_createPauliStrSumFromReversedFile() { |
no test coverage detected