Searcharxiv⌕ Search

arXiv subjects

Nouhaila Innan

Publications and source records attributed to Nouhaila Innan.

At least 19 recordsLinked to original sources

Robustness Evaluation of Hybrid Quantum Neural Networks under Noise Models via System-Level Error Mitigation

Quantum Neural Networks (QNNs) represent a promising direction within Quantum Machine Learning (QML), yet their realization on noisy intermediate-scale quantum (NISQ) devices remains constrained by decoherence, gate imperfections, crosstalk, and readout errors. This study provides a systematic evaluation of noise effects and mitigation strategies in hybrid quantum neural networks (HQNNs). Zero-Noise Extrapolation (ZNE), Digital Dynamical Decoupling (DDD), and Layerwise Richardson Extrapolation (LRE) are incorporated into end-to-end QNN training pipelines developed with PennyLane, simulated using Qiskit Aer noise models, and integrated with the Mitiq framework, while Probabilistic Error Cancellation (PEC) is evaluated separately under depolarizing noise due to its computational cost. Experiments conducted on the Iris dataset with five representative noise channels show that the impact of noise and the effect of mitigation are strongly dependent on the noise model and its strength. The model maintains comparatively strong performance under phase-flip and phase-damping noise, while substantial degradation is observed under high depolarizing and amplitude-damping noise. Across the evaluated mitigation methods, the observed benefits remain limited and noise-dependent: ZNE, DDD, and LRE generally follow the same degradation trends as the unmitigated baseline, while PEC shows limited gains only in the low-noise depolarizing regime. These findings highlight the need for context-specific mitigation strategies to improve the robustness of QNNs in practical NISQ settings.

quant-ph↗

Towards Fair Benchmarking of Quantum Transfer Learning for Visual Classification

Quantum Transfer Learning (QTL) offers a promising approach for visual quantum machine learning under near-term constraints, where limited qubit counts, shallow circuit depths, and costly hybrid optimization restrict end-to-end quantum training. In this setting, pretrained classical backbones can extract high-level visual features, while compact quantum modules operate as trainable classification heads. However, existing QTL results are difficult to compare because they often differ in datasets, preprocessing, backbone settings, qubit budgets, circuit designs, optimization choices, and reporting protocols. This work presents a controlled benchmarking methodology for evaluating representative QTL methods under a unified transfer-learning pipeline. The benchmark compares DQN-QTL, QPIE-QTL, AE-CQTL, PVCQTL, and ED-QTL under shared preprocessing rules, frozen-backbone settings, training conditions, and reporting metrics. The evaluation focuses on Fashion-MNIST and Hymenoptera Ants vs. Bees as the two main datasets, while CIFAR-10 is used to provide additional configuration-level evidence on a harder natural-image task. Beyond predictive performance, the benchmark analyzes circuit size, trainable parameters, quantum parameters, training time, and architectural sensitivity to qubit count and circuit depth. The results show that no single QTL family dominates across all settings: performance depends on the dataset, encoding strategy, circuit design, and computational cost. These findings highlight the need for resource-aware QTL evaluation and provide guidance for selecting hybrid quantum-classical transfer models under near-term resource constraints.

quant-ph↗

QPredSGG: Hybrid Quantum Predicate Learning for Long-Tailed Scene Graph Generation

Scene Graph Generation (SGG) requires relational reasoning over objects and their interactions, but performance is constrained by long-tail predicate imbalance. Classical SGG models rely on dataset statistics, leading to biased predictions toward frequent relations rather than fine-grained semantic predicates. Although debiasing improves mean recall, predicate classification in existing frameworks still relies on high-dimensional classical decision modules with high parameter overhead. This work introduces a resource-efficient hybrid quantum predicate classifier for SGG by replacing the classical predicate head in the CFEN with a QP-Head trained using class-balanced WCE. To the best of our knowledge, this work is among the first evaluations of a hybrid quantum architecture for scene graph predicate classification on Visual Genome 150. We evaluate the impact of qubit count, encoding strategy, entangling topology, and circuit depth. Under a 4-qubit configuration using Amplitude Embedding and Strongly Entangling Layers, the QP-Head projects 4096-dimensional pair features into a 16-dimensional quantum input while using 96 trainable quantum parameters. Operating within this compressed representation space under WCE training, it achieves strong long-tail recognition, reaching a peak mR@100 of 57.25% compared to the 41.1% mR@100 reported in the CFEN baseline under standard training. Protocol-matched ablations indicate that the primary advantage of the quantum head lies in extreme representational compactness rather than an accuracy gain over full-dimensional weighted classical heads: it achieves global recall within 0.19pp of the 2048-dimensional WCE classical baseline while operating from a 128x smaller head feature space. Scaling to 8 qubits maintains robust long-tail performance (55.38% mR@100 with 384 quantum parameters), while depth analysis highlights expressibility-latency trade-offs.

