| 254 | } |
| 255 | |
| 256 | std::pair<bool, const ExecutionResult &> |
| 257 | sample_result::try_retrieve_result(const std::string ®isterName) const { |
| 258 | auto iter = sampleResults.find(registerName); |
| 259 | if (iter == sampleResults.end()) { |
| 260 | auto invalid_char = registerName.find_first_not_of("XYZI"); |
| 261 | if (invalid_char == std::string::npos) { |
| 262 | auto spin = spin_op::from_word(registerName); |
| 263 | iter = sampleResults.find(spin.canonicalize().get_term_id()); |
| 264 | if (iter != sampleResults.end()) |
| 265 | return {true, iter->second}; |
| 266 | } |
| 267 | return {false, ExecutionResult()}; |
| 268 | } |
| 269 | return {true, iter->second}; |
| 270 | } |
| 271 | |
| 272 | const cudaq::ExecutionResult & |
| 273 | sample_result::retrieve_result(const std::string ®isterName) const { |
nothing calls this directly
no test coverage detected