| 520 | } |
| 521 | |
| 522 | std::vector<double> QCloudMachine::zne_error_mitigation( |
| 523 | QProg& prog, |
| 524 | int shots, |
| 525 | std::vector<std::string> expectations, |
| 526 | std::vector<double> noise_strength, |
| 527 | RealChipType chip_id, |
| 528 | std::string task_name) |
| 529 | { |
| 530 | real_chip_task_validation(shots, prog); |
| 531 | |
| 532 | //convert prog to originir |
| 533 | auto prog_str = convert_qprog_to_originir(prog, this); |
| 534 | |
| 535 | QVec qubits; |
| 536 | std::vector<ClassicalCondition> cbit_vector; |
| 537 | auto qubits_num = prog.get_used_qubits(qubits); |
| 538 | auto cbits_num = prog.get_used_cbits(cbit_vector); |
| 539 | |
| 540 | m_cloud_imp->object_init(qubits_num, cbits_num, prog_str, task_name); |
| 541 | |
| 542 | try |
| 543 | { |
| 544 | std::vector<double> result; |
| 545 | m_cloud_imp->execute_error_mitigation(result, shots, chip_id, expectations, noise_strength, EmMethod::ZNE); |
| 546 | return result; |
| 547 | } |
| 548 | catch (const std::exception& e) |
| 549 | { |
| 550 | QCERR_AND_THROW(run_fail, e.what()); |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | std::vector<std::map<std::string, double>> QCloudMachine::batch_real_chip_measure( |
| 555 | std::vector<QProg>& prog_array, |