src/report.cc
/*
     * reports only the total statistics of the circuits of the given kernels
     */
reports only the total statistics of the circuits of the given kernels
reports only the total statistics of the circuits of the given kernels
void report_totals_statistics(std::ofstream&           ofs,
                std::vector<quantum_kernel>&    kernels,
                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);
        size_t total_circuit_latency = 0;
        size_t total_classical_operations = 0;
        size_t total_quantum_gates = 0;
        size_t total_non_single_qubit_gates= 0;
        for (auto& k : kernels)
        {
            get_qubit_usecount(k.c, platform, usecount);
            total_circuit_latency += get_circuit_latency(k.c, platform);
            total_classical_operations += get_classical_operations_count(k.c, platform);
            total_quantum_gates += get_quantum_gates_count(k.c, platform);
            total_non_single_qubit_gates += get_non_single_qubit_quantum_gates_count(k.c, platform);
        }
        size_t qubits_used = 0; for (auto v: usecount) { if (v != 0) { qubits_used++; } } 
        ofs << "\n";
        ofs << comment_prefix << "Total circuit_latency: " << total_circuit_latency << "\n";
        ofs << comment_prefix << "Total no. of quantum gates: " << total_quantum_gates << "\n";
        ofs << comment_prefix << "Total no. of non single qubit gates: " << total_non_single_qubit_gates << "\n";
        ofs << comment_prefix << "Total no. of classical operations: " << total_classical_operations << "\n";
        ofs << comment_prefix << "Qubits used: " << qubits_used << "\n";
        ofs << comment_prefix << "No. kernels: " << kernels.size() << "\n";
    }
void report_totals_statistics ( std :: ofstream & ofs , std :: vector < quantum_kernel > & kernels , 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 ) ; size_t total_circuit_latency = 0 ; size_t total_classical_operations = 0 ; size_t total_quantum_gates = 0 ; size_t total_non_single_qubit_gates = 0 ; for ( auto & k : kernels ) { get_qubit_usecount ( k . c , platform , usecount ) ; total_circuit_latency += get_circuit_latency ( k . c , platform ) ; total_classical_operations += get_classical_operations_count ( k . c , platform ) ; total_quantum_gates += get_quantum_gates_count ( k . c , platform ) ; total_non_single_qubit_gates += get_non_single_qubit_quantum_gates_count ( k . c , platform ) ; } size_t qubits_used = 0 ; for ( auto v : usecount ) { if ( v != 0 ) { qubits_used ++ ; } } ofs << " \n " ; ofs << comment_prefix << " " << total_circuit_latency << " \n " ; ofs << comment_prefix << " " << total_quantum_gates << " \n " ; ofs << comment_prefix << " " << total_non_single_qubit_gates << " \n " ; ofs << comment_prefix << " " << total_classical_operations << " \n " ; ofs << comment_prefix << " " << qubits_used << " \n " ; ofs << comment_prefix << " " << kernels . size ( ) << " \n " ; }
reports only the total statistics of the circuits of the given kernels
reports only the total statistics of the circuits of the given kernels
// DOUT("... reporting report_totals_statistics"); // totals reporting, collect info from all kernels // report totals // DOUT("... reporting report_totals_statistics [done]");