quant-ph↗

HQTN-SER: Speech Emotion Recognition with Hybrid Quantum Tensor Networks

Speech emotion recognition (SER) remains fragile in real-world conditions because emotional cues are subtle, speaker-dependent, and easily confounded by recording variability, while high-performing deep models typically rely on large and carefully curated training sets. Quantum machine learning offers an alternative way to introduce nonlinear correlation modeling with compact modules, yet existing quantum SER studies remain limited, and the impact of circuit structure is not well understood. This paper presents HQTN-SER, a hybrid quantum-classical framework that investigates how quantum tensor network connectivity can support SER under small-qubit settings. HQTN-SER introduces (i) an MPS-inspired quantum tensor network module that enforces structured interactions to model correlations in speech representations with a small number of trainable parameters, and (ii) a fusion strategy that combines quantum measurement features with a learned classical latent embedding for end-to-end emotion classification. We evaluate HQTN-SER on three public benchmarks (RAVDESS, SAVEE, and MDER) under a unified preprocessing and training protocol. The proposed model achieves test accuracies of 80.09\% on RAVDESS, 78.12\% on SAVEE, and 73.51\% on MDER, with corresponding macro-F1 scores of 0.8012, 0.7826, and 0.7351, respectively. The model also exhibits stable convergence while using only three or four qubits, suggesting that MPS-inspired circuit structure can be an effective and hardware-aware design choice for quantum-assisted SER. These results provide a compact experimental baseline for studying structured quantum modules in affective computing.

quant-ph↗

Q-MALDetect: Quantum Image-Based Malware Detection and Adversarial Robustness Analysis

Quantum machine-learning (QML) models are increasingly considered for security applications, yet their adversarial robustness in malware analysis remains insufficiently understood. This paper presents Q-MALDetect, a hybrid convolutional and variational-quantum detector for byte-image representations of x86-64 Executable and Linkable Format (ELF) binaries, and evaluates it under feature-space and a range of Grad-CAM-guided, executable-aware evasion attacks. The model achieves 97.2% training accuracy, but its robustness deteriorates as attack strength increases, with the strongest evaluated feature-space attack reaching a 78.7% attack success rate (ASR). Among executable-aware attacks, Grad-CAM-guided no-operation (NOP) insertion produces the highest conditional ASR of 32.9%. Dynamic adversarial training is the most effective evaluated defense, reducing feature-space ASR to as low as 5.0%, executable-aware ASR to 7.7%, and the sequential-attack ASR to 34.0%. In contrast, convolutional-autoencoder preprocessing increases executable-aware ASR to 39.7%, coinciding with a rise in Grad-CAM attribution mass within the mutable .text region from 35.2% to 45.7%. Ablation results reveal no monotonic relationship between qubit count and robustness, while the encoding interface modifies the learned attack surface without neutralizing the strongest attack. These findings demonstrate that the effectiveness of attacks and defenses depends strongly on the perturbation constraints and evaluation conditions. Reliable deployment of QML malware detectors therefore requires assessment against both feature-space and executable-aware attacks rather than reliance on clean accuracy or generic denoising alone.

cs.CR↗

QIAP: A Quantum-Inspired Authentication Protocol with BB84-Based Channel Monitoring

Authentication in quantum-aware communication settings requires mechanisms that verify user legitimacy while also assessing whether the communication channel exhibits excessive disturbance. This paper presents QIAP, a stateful hybrid framework that combines classical commitment-based challenge-response authentication with BB84-based quantum-channel monitoring. QIAP uses a dual-branch verification structure inspired by rectilinear and diagonal basis selection. In the rectilinear branch, the prover opens a hash-based commitment and the verifier checks consistency with the registered round token. In the diagonal branch, the prover returns an HMAC tag bound to the verifier nonce, round identifier, and submitted commitment without disclosing the round-specific sub-secret. Under the stated hash, HMAC, freshness, secure-registration, protected-storage, and high-entropy-secret assumptions, QIAP provides computational resistance to the modeled wrong-secret and replay attempts and protects the long-term master secret from direct recovery. After successful authentication, the BB84 module estimates the quantum bit error rate (QBER) and aborts the session when the measured value reaches or exceeds the configured threshold. In the reported simulation, no successful authentication was observed among 1,000 tested wrong-secret attempts per branch. The baseline and full intercept-resend conditions produced mean QBER values of approximately 0.02 and 0.25, respectively. The classical authentication stage required approximately 0.6 ms, and the implemented authentication messages required approximately 113 bytes per round. These results indicate that QIAP can provide a lightweight hybrid framework for combining secret-based identity verification with QBER-based channel-disturbance assessment under the stated threat model.

