| 217 | } |
| 218 | |
| 219 | static bool compare_map_result(map<string, size_t> result1, map<string, size_t> result2 , int shots) |
| 220 | { |
| 221 | for (auto val : result1) |
| 222 | { |
| 223 | auto iter = result2.find(val.first); |
| 224 | |
| 225 | if (iter == result2.end()) |
| 226 | return false; |
| 227 | |
| 228 | if (1e-2 < std::fabs((double)(((int)val.second - (int)iter->second) / shots))) |
| 229 | return false; |
| 230 | } |
| 231 | |
| 232 | return true; |
| 233 | } |
| 234 | |
| 235 | static bool compare_probs_result(const prob_vec& result1,const prob_vec& result2) |
| 236 | { |