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

Method zne_error_mitigation

Core/QuantumCloud/QCloudMachine.cpp:522–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522std::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
554std::vector<std::map<std::string, double>> QCloudMachine::batch_real_chip_measure(
555 std::vector<QProg>& prog_array,

Callers 1

test_zneFunction · 0.45

Calls 7

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

Tested by 1

test_zneFunction · 0.36