quant-ph↗

QBFF: Deep Quantum Bottleneck for Automatic Speaker Verification Anti-Spoofing

A central goal of quantum machine learning is to identify applications in which small quantum circuits can improve task performance while remaining executable on real hardware. We investigate deepfake (synthetic) speech detection, a largely unexplored application in this area, where reliable confidence scores are as important as discrimination performance because deployment decisions are made at fixed thresholds and overconfident errors can be costly. We introduce QBFF, which routes a compressed speech representation through a small 8-qubit variational circuit (VQC) used as a drop-in bottleneck, with a matched classical bottleneck as the control. The quantum circuit yields better-calibrated confidence in most matched comparisons, including out-of-distribution evaluation, though the downstream deployment-cost benefit is model-dependent. We then run the same circuit on a real IBM quantum processor. To our knowledge, this is the first anti-spoofing pipeline to run on a QPU; hardware execution demonstrates feasibility, with lower subset EER and $C_{llr}$ but higher mean actDCF than the matched classical reference. Together, these results show that hardware-executable quantum bottlenecks can improve score reliability, with gains that vary by evaluation setting.

quant-ph↗

VoxelSynth3D: Interpretable Volumetric Image-Domain Metal Artifact Reduction with a Paired Synthetic CLINIC Benchmark

Metal artifacts in postoperative musculoskeletal CT obscure bone-implant and adjacent soft-tissue interfaces. Many metal artifact reduction (MAR) methods require unavailable raw projections or learned models that may shift across scanners and implants. We present VoxelSynth3D, a training-free 3D image-domain framework for reconstructed CT. The framework combines support masking, normalized tissue synthesis, deviation gating, and restricted edge refinement. Detected implant voxels are preserved in the output, while correction targets metal-induced artifacts in the surrounding tissue. We also construct Synthetic CLINIC-Metal, a controlled paired synthetic evaluation resource, from no-metal CTPelvic1K volumes with clean targets, metal/artifact masks, fixed seeds, and patient-level splits; 75 unpaired real metal cases receive qualitative/no-reference evaluation only. The operating point was fixed in a near-flat validation basin. With exact-mask oracle localization, all methods share a metal-excluded tissue ROI. On 40 held-out cases, VoxelSynth3D reduced RMSE from 801.48 to 786.18 HU (paired gain 15.30 HU, 95% CI 11.68-19.23), improving every case and exceeding the evaluated 3D Gaussian smoother by 13.58 HU. Clean-edge agreement decreased next to metal but exceeded input beyond 5 mm. Thus, VoxelSynth3D provides case-consistent within-distribution tissue-error reduction with a localized structural tradeoff. Spacing-aware sensitivity retained aggregate broad-region improvement and identified near-metal calibration as a target.

cs.CV↗

QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Code

Large language models (LLMs) have shown strong results in classical code generation and are increasingly used to write the unit tests that safeguard that code. Whether they can do the same for quantum software is less clear, because quantum programs are probabilistic, depend on numerical tolerances, and are judged by domain-specific checkers, so a well-formed test can still disagree with the benchmark's verdict. Existing quantum benchmarks measure whether a model produces a correct solution, but not whether its tests can distinguish correct implementations from faulty ones. We introduce QTestBench, a framework that evaluates LLM-generated quantum test suites against independent benchmark checkers, never treating the tests themselves as ground truth. For each task, QTestBench prompts models to produce syntactic, semantic, and behavioral tests, injects candidate solutions at runtime, and compares each test verdict with the checker's label under three validation cohorts, each answering a distinct diagnostic question. We benchmark five LLMs on eight PennyLane QHack challenges and ten Qiskit HumanEval tasks. Generated suites almost always execute, but discrimination lags behind: the best generator reaches a test quality of 0.71 on QHack and 0.34 on Qiskit HumanEval, so executability alone overstates test quality. Oracle-verified synthetic mutants stabilize bug-detection estimates when natural faulty solutions are scarce, as on three of ten Qiskit tasks that yield none. QTestBench offers a reproducible, cross-framework benchmark for the trustworthiness of LLM-generated quantum tests.

