src/report.cc
/*
     * writing out the circuits of the given kernels in qasm/bundles depending on whether cycles_valid for all kernels
     * - writing out in qasm writes the gates, one by one in order on separate lines and ignores the cycle attributes
     * - writing out as bundles writes the bundles, one by one in order on separate lines, each line representing a next cycle
     */
writing out the circuits of the given kernels in qasm/bundles depending on whether cycles_valid for all kernels
- writing out in qasm writes the gates, one by one in order on separate lines and ignores the cycle attributes
- writing out as bundles writes the bundles, one by one in order on separate lines, each line representing a next cycle
writing out the circuits of the given kernels in qasm / bundles depending on whether cycles_valid for all kernels - writing out in qasm writes the gates one by one in order on separate lines and ignores the cycle attributes - writing out as bundles writes the bundles one by one in order on separate lines each line representing a next cycle
void report_write_qasm(std::stringstream& fname, quantum_program* programp, const ql::quantum_platform& platform)
    {
        std::stringstream out_qasm;
        out_qasm << "version 1.0\n";
        out_qasm << "# this file has been automatically generated by the OpenQL compiler please do not modify it manually.\n";
        out_qasm << "qubits " << programp->qubit_count << "\n";
        bool    do_bundles = true;
        for(auto &kernel : programp->kernels)
        {
            do_bundles &= kernel.cycles_valid;
        }
        for(auto &kernel : programp->kernels)
        {
            if (do_bundles)
            {
                out_qasm << kernel.get_prologue();
                ql::ir::bundles_t bundles = ql::ir::bundler(kernel.c, platform.cycle_time);
                out_qasm << ql::ir::qasm(bundles);
                out_qasm << kernel.get_epilogue();
            }
            else
            {
                out_qasm << kernel.qasm();
            }
        }
        ql::utils::write_file(fname.str(), out_qasm.str());
    }
void report_write_qasm ( std :: stringstream & fname , quantum_program * programp , const ql :: quantum_platform & platform ) { std :: stringstream out_qasm ; out_qasm << " \n " ; out_qasm << " \n " ; out_qasm << " " << programp -> qubit_count << " \n " ; bool do_bundles = true ; for ( auto & kernel : programp -> kernels ) { do_bundles &= kernel . cycles_valid ; } for ( auto & kernel : programp -> kernels ) { if ( do_bundles ) { out_qasm << kernel . get_prologue ( ) ; ql :: ir :: bundles_t bundles = ql :: ir :: bundler ( kernel . c , platform . cycle_time ) ; out_qasm << ql :: ir :: qasm ( bundles ) ; out_qasm << kernel . get_epilogue ( ) ; } else { out_qasm << kernel . qasm ( ) ; } } ql :: utils :: write_file ( fname . str ( ) , out_qasm . str ( ) ) ; }
writing out the circuits of the given kernels in qasm/bundles depending on whether cycles_valid for all kernels
 - writing out in qasm writes the gates, one by one in order on separate lines and ignores the cycle attributes
 - writing out as bundles writes the bundles, one by one in order on separate lines, each line representing a next cycle
writing out the circuits of the given kernels in qasm / bundles depending on whether cycles_valid for all kernels - writing out in qasm writes the gates one by one in order on separate lines and ignores the cycle attributes - writing out as bundles writes the bundles one by one in order on separate lines each line representing a next cycle
// DOUT("... reporting report_write_qasm"); // DOUT("... reporting do_bundles=" << do_bundles); // DOUT("... reporting report_write_qasm [done]");