How srijahn/moderna-challenge works
Purpose and execution model
This is a script-driven RNA secondary-structure research project for the WISER × Moderna challenge. It converts short RNA sequences into constrained QUBOs, solves them with simulated QAOA and CVaR-VQE, and evaluates decoded structures against ViennaRNA MFE references. There is no application server; entry points are executable Python workflows, notably statistical_benchmark.py, generate_final_results.py, and compare_to_vienna.py.
Sequence sets and classical reference boundary
Curated folding-positive workloads define the active experiments: benchmark_sequences.py supplies eight 8–14 nt sequences, while test_sequences.py supports smaller validation cases. ViennaRNA is the authoritative thermodynamic reference and candidate evaluator:
• test_vienna.py
• structure_metrics.py
• official_example_benchmark.py
structure_metrics.py calls ViennaRNA MFE folding and evaluates each candidate dot-bracket structure in comparable kcal/mol units, plus base-pair precision/recall/F1, pair distance, and Hamming distance. The 44-nt official example remains classical-only because its QUBO is infeasible for the simulated quantum solvers.
Default pair-indicator QUBO compilation
The central model is rna_to_qubo_full.py, which maps each feasible base pair to a binary variable/qubit. It includes Watson-Crick and G-U wobble candidates, minimum hairpin-loop constraints, and penalties for shared-nucleotide conflicts and crossing pairs (therefore excluding pseudoknots). It also provides brute-force validation for small instances.
• rna_to_qubo_full.py
• rna_to_qubo.py
• qubo_energy.py
This compiler is the boundary between RNA/domain constraints and generic binary optimization. Its simple pair-count-style objective is intentionally distinct from ViennaRNA thermodynamics, so a QUBO optimum may not be an MFE-optimal biological structure.
Quantum solver layer
Two independent PennyLane-based solvers consume the real QUBO, optimize circuit parameters, sample/decode binary assignments, and return structures/energies:
• qaoa_rna_solver.py
• cvar_vqe_rna_solver.py
Both use derivative-free SciPy COBYLA-style optimization rather than statevector backpropagation. QAOA is less scalable/reliable in batch use and is capped near 11 qubits for quality experiments; CVaR-VQE uses a two-local ansatz and is the more broadly run method. Statevector simulation, not quantum hardware, is the material execution runtime.
Evaluation and reproducible result production
The main flow is: curated sequence → QUBO compilation → solver trial(s) → assignment-to-dot-bracket decoding → ViennaRNA metric evaluation → CSV result table under results/.
• statistical_benchmark.py
• batch_accuracy.py
• generate_final_results.py
statistical_benchmark.py is the principal rigorous benchmark: repeated CVaR-VQE and QAOA trials produce trial-level and mean/std datasets. final_summary.py consumes final result and scaling tables for a human-readable aggregate report. results/ is the sole generated-output boundary.
Scaling, noise, and feasibility studies
Separate workflows measure actual simulator resource behavior and robustness rather than extrapolated formulas:
• scaling_analysis_real.py
• cvar_vqe_scaling_analysis.py
• noise_simulation.py
They record qubits, depth/gates, forward runtime, and—only below optimization cutoffs—quality metrics. Noise experiments use PennyLane’s mixed-state simulator with depolarizing channels. Plot scripts consume these CSVs but do not alter solver logic.
Alternative encoding and key design decision
rna_to_qubo_onehot.py implements directed, per-position one-hot pairing variables with consistency penalties. compare_qubo_encodings.py verifies it against the default encoding and ViennaRNA where brute force is feasible. The one-hot scheme uses exactly twice the qubits and more penalty terms while yielding equivalent optima on tested instances, so the pair-indicator encoding remains the production path for solvers and scaling studies.
Main entry points: rna_to_qubo_full.py Pair-indicator compiler · statistical_benchmark.py Statistical benchmark · cvar_vqe_rna_solver.py CVaR-VQE · structure_metrics.py Structure metrics
Components 19
Workloads & reference
- Benchmark sequences · Eight curated 8–14 nt folding-positive sequences.
benchmark_sequences.py - Validation sequences · Small validation cases.
test_sequences.py - ViennaRNA reference · Authoritative MFE folder and candidate evaluator.
test_vienna.py - Structure metrics · Computes comparable energies and structure-quality metrics.
structure_metrics.py - Official 44-nt example · Classical-only because its QUBO is infeasible for simulated solvers.
official_example_benchmark.py
Production optimization
- Pair-indicator compiler · Maps feasible base pairs to binary variables with RNA constraints.
rna_to_qubo_full.py - QUBO utilities · Legacy/simple compilation and QUBO energy calculation.
rna_to_qubo.py - Simulated QAOA · COBYLA-style optimized statevector solver; quality runs cap near 11 qubits.
qaoa_rna_solver.py - CVaR-VQE · Two-local ansatz with derivative-free optimization.
cvar_vqe_rna_solver.py
Evaluation studies
- Statistical benchmark · Runs repeated CVaR-VQE and QAOA trials with mean/std summaries.
statistical_benchmark.py - Batch accuracy
batch_accuracy.py - Final results generator
generate_final_results.py - Scaling studies · Measures simulator resource behavior and quality below optimization cutoffs.
scaling_analysis_real.py - CVaR scaling
cvar_vqe_scaling_analysis.py - Noise simulation · Uses mixed-state simulation with depolarizing channels.
noise_simulation.py - One-hot encoding · Directed per-position encoding with twice the qubits.
rna_to_qubo_onehot.py - Encoding comparison · Compares encodings and ViennaRNA where brute force is feasible.
compare_qubo_encodings.py - Final summary · Builds a human-readable aggregate report from result tables.
final_summary.py
Generated results
- Results tables · Sole generated-output boundary.
Connections 26
- Benchmark sequences → Pair-indicator compiler: compile
- Validation sequences → Pair-indicator compiler: validate
- Pair-indicator compiler → QUBO utilities: QUBO energy
- Pair-indicator compiler → Simulated QAOA: real QUBO
- Pair-indicator compiler → CVaR-VQE: real QUBO
- Simulated QAOA → Structure metrics: decoded structures
- CVaR-VQE → Structure metrics: decoded structures
- ViennaRNA reference → Structure metrics: MFE reference
- Official 44-nt example → ViennaRNA reference: classical folding
- Statistical benchmark → Benchmark sequences: uses
- Statistical benchmark → Simulated QAOA: trials
- Statistical benchmark → CVaR-VQE: trials
- Statistical benchmark → Structure metrics: evaluate
- Statistical benchmark → Results tables: trial and summary CSVs
- Batch accuracy → Results tables: CSV results
- Final results generator → Results tables: final tables
- Scaling studies → Pair-indicator compiler: compiled instances
- Scaling studies → Results tables: resource tables
- CVaR scaling → CVaR-VQE: measure
- CVaR scaling → Results tables: scaling tables
- Noise simulation → CVaR-VQE: noisy runtime variant
- Noise simulation → Results tables: robustness tables
- Encoding comparison → One-hot encoding: verify
- Encoding comparison → Pair-indicator compiler: compare
- Encoding comparison → ViennaRNA reference: validate
- Results tables → Final summary: consume