cs.LG↗

QLIF-CAST: Quantum Leaky-Integrate-and-Fire for Time-Series Weather Forecasting

Accurate and efficient time-series forecasting remains a challenging problem for both classical and quantum neural architectures, particularly in multivariate environmental settings. This work adapts the Quantum Leaky Integrate-and-Fire (QLIF) spiking neural network for time-series regression tasks, specifically short-term multivariate weather forecasting. We extend QLIF beyond classification and demonstrate its applicability to continuous-valued prediction problems. The QLIF-CAST model encodes neuron excitation states as single-qubit quantum superpositions, driven by R_x rotation gates and T1 relaxation decay, and is embedded within a hybrid quantum-classical recurrent architecture. We conduct two distinct evaluations. First, a controlled comparison against a parameter-matched classical LIF baseline on a multivariate weather dataset shows that QLIF-CAST achieves 15.4% lower MSE and 4.4% lower MAE, demonstrating that quantum neuronal dynamics reduce prediction error over classical equivalents. Second, a cross-domain comparative analysis with state-of-the-art quantum LSTM (QLSTM) and quantum neural network (QNN) models on air quality and wind speed benchmarks reveals that QLIF-CAST converges in up to 94% less training time, occupying a distinct position in the speed-error trade-off space. Hardware verification on IBM Marrakesh (156-qubit QPU) confirms reliable circuit execution with only 1.2% average deviation from simulation.

quant-ph↗

Q-PhotoMarket: A Design Space Exploration Framework for Photonic Hybrid Quantum Neural Networks in Financial Market Prediction

Photonic quantum computing has recently emerged as a promising platform for hybrid quantum machine learning due to its native realization of linear-optical circuits and the computational complexity of boson sampling. However, despite growing interest in quantum methods for finance, the influence of photonic circuit design choices on predictive performance remains largely unexplored. Existing studies typically evaluate a single architecture, leaving the broader photonic design space unexamined. In this work, we present Q-PhotoMarket, a systematic design space exploration (DSE) framework for photonic hybrid quantum neural networks (HQNNs) applied to financial market prediction. We explore over 5,000 valid photonic configurations spanning input photon states, circuit architectures, entangling models, and measurement strategies across their compatible computation spaces, for U.S., Indian, and cryptocurrency markets. To improve search efficiency, the exhaustive exploration is complemented with Bayesian optimization. We further incorporate threshold calibration and prediction-collapse diagnostics to enable reliable evaluation under increasingly imbalanced return thresholds. Experimental results show that systematic exploration of more than 5,000 photonic HQNN configurations reveals consistent architectural patterns across financial markets, identifies robust high-performing designs, and demonstrates competitive performance relative to classical machine learning baselines.

quant-ph↗

Curvature-Aware Edge Dynamic GNNs for Low-$p_T$ Track Reconstruction at HL-LHC

Particle track reconstruction in high-energy collider experiments is a computationally demanding combinatorial problem, traditionally solved by Kalman filters that scale poorly with increasing detector occupancy. Graph Neural Networks (GNNs) have recently emerged as a promising alternative. In this work, we introduce the Manifold Helical-IN, a novel Interaction Network architecture that explicitly embeds detector spacepoints onto a helical manifold chart using curvature-aware features. This geometric projection mathematically unrolls the tightly curling trajectories of low-momentum particles. Consequently, the network can distinguish true physical tracks from combinatorial noise with good precision. Evaluated on the TrackML challenge dataset, the proposed Manifold Helical-IN achieves a reconstruction efficiency of 0.9675 in the experimentally critical $p_T > 0.5$ GeV regime, approaching recently reported Transformer-based approaches. Crucially, the manifold embedding yields a fake track rate of 0.0037. This represents a 13-fold improvement over the baseline Helical-IN (0.0508). Furthermore, the model maintains good track coherence, as quantified by our proposed Mean Hit Recovery Fraction (MHRF) of 0.858, and achieves a highly efficient inference latency of approximately 150 ms per event on a single NVIDIA A100 GPU. These results represent a critical step toward real-time soft particle tracking for the High-Level Trigger (HLT). By operating within practical HLT latency budgets, this geometry-aware approach provides a pathway to recover soft, anomalous Beyond Standard Model signatures such as unclustered energy patterns (SUEPs), that routinely evade standard hardware filters.

physics.ins-det↗

