{"id":"7aeaa8f2-bf89-46cc-9e3d-e22f8ff3f9b9","arxiv_id":"2505.12853","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":4.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":0,"one_line_summary":"The authors introduce metrics and seven optimization routines for Quil hybrid programs, showing improvements on magic state distillation and a modified iterative phase estimation program.","lead":"This paper proposes seven compiler-style optimizations and three metrics for hybrid quantum-classical programs written in Quil, then tests them on four algorithms. It reports modest improvements on two of the four, with the largest gains coming from an iterative phase estimation program that was modified into Quil code the language forbids.","discovery_kind":"new_method","skeptic_critique":{"model":"deepseek-v4-flash","headline":"IPE improvements are computed on an invalid Quil program: the analysis replaces a conditional jump with an ADD of a BIT to a REAL (Sec. 4.2, Listings 1.2–1.3), so the reported 22%/7.3%/9.1% gains may not transfer to executable code.","rationale":"The reader and I identify the same load-bearing concern. The paper explicitly admits that Listing 1.3 violates Quil semantics, and all IPE analysis, optimization, and metric evaluation use this invalid variant. The reported IPE improvements are therefore not established for executable Quil code, and the claimed 22%/7.3%/9.1% gains could be artifacts of removing conditional control flow. This concern is concrete and directly testable: re-running the pipeline on the valid Listing 1.2 version would settle it. The magic-state-distillation results are not affected by this issue, so the paper is not wholly unsupported, but its strongest quantified claim needs re-validation. The reader's conditional verdict remains the correct disposition; no additional independent fatal flaw was identified. The novelty claim about 'no previous work' is an overstatement that should be tempered, but it is a literature-survey issue rather than a correctness risk in the central optimization claim.","tokens_in":17152,"tokens_out":7189,"duration_ms":77856,"concrete_test":"Re-run the complete optimization pipeline (constant propagation → constant folding, live-variable analysis → dead code elimination, hybrid-dependency finding → instruction reordering, hybrid-dependency finding → latest possible quantum execution) on the executable IPE version containing Listing 1.2 instead of Listing 1.3, with all other IPE control flow left intact. Recompute wall time, instruction number, QIN, and QCT for the optimized output and compare with Tables 3 and 4. If the best values match (35, 51, 30), the IPE claim survives; if they do not, the headline IPE improvements must be restated or removed.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The central experimental support for the claimed optimizations is the IPE result: wall time reduced by 22%, instruction number by 7.3%, and QCT by 9.1% (Sec. 7). Section 4.2 states that the IPE code used for DDG creation and optimization replaces the executable conditional-add construction (Listing 1.2: JUMP-UNLESS @noadd1 lastMeasurement[0]; ADD param_no_pi[0] 1) with Listing 1.3: ADD param_no_pi[0] lastMeasurement[0], while also stating that 'Quil's semantic forbids this construction.' Because the metrics, DDGs, and optimization passes all operate on Listing 1.3, the reported IPE gains are demonstrated only for a program that cannot be executed as Quil. The asserted 'same logical effect' is not enough: the optimizer may be exploiting the removal of control flow, for example by turning a multi-DDG problem into a single DDG and changing live-variable and dead-code results, while the executable IPE would still contain the conditional branch. This is load-bearing because the IPE example is the only algorithm with improvements in all three headline metrics; if the gains vanish when the valid conditional code is optimized, the central claim is substantially weakened. The magic-state-distillation improvement is not affected by this specific issue, which is why the paper is conditionally salvageable rather than unsupported.","agreement_with_reader":"agree"},"referee_report":{"model":"deepseek-v4-flash","summary":"The paper introduces a set of seven optimization routines and three static metrics (wall time, quantum instruction number, and quantum calculation time) for hybrid quantum-classical programs written in Quil. The routines adapt classical compiler passes (constant propagation, live-variable analysis, constant folding, dead code elimination) and add hybrid-specific passes (finding hybrid dependencies, instruction reordering, latest possible quantum execution). The authors implement these in a tool, apply them to four real-time hybrid algorithms (quantum teleportation, magic state distillation, repeat-until-success, and iterative phase estimation), and report metric improvements for magic state distillation and IPE, with no improvement for the other two.","tokens_in":17486,"tokens_out":5715,"duration_ms":60751,"significance":"If the results hold, the paper offers a useful starting point for hybrid quantum-classical compilation: it defines concrete metrics, adapts classical analyses to a heterogeneous setting, and provides an open-source implementation. The paper is honest about limitations of the execution model and about the fact that only two of four benchmarks improve. However, the main quantitative support for the headline claim is the IPE evaluation, and that evaluation is performed on a Quil program that the paper itself states is forbidden by Quil semantics. This makes the IPE improvements unvalidated against executable code. The magic state distillation improvement is not affected by this specific defect, but it is a weaker result than the IPE case. The metrics and optimization framework are clearly a proof of concept, and the paper should be judged as such.","major_comments":[{"comment":"The IPE evaluation is load-bearing for the paper's central claim, but it is carried out on a program that is not valid Quil. Section 4.2 states that the executable IPE uses Listing 1.2 (JUMP-UNLESS plus ADD) because 'Quil's semantic does not allow adding a bit-value to a real value,' and that the version used for DDG creation and optimization is Listing 1.3 (ADD param_no_pi[0] lastMeasurement[0]), which the paper says 'Quil's semantic forbids.' All IPE results in Section 7 (wall time reduced by 22%, instruction number by 7.3%, QCT by 9.1%) are computed on Listing 1.3. This replacement is not a benign syntactic change: Listing 1.2 contains a conditional branch and hence, under the paper's own DDG construction (Section 4.2), yields multiple DDGs and imposes live-variable constraints at DDG boundaries, whereas Listing 1.3 is a straight-line program with a single DDG. The optimizer may therefore be exploiting the removal of control flow rather than improving the executable IPE. The authors need to either (a) re-run the optimization and metric evaluation on the valid Listing 1.2 code, or (b) prove a semantics-preserving, Quil-valid transformation from Listing 1.2 to Listing 1.3 and show that the reported metrics are invariant under it. Without this, the IPE improvements are not established.","section":"Section 4.2 and Section 7, Tables 3–4"},{"comment":"The conclusion states that the operations 'demonstrated that these operations can indeed optimize programs based on our proposed metrics,' but Table 3 shows no improvements for two of the four evaluated programs (quantum teleportation and repeat-until-success), and the only algorithm with improvements in all three headline metrics is IPE, whose evaluation is invalid for the reason given above. The claim should be qualified to the specific programs that improve, and it should be supported by results for valid Quil code. Otherwise the abstract's statement that 'our optimizations improve programs according to our metrics' overstates what the evaluation actually shows.","section":"Section 9 and Section 7, Table 3"}],"minor_comments":[{"comment":"The text uses 'semantic' instead of 'semantics' in two places ('Quil's semantic does not allow' and 'Quil's semantic forbids this construction'). Please correct the wording.","section":"Section 4.2, Listings 1.2 and 1.3"},{"comment":"The text says 'the number of hybrid instruction after the last hybrid instruction nq after,' but the equation and context indicate that this should be the number of quantum instructions after the last hybrid instruction. Additionally, the statement that 'a reasonable program has no quantum instructions after the last hybrid instruction' is contradicted by the example in Figure 5, which has nq after = 1.","section":"Section 5.3, Eq. (1) and Figure 5"},{"comment":"Section 5 says 'The results are given in Section 6,' but the evaluation results appear in Section 7. Please correct the cross-reference.","section":"Section 5 and Section 7"},{"comment":"The text says 'we do this 500 times for each algorithm and apply 50 optimization operations every time,' then states 'Which means we did 25 random draws per optimization routine.' With four optimization routines, 25 draws each gives 100 total draws, not 500; please clarify the randomization procedure and how the 500 runs relate to the four routines.","section":"Section 7, random optimization procedure"},{"comment":"The sentence 'The QIN has never been improved' is not reflected in Table 3, which omits the QIN row entirely. Please state explicitly in the table caption or text that QIN results are omitted because no improvement was observed.","section":"Section 7, Table 3"},{"comment":"The sentence 'We will optimizie the analyzed Quil programs in Section 7' contains a typo: 'optimizie' should be 'optimize'.","section":"Section 4, first paragraph"}],"recommendation":"major_revision","confidential_remarks":"The core issue is the invalid Quil program used for IPE evaluation. If the authors can re-run the evaluation on executable IPE code, or rigorously justify the equivalence of the simplified program, the paper may be publishable as a proof-of-concept contribution. The magic state distillation results and the framework itself are salvageable. I would also recommend that the authors moderate the novelty claim of being the first to optimize hybrid quantum programs, since the related-work discussion does not deeply compare with existing hybrid frameworks such as Quingo in terms of optimization support."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Remme et al. do something genuinely useful: they take textbook compiler analyses and transformations and work through what they mean for hybrid Quil programs, and they ship an implementation. The paper is clearly written, the background on Quil is accurate enough, and the idea of static metrics for hybrid programs (wall time, QIN, QCT) is a reasonable starting point even if they are crude. Credit where due: the adaptation of constant propagation to Pauli basis states and the argument for why live-variable analysis works despite entanglement are thoughtful. The evaluation on four benchmark algorithms is honest in reporting that two of them see no improvement.\n\nNow the load-bearing problem. The IPE results — the only place where all three metrics improve — are obtained on a rewritten program that uses ADD BIT to REAL, which the authors explicitly state Quil forbids (Listing 1.3 vs 1.2). They justify this by saying it has the same logical effect, but that is not sufficient. The optimization passes operate on the data-dependence graph of the invalid version, which has no conditional jump. Removing that control flow changes the DDG structure, the live/dead analysis, and the instruction reordering. The reported 22% wall-time reduction may be an artifact of optimizing a different, simplified program. The stress-test note gets this right. This needs to be re-run on the executable version or with a proper type conversion, and the paper should report both numbers.\n\nSecond issue is the novelty claim. \"No previous work on optimization of hybrid code\" is too strong. The related work section surveys quantum circuit optimization fairly, but dynamic circuit compilation and control-flow-aware QPU scheduling exist in other frameworks. A more careful claim like \"no direct application of these classical passes to Quil\" would be accurate and still useful.\n\nMinor: the execution model (one unit per instruction, zero latency) is acknowledged as idealized, but it makes the QCT metric close to a counting exercise. The three metrics are also the optimization targets, so improvement is partly by construction — the paper should say this more directly. No machine-checked proofs are provided for the passes, which would matter for a compiler, but for a proof of concept it is acceptable.\n\nWho this is for: people working on hybrid quantum-classical compiler passes will want it as a starting point. It deserves a serious referee with the IPE issue fixed and the novelty claim tempered. As it stands, I would not cite the IPE numbers.","headline":"The paper's headline IPE improvement is measured on a Quil program the authors admit is invalid, which makes the central quantitative claim untrustworthy even though the overall direction is sensible.","tokens_in":17935,"tokens_out":1797,"would_cite":false,"duration_ms":18074,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"deepseek-v4-flash","headline":"This paper claims that hybrid quantum-classical Quil programs can be statically optimized by seven compiler routines evaluated with three new metrics, cutting iterative phase estimation wall time by 22 percent and magic state distillation…","keywords":["hybrid quantum-classical computing","Quil","compiler optimization","control-flow analysis","data-dependence graph","static metrics","wall time","quantum calculation time"],"falsifier":"Run the optimized IPE program on a Quil-compliant executor that rejects ADD of a BIT to a REAL: if the program fails to load, or if running the legal conditional-jump version under the same metrics yields no reduction in wall time, instruction count, or quantum calculation time, the central improvement claim is falsified.","tokens_in":16959,"feed_emoji":"⚛️","tokens_out":4744,"duration_ms":47398,"temperature":0.7,"pith_summary":"Quantum computers in real-time hybrid systems do classical work between quantum gates, and the paper argues that this hybrid code, not just the quantum circuit, can and should be optimized. It introduces seven optimization routines and three static metrics for Quil programs: wall time, quantum instruction number, and quantum calculation time. Applying random sequences of these routines to four real-time algorithms, the paper reports reductions in iterative phase estimation's wall time of 22 percent and reductions in magic state distillation's wall time and quantum calculation time of 14 percent. If the approach holds, compiler writers gain a concrete starting point for optimizing the classical-quantum boundary in near-real-time algorithms.","feed_headline":"Optimizing hybrid quantum code: 22% faster phase estimation","feed_subtitle":"Seven compiler passes and three metrics shrink wall time and quantum time for Quil programs, the paper shows.","key_machinery":"The central machinery is a control-flow and data-dependence analysis of Quil programs that splits code into device-labeled basic blocks and instruction-level dependence graphs, cutting the graph at every conditional jump to avoid circular dependencies. On top of this sit two synchronization-aware transformations, instruction reordering and latest possible quantum execution, plus adapted classical passes: constant propagation, constant folding, live-variable analysis, and dead code elimination. The three metrics, wall time, quantum instruction number, and quantum calculation time, evaluate how well the two devices are kept busy and how long the quantum state must stay coherent.","core_discovery":"The paper's central discovery is a method: extend classical compiler analyses to a two-device execution model in which a CPU and QPU run in parallel and synchronize only at hybrid instructions, then evaluate programs by static metrics that count this parallelism. It claims to be the first work to optimize hybrid quantum programs and to propose metrics for doing so, and it demonstrates the method on four Quil algorithms. The reported improvements are modest and concentrated in the larger programs, while the two small programs show no gains, which the paper attributes to their low instruction counts.","pith_inferences":["If the unit-time execution model is replaced with realistic gate latencies and communication costs, pass ordering will likely change; the paper's metrics would need per-instruction weights to remain predictive.","The illegal BIT-to-REAL addition suggests a concrete language extension, such as a conditional-add or typed coercion instruction, that would make the IPE optimization legal in Quil.","The random phase-ordering search is a baseline; a systematic or learned phase-ordering search could plausibly find larger gains on the same programs.","Because the largest reported gains come from the most instruction-heavy algorithm, scaling these passes to larger hybrid programs is a natural next test of the method."],"forward_implications":["Hybrid program quality can be assessed without running hardware: the three static metrics give a reproducible ordering on candidate programs.","Instruction reordering and latest possible quantum execution can be composed with existing quantum-circuit optimizers, since they act on different instruction classes.","Programs with few instructions may resist optimization; the two small examples showed no gains, so benefits are likely concentrated in larger iterative algorithms.","The rule of splitting the data-dependence graph at conditional jumps makes dataflow analysis tractable for real-time loops, at the cost of treating loop bodies as separate regions.","A practical hybrid compiler can now be built by layering these passes on an existing Quil compiler rather than designing the optimizer from scratch."],"supporting_citations":[{"why":"Defines the Quil language and its instruction set, the target of all optimizations.","marker":"[21]"},{"why":"Supplies the heterogeneous quantum-classical computation architecture whose parallel CPU/QPU execution model underlies the metrics.","marker":"[11]"},{"why":"The existing Quil compiler, cited as optimizing only quantum circuits and therefore motivating hybrid passes.","marker":"[25]"},{"why":"Source of the classical compiler analyses adapted to hybrid code: constant propagation, live-variable analysis, constant folding, and dead code elimination.","marker":"[52]"},{"why":"Provides control flow analysis used to build basic blocks and the device-labeled control flow graph.","marker":"[58]"},{"why":"Provides the data-dependence graph construction used to determine instruction ordering constraints.","marker":"[59]"},{"why":"Iterative phase estimation, one of the two algorithms with reported improvements.","marker":"[10, 11]"},{"why":"Magic state distillation, the other algorithm with reported improvements.","marker":"[14-16]"},{"why":"Repository containing the analyzed programs, optimization implementations, and metric evaluation code.","marker":"[57]"}],"fun_headline_variants":["First compiler optimizations for hybrid quantum code","Seven passes to speed up hybrid quantum-classical programs","New metrics gauge parallelism in CPU-QPU workflows","Optimizing Quil for real-time quantum-classical sync"],"cache_read_input_tokens":3200,"weakest_assumption_plain":"The load-bearing premise is that replacing Quil's conditional-jump construction with a direct ADD of a BIT to a REAL has the same logical effect on the IPE's phase parameter, despite being forbidden by Quil's semantics; if that equivalence fails, the reported IPE improvements are void.","fun_headline_variants_meta":{"raw":{"variants":["First compiler optimizations for hybrid quantum code","Seven passes to speed up hybrid quantum-classical programs","New metrics gauge parallelism in CPU-QPU workflows","Optimizing Quil for real-time quantum-classical sync"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000843,"raw_usage":{"total_tokens":3587,"prompt_tokens":774,"completion_tokens":2813,"prompt_tokens_details":{"cached_tokens":384},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":390,"completion_tokens_details":{"reasoning_tokens":2752}},"tokens_in":390,"tokens_out":2813,"duration_ms":22159,"temperature":1.0,"reasoning_tokens":2752,"cache_read_input_tokens":384,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-15T20:24:55.398720+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Run the optimized IPE program on a Quil-compliant executor that rejects ADD of a BIT to a REAL: if the program fails to load, or if running the legal conditional-jump version under the same metrics yields no reduction in wall time, instruction count, or quantum calculation time, the central improvement claim is falsified.","supporting_citations":[{"cited_title":"Quingo: A Program- ming Framework for Heterogeneous Quantum-Classical Computing with NISQ Features,","cited_arxiv_id":null,"evidence_quote":"Supplies the heterogeneous quantum-classical computation architecture whose parallel CPU/QPU execution model underlies the metrics."},{"cited_title":"An open-source, industrial-strength optimizing compiler for quantum programs,","cited_arxiv_id":null,"evidence_quote":"The existing Quil compiler, cited as optimizing only quantum circuits and therefore motivating hybrid passes."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Source of the classical compiler analyses adapted to hybrid code: constant propagation, live-variable analysis, constant folding, and dead code elimination."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Provides the data-dependence graph construction used to determine instruction ordering constraints."},{"cited_title":"Github - LiRem101/parser-analyser: Analysa- tion and optimization of Quil programs","cited_arxiv_id":null,"evidence_quote":"Repository containing the analyzed programs, optimization implementations, and metric evaluation code."}],"review_version":1}