implement swap test

Designs, constructs, and analyzes quantum circuits that implement the swap test to estimate the overlap or fidelity between quantum states, including ancilla-controlled swap gates, measurements, and parameterized or approximate variants. This competence covers simulating and mitigating device noise, integrating swap-test measurement outcomes into loss functions and training loops, and enabling differentiation of measurement statistics for optimization.

implementswaptest

Recent Skill Trend

Momentum and market value over time
Trending
Score
No comparison yet
0.95
Oct 01, 2026Oct 01, 2026
Career
Value
No comparison yet
$200K/year
Oct 01, 2026Oct 01, 2026

Must-Read Papers

Most classic and influential ideas
View more

On the Feasibility of Quantum Unit Testing

Jul 23, 2025
AM
Andriy Miranskyy
🏛️ Toronto Metropolitan University | University of Porto | LASIGE | Universidade de Lisboa | Munster Technological University | University of Maryland, Baltimore County | University of Castilla-La Mancha

Quantum software complexity poses significant challenges to the detection of state discrepancies and reliability in unit testing. To address this, we propose a quantum-centric unit testing framework specifically designed for quantum circuits, featuring a novel inverse test technique integrated with statevector testing and SWAP testing—yielding a hybrid verification methodology compatible with both classical simulation and quantum hardware execution. Empirical evaluation across over 1.79 million mutated circuits demonstrates that our approach substantially reduces both false positive and false negative rates compared to conventional statistical testing. Moreover, statevector and inverse tests achieve high-confidence verification with significantly fewer measurements and markedly improved fault detection capability. This work establishes a new unit testing paradigm for quantum software that offers superior accuracy and efficiency in verification.

Comparing classical and quantum-specific tests for circuit discrepanciesEvaluating quantum unit testing methods for software verificationReducing false positives/negatives in quantum software testing

The Cost of Certainty: Shot Budgets in Quantum Program Testing

Oct 25, 2025
AM
Andriy Miranskyy
🏛️ Toronto Metropolitan University

Quantum program verification on early fault-tolerant hardware faces critical challenges due to scarce measurement resources and tight measurement budgets. Method: We propose the first unified, program-level measurement budgeting framework that systematically links theoretical error bounds—based on trace distance, fidelity, error probability, and the quantum Chernoff bound—with practical testing strategies: inversion testing, swap testing, and chi-square testing. The framework supports scalable analysis, from single-gate verification to full-program validation. Contribution/Results: We quantify substantial measurement overhead differences among strategies: inversion testing is optimal; swap testing incurs roughly 2× overhead; chi-square testing is simple but costly. Noise and fine-grained circuit decomposition further escalate costs. To address this, we introduce coarse-grained partitioning and weighted budget allocation, achieving superior trade-offs between verification accuracy and hardware resource consumption. Our framework establishes a computationally tractable, deployable paradigm for quantifying and allocating measurement resources in quantum software verification.

Analyzing measurement efficiency across three quantum testing methodsEstablishing fundamental shot count limits for quantum program verificationProviding practical guidance for budgeting verification efforts under noise

Stabilizer Testing and Magic Entropy

Jun 15, 2023
KB
Kaifeng Bu
🏛️ Harvard University | University of New Hampshire

This work systematically addresses the verifiability and quantifiability of quantum “magic”—a fundamental resource underpinning quantum computational advantage. We propose a scalable stabilizer verification protocol based on quantum convolution and swap testing, reducing the verification complexity for quantum states and gates to polynomial time. We introduce the novel concept of “magic entropy,” the first experimentally measurable magic monotone that is both monotonic under Clifford operations and convex—overcoming the long-standing limitation that magic cannot be directly observed. Through theoretical analysis, design of universal circuits (for both qubits and qudits), and numerical simulations, we demonstrate that magic entropy exhibits high sensitivity to deviations from the Clifford group. Our framework establishes a new paradigm for benchmarking and hardware validation of magic resources in near-term quantum devices.

Quantifying magic in stabilizer and Gaussian circuitsTesting and measuring magic in quantum states and gatesUsing quantum Fourier analysis for resource assessment

Which Quantum Circuit Mutants Shall Be Used? An Empirical Evaluation of Quantum Circuit Mutations

Nov 28, 2023
EM
Eñaut Mendiluze Usandizaga
🏛️ Simula Research Laboratory | National Institute of Informatics | Oslo Metropolitan University

The absence of systematic benchmarks hampers rigorous evaluation of quantum software testing techniques. Method: We conduct a large-scale empirical study, generating over 700,000 faulty mutants from 382 real-world quantum circuits, and systematically analyze how circuit characteristics (e.g., depth, gate count), algorithm classes (e.g., QAOA), and mutation operators influence fault detection capability. Contribution/Results: We present the first quantitative characterization of the relationship between quantum circuit features and mutation detection difficulty; propose a configurable, cost-benefit–driven paradigm for constructing fault benchmarks; and release QFaultBench—an open-source tool that intelligently recommends mutants based on algorithm category and detection difficulty. Our work delivers a standardized benchmark suite, highly discriminative mutation operator combinations, and empirically grounded recommendation strategies, significantly enhancing the scientific rigor and efficiency of quantum testing benchmark construction.

Assessing quantum testing techniques lacks systematic benchmarksProviding tools and benchmarks for cost-effective quantum software testingUnderstanding how circuit and mutation traits affect mutant detection

A New Optimization Model for Multiple-Control Toffoli Quantum Circuit Design

Apr 22, 2024
JJ
Jihye Jung
🏛️ Georgia Institute of Technology

Synthesis of reversible Boolean functions as multi-controlled Toffoli (MCT) quantum circuits, with the objective of minimizing the actual gate count under physical constraints. Method: We propose the first end-to-end integer optimization model that directly minimizes the number of physical quantum gates. The model integrates constraint programming (CP), integer nonlinear modeling, symmetry analysis, and custom symmetry-breaking constraints to drastically improve computational efficiency. Contribution/Results: Our approach achieves up to two orders of magnitude speedup over prior methods. For 7-qubit benchmarks with at most 15 gates, it delivers the first provably optimal solutions for multiple classical benchmarks, establishing new records for minimal MCT circuits. Unlike heuristic approaches, our method provides mathematically verifiable optimality guarantees and yields strictly smaller circuits. The key innovation lies in embedding the physical gate-count objective into a compact, rigorous optimization framework while systematically exploiting symmetries for pruning—thereby unifying theoretical soundness with computational tractability.

Achieve superior circuits with optimality guarantees compared to other approachesImprove solving time with new optimization model and symmetry-breaking constraintsOptimize MCT quantum circuit design for reversible Boolean functions

Latest Papers

What's happening recently
View more

QMon: Monitoring the Execution of Quantum Circuits with Mid-Circuit Measurement and Reset

Dec 15, 2025
NM
Ning Ma
🏛️ Polytechnique Montreal | Kyushu University | Simula Research Laboratory

Quantum circuits are inherently difficult to debug and monitor at runtime due to the no-cloning theorem and wavefunction collapse upon measurement. This paper introduces the first runtime monitoring framework that jointly ensures high fidelity and observability: it enables localized error localization by inserting lightweight monitoring operators, performing mid-circuit measurements, and resetting qubits—without perturbing the original circuit behavior, including entanglement and other essential quantum properties. The framework continuously compares the expected quantum state with the empirically measured probability distribution, introducing negligible disturbance. Evaluated on 154 benchmark circuits, the approach achieves zero functional degradation, high error detection rates, and practical levels of coverage and robustness.

Detecting and localizing programming errors while preserving entanglementEnabling debugging and runtime monitoring via mid-circuit measurementsMonitoring quantum circuit execution without altering behavior

This work addresses the challenge of effectively detecting implementation faults in quantum neural networks by proposing an efficient mutation testing approach. The method introduces novel quantum circuit mutation operators and a targeted mutation generation strategy, which collectively reduce redundant mutants while enhancing the precision of fault injection. By generating mutants with greater diversity and representativeness, the approach significantly strengthens the ability of test suites to validate quantum neural network implementations, uncovering defects that are often missed by conventional testing techniques. Experimental results demonstrate the effectiveness of the proposed method in improving the reliability of quantum machine learning models.

fault detectionmutation testingquantum circuit verification

Existing approaches to quantum program testing struggle to adequately explore the quantum state space, limiting software reliability. This work proposes a test circuit generation framework based on Brick-Circuit architectures that constructs hardware-compatible gates to approximate ideal random states, thereby enhancing coverage of the state space. The method introduces a novel diversity scoring mechanism that jointly accounts for amplitude, phase, and entanglement, integrating local and global perspectives. Furthermore, it designs a shallow yet highly expressive generator for test inputs. Experimental results demonstrate that, compared to existing techniques, the proposed generator achieves more uniform coverage of quantum states and stronger entanglement capabilities at significantly reduced circuit depths.

entanglementexpressibilityinput diversity

This study addresses the significant challenge of verifying the correctness of quantum compiler transformations, which is inherently difficult due to high computational complexity. To overcome the limitations of conventional unit testing, this work proposes RetroQ, a framework that integrates the principles of retrosynthetic back-testing and the Hadamard test to enable automated verification of both semantic preservation and structural modifications within quantum compilation pipelines. Implemented through the integration of PennyLane and Qiskit, the proposed approach not only successfully reproduces known defects but also detects latent bugs related to parameter handling and logical errors. By facilitating rigorous and automated validation of compilation passes, RetroQ substantially enhances the reliability of the quantum software stack.

Compiler PassesCorrectness VerificationQuantum Compiler

This work addresses the lack of fault-injected benchmark programs in quantum software testing, which hinders effective evaluation of test cases. To bridge this gap, the authors propose and construct QMutBench, a large-scale benchmark dataset comprising over 700,000 mutated quantum circuits that encompass diverse fault types. QMutBench is the first dataset to enable flexible filtering along multiple dimensions—including original circuit, mutation operator type, and mutant survival rate—and is publicly accessible via an online interface. By providing a customizable and reproducible evaluation infrastructure for mutation-based quantum software testing, QMutBench significantly advances both research and practical applications in this emerging field.

benchmarkfault detectionmutant dataset

Hot Scholars

SS

Simo Särkkä

Professor, Aalto University
multi-sensor data fusionBayesian filtering and smoothingsensor fusionmedical technology
JG

Jugal Garg

Associate Professor, University of Illinois at Urbana-Champaign
Computational Aspects of Economics and Game TheoryCombinatorial OptimizationDesign and Analysis
PM

Pingchuan Ma

Hong Kong University of Science and Technology
Software EngineeringData ManagementCausal Discovery
YF

Yaru Fu

Associate Professor, Hong Kong Metropolitan University, World's Top 2% Scientists
Wireless NetworksDigital Twin6G
DL

Dongryeol Lee

Seoul National University
Question AnsweringEvaluationLLM-Judge