Game, Set, Quantum: Parameterized Quantum Circuit for Correlated Equilibrium in Bayesian Games

Strategic decision-making among many agents under incomplete information is central to economics, security, and multi-agent artificial intelligence (AI). Computing equilibria in such settings is challenging because the joint type-action space grows exponentially with the number of players. In binary-type, binary-action Bayesian games with $n$ players, an explicit representation over type-action profiles requires $O(2^{2n})$ entries, making direct linear-programming (LP) formulations increasingly costly as $n$ grows. We propose a hybrid quantum-classical framework for approximating Bayes correlated equilibrium (BCE) using a parameterized quantum circuit (PQC). The PQC represents the conditional distribution over joint actions using $O(nL)$ trainable parameters, where $L$ denotes the circuit depth; for the largest trained setting, $n=8$ and $L=2$, this corresponds to $48$ trainable angles. Each player count is trained independently by maximizing expected social welfare with a penalty on positive aggregated BCE obedience violations. On a strategically coupled Bayesian congestion game with $n=2,4,6,8$ players, feasible PQC solutions attain higher welfare than MCCFR and DCFR product-strategy baselines while satisfying $ε_{\max}\leq10^{-3}$, where $ε_{\max}$ denotes the maximum positive aggregated BCE obedience violation. Across five independent runs per setting, all runs are feasible for $n=2,4,6$, while four of five are feasible for $n=8$. PQC welfare remains below the exact LP optimum, with the absolute gap increasing with $n$, while classical state-vector simulation prevents PQC training beyond eight players. These results demonstrate the use of a compact PQC parameterization for approximate equilibrium computation and quantify its welfare, feasibility, and classical simulation scaling on the studied benchmark.

quant-ph↗

EFaaS: A Quantum-Classical Serverless Entangled Scheduler for Hybrid Variational Algorithms

As quantum computing enters the Utility Era, realizing near-term advantage relies heavily on Hybrid Variational Quantum Algorithms (VQAs). These algorithms require a tightly coupled, iterative loop between a classical CPU optimizer and a Quantum Processing Unit (QPU). However, current quantum cloud access models are bottlenecked by decoupled batch-queues that sever this loop, introducing massive Time-to-Next-Shot (TTNS) latency. This delay inflates convergence time from minutes to hours and exposes the computation to quantum hardware drift, degrading algorithmic fidelity. Unlike prior work that relies on resource-wasting static hardware reservations or state-oblivious, stateless functions, we propose EFaaS, a novel serverless middleware designed specifically for hybrid quantum workflows. EFaaS fundamentally departs from existing architectures by treating classical parameter optimization and quantum circuit execution as entangled, session-aware events. Our main technical innovations are threefold: (1) a Calibration-Aware placement strategy that dynamically routes circuits to QPUs with warm calibration caches, circumventing cold-start penalties, (2) a Dual-Resource Fair Queuing scheduler that maximizes quantum utilization by strictly prioritizing active iterative loops, and (3) the "EF-QuantumFuture" programming abstraction, a novel primitive enabling classical speculative execution to mask compute latency. Across the evaluated baselines, EFaaS achieves TTNS reductions of 11.4%-94.3%, QDC gains of 2.02%-15.78% points, and convergence speedups of 83.2%-98.3%, while eliminating drift penalties.

quant-ph↗

A2QTGN: Adaptive Amplitude Quantum-Integrated Temporal Graph Network for Dynamic Link Prediction

Dynamic link prediction is important for modeling evolving interactions in social, communication, financial, and transportation networks. Classical temporal graph models capture changes over time, but they may struggle to represent rapidly evolving node-edge interactions in large dynamic graphs. We propose A2QTGN (Adaptive Amplitude Quantum-Integrated Temporal Graph Network), a hybrid quantum-classical framework that introduces adaptive amplitude encoding as a temporal embedding layer within a Temporal Graph Network. Unlike fixed quantum embeddings, the proposed module maps temporally varying node features into quantum states and selectively refreshes their amplitude representations according to the magnitude of feature change. This allows the framework to preserve stable node information, emphasize meaningful temporal variations, and reduce redundant quantum re-encoding. Across five Temporal Graph Benchmark datasets, A2QTGN achieves test area under the curve (AUC) values of up to 0.9957 and mean reciprocal rank (MRR) values of up to 0.7832, including the highest MRR among the compared baselines on tgbl-review and tgbl-flight. Ablation results further show that the adaptive quantum embedding is central to the model performance: on a 25k-event subset of tgbl-wiki, it improves test accuracy by 13.36 percentage points over always updating and by 22.44 percentage points over using no updates. The trained model is also evaluated using noisy simulations based on an IBM quantum device, followed by a smaller real-device experiment. The results show that adaptive quantum embeddings can provide effective temporal representations for dynamic link prediction while remaining executable under current quantum hardware constraints.

quant-ph↗

Enhancing Blood Cells Classification using Hybrid Quantum Neural Networks

Accurate classification of microscopic blood cells is still a critical task in medical image analysis, where subtle variations and limited data can challenge conventional deep learning models. As such, we investigate in this work the potential of Hybrid Quantum-Classical Neural Networks (HQNNs) to enhance feature representation and improve classification performance in this domain. We propose a modular architecture combining a pre-trained ResNet-50 backbone with a low-dimensional latent bottleneck and a variational quantum circuit, enabling a direct comparison between quantum-enhanced and purely classical transformation mechanisms. To isolate the contribution of the quantum component, we evaluate three architectures: a HQNN model, a Classical Matched Model with an additional nonlinear transformation layer of comparable capacity, and a baseline model without an intermediate transformation stage. Experiments conducted on two publicly available blood cell datasets, namely the Blood Cell Images dataset and the PBC dataset, demonstrate that HQNNs consistently achieve superior or more balanced performance across evaluation metrics. In the Blood Cell Images Dataset, the proposed approach improves macro F1-score by up to 3.7% compared to classical baselines, while improving the F1-score from 98.54% to 98.69% in the more challenging 8-class scenario with near-saturated performance. Additional evaluation on IBM quantum hardware shows that the model remains robust under noise, with only a modest performance degradation relative to simulated results. These results indicate that quantum feature transformations can enhance discriminative representations, particularly in challenging classification scenarios, and highlight the practical potential of HQNN models for medical imaging tasks.

cs.CV↗

Q-SpiRL: Quantum Spiking Reinforcement Learning for Adaptive Robot Navigation

Adaptive robot navigation in dynamic environments requires policies that can reach the target reliably while producing efficient and stable trajectories. This paper presents Q-SpiRL, a quantum spiking reinforcement learning framework for obstacle-aware robot navigation. The framework develops and evaluates five agent families: tabular Q-learning, classical MLP, classical SNN, quantum-enhanced MLP (QMLP), and quantum-enhanced spiking neural network (QSNN). While all models are implemented under a unified training and evaluation pipeline, the QSNN is the central architecture of interest, as it combines spike-based temporal processing with variational quantum feature transformation. Experiments are conducted across three grid-world environments of increasing size, namely 20x20, 30x30, and 40x40, with both static and dynamic obstacles. Performance is assessed using success rate, success-weighted path length, path length, and turn rate under deterministic inference. Results show that QSNN achieves the strongest overall trade-off between task completion, trajectory efficiency, and motion smoothness, reaching up to 99% success rate while maintaining high path efficiency in the most challenging setting. Execution on IBM quantum hardware further demonstrates the feasibility of deploying the proposed hybrid policy under real-device conditions.

cs.RO↗

PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generation

The growing complexity of quantum programming frameworks has exposed a critical limitation in existing large language model (LLM)-based code assistants: general-purpose models hallucinate PennyLane-specific gate names, misplace device configurations, and produce structurally invalid circuits when faced with specialized quantum coding challenges. We present PennySynth, a retrieval-augmented generation framework that addresses this gap by conditioning LLM inference on a curated knowledge base of 13,389 PennyLane instruction-code pairs, built via a three-stage extraction, verification, and deduplication pipeline over official PennyLane repositories, community GitHub sources, and QHack competition archives. PennySynth introduces a code-aware embedding strategy using st-codesearch-distilroberta-base, trained for natural-language-to-code retrieval, increasing average retrieval cosine similarity from 0.45 to 0.726 compared to a general-purpose baseline. Evaluated across 74 challenges spanning three years of the QHack competition (2022, 2023, 2024), PennySynth achieves 64%, 68%, and 52% pass@5 on QHack 2022, 2023, and 2024, respectively, improving over Claude Sonnet 4.6 without retrieval by +28, +25, and +28 percentage points. We further introduce a quantum-adapted CodeBLEU metric that upweights qml.* token patterns and show that structural code similarity and functional correctness capture distinct aspects of quantum code quality. Controlled ablations reveal that code-aware embeddings are the primary driver of retrieval performance, while dataset expansion and source composition provide additional gains when retrieval quality is sufficiently precise.

cs.CL↗