MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / pec_error_mitigation

Method pec_error_mitigation

Core/QuantumCloud/QCloudMachine.cpp:459–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457
458
459std::vector<double> QCloudMachine::pec_error_mitigation(
460 QProg& prog,
461 int shots,
462 std::vector<std::string> expectations,
463 RealChipType chip_id,
464 std::string task_name)
465{
466 real_chip_task_validation(shots, prog);
467
468 //convert prog to originir
469 auto prog_str = convert_qprog_to_originir(prog, this);
470
471 QVec qubits;
472 std::vector<ClassicalCondition> cbit_vector;
473 auto qubits_num = prog.get_used_qubits(qubits);
474 auto cbits_num = prog.get_used_cbits(cbit_vector);
475
476 m_cloud_imp->object_init(qubits_num, cbits_num, prog_str, task_name);
477
478 try
479 {
480 std::vector<double> result;
481 m_cloud_imp->execute_error_mitigation(result, shots, chip_id, expectations, {}, EmMethod::PEC);
482 return result;
483 }
484 catch (const std::exception& e)
485 {
486 QCERR_AND_THROW(run_fail, e.what());
487 }
488}
489
490//read out
491std::map<std::string, double> QCloudMachine::read_out_error_mitigation(

Callers

nothing calls this directly

Calls 7

get_used_cbitsMethod · 0.80
get_used_qubitsMethod · 0.45
object_initMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected