src/report.cc
/*
     * report statistics of the circuit of the given kernel
     */
report statistics of the circuit of the given kernel
report statistics of the circuit of the given kernel
void report_kernel_statistics(std::ofstream&           ofs,
                quantum_kernel&                 k,
                const ql::quantum_platform&     platform,
                const std::string               comment_prefix
               )
    {
        if( ql::options::get("write_report_files") != "yes")
        {
            return;
        }
        std::vector<size_t> usecount;
        usecount.resize(platform.qubit_number, 0);
        get_qubit_usecount(k.c, platform, usecount);
        size_t qubits_used = 0; for (auto v: usecount) { if (v != 0) { qubits_used++; } } 
        std::vector<size_t> usedcyclecount;
        usedcyclecount.resize(platform.qubit_number, 0);
        get_qubit_usedcyclecount(k.c, platform, usedcyclecount);
        size_t  circuit_latency = get_circuit_latency(k.c, platform);
        ofs << comment_prefix << "kernel: " << k.name << "\n";
        ofs << comment_prefix << "----- circuit_latency: " << circuit_latency << "\n";
        ofs << comment_prefix << "----- quantum gates: " << get_quantum_gates_count(k.c, platform) << "\n";
        ofs << comment_prefix << "----- non single qubit gates: " << get_non_single_qubit_quantum_gates_count(k.c, platform) << "\n";
        ofs << comment_prefix << "----- classical operations: " << get_classical_operations_count(k.c, platform) << "\n";
        ofs << comment_prefix << "----- qubits used: " << qubits_used << "\n";
        ofs << comment_prefix << "----- qubit cycles use:" << ql::utils::to_string(usedcyclecount) << "\n";
    }
void report_kernel_statistics ( std :: ofstream & ofs , quantum_kernel & k , const ql :: quantum_platform & platform , const std :: string comment_prefix ) { if ( ql :: options :: get ( " " ) != " " ) { return ; } std :: vector < size_t > usecount ; usecount . resize ( platform . qubit_number , 0 ) ; get_qubit_usecount ( k . c , platform , usecount ) ; size_t qubits_used = 0 ; for ( auto v : usecount ) { if ( v != 0 ) { qubits_used ++ ; } } std :: vector < size_t > usedcyclecount ; usedcyclecount . resize ( platform . qubit_number , 0 ) ; get_qubit_usedcyclecount ( k . c , platform , usedcyclecount ) ; size_t circuit_latency = get_circuit_latency ( k . c , platform ) ; ofs << comment_prefix << " " << k . name << " \n " ; ofs << comment_prefix << " " << circuit_latency << " \n " ; ofs << comment_prefix << " " << get_quantum_gates_count ( k . c , platform ) << " \n " ; ofs << comment_prefix << " " << get_non_single_qubit_quantum_gates_count ( k . c , platform ) << " \n " ; ofs << comment_prefix << " " << get_classical_operations_count ( k . c , platform ) << " \n " ; ofs << comment_prefix << " " << qubits_used << " \n " ; ofs << comment_prefix << " " << ql :: utils :: to_string ( usedcyclecount ) << " \n " ; }
report statistics of the circuit of the given kernel
report statistics of the circuit of the given kernel
// DOUT("... reporting report_kernel_statistics"); // DOUT("... reporting report_kernel_statistics [done]");