QuRAFT
Links editable mathematical expressions with circuit components and measurement plots so users can formulate, assemble, and compare quantum algorithm implementations.
Visualization labels
03 / VisualizationA closer look
2 figuresQuRAFT: Enhancing Quantum Algorithm Design by Visual Linking between Mathematical Concepts and Quantum Circuits
Abstract
The emergence of quantum computers heralds a new frontier in computational power, empowering quantum algorithms to address challenges that defy classical computation. However, the design of quantum algorithms is challenging as it largely requires the manual efforts of quantum experts to transit mathematical expressions to quantum circuit diagrams. To ease this process, particularly for prototyping, educational, and modular design workflows, we propose to bridge the textual and visual contexts between mathematics and quantum circuits through visual linking and transitions. We contribute a design space for quantum algorithm design, focusing on the textual and visual elements, interactions, and design patterns throughout the quantum algorithm design process. Informed by the design space, we introduce QuRAFT, a visual interface that facilitates a seamless transition from abstract mathematical expressions to concrete quantum circuits. QuRAFT incorporates a suite of eight integrated visual and interaction designs tailored to support users in the formulation, implementation, and validation process of the quantum algorithm design. Through two detailed case studies and a user evaluation, this paper demonstrates the effectiveness of QuRAFT. Feedback from quantum computing experts highlights the practical utility of QuRAFT in algorithm design and provides valuable implications for future advancements in visualization and interaction design within the quantum computing domain. A free copy of this paper and all supplemental materials are available at https://osf.io/xvzgh/ (opens in a new tab).
Survey summary
From the survey collectionQuRAFT: Enhancing Quantum Algorithm Design by Visual Linking between Mathematical Concepts and Quantum Circuits
Background and motivation
Quantum algorithm development requires researchers to move between mathematical descriptions of states and unitary transformations, circuit diagrams, and executable programs. An expression can concisely describe the intended transformation while leaving its gate sequence, qubit assignment, and intermediate measurements to be implemented separately. QuRAFT addresses this existing translation problem, particularly when reproducing known algorithms, teaching their mechanisms, and combining familiar modules into new prototypes. The paper argues that programming frameworks such as Qiskit and Cirq provide detailed circuit control but still require users to reconstruct the relationships between formulas and code, while graphical circuit editors emphasize gate placement without maintaining explicit links to the mathematical formulation.
Related research includes modular circuit synthesis, template-based circuit simplification, and generated quantum circuits, which primarily address circuit construction or performance. Quantum visualization systems explain states, state evolution, circuit semantics, and quantum neural networks, but these explanations do not themselves provide a workflow for constructing circuits from editable mathematical expressions. The authors also draw on interactive mathematical notation and work linking text with charts or other visual representations. Their contribution applies these ideas to quantum algorithm authoring, making the correspondence between mathematics and circuit components persistent and interactive. It is a design study and prototype for algorithm development, rather than a new quantum algorithm or a general mathematical circuit-synthesis procedure.
Design process and design space
The authors worked with two quantum researchers through literature review, iterative design, and weekly meetings over three months. This collaboration produced four design goals: translate mathematical concepts into circuit routines, compose components according to their logical relationships, support joint review and refinement, and maintain consistency between the formulation and implementation. The workflow covers formulation, implementation, and validation of theoretical or simulated algorithms; hardware testing and debugging are outside its scope.
The design space has four dimensions. Representation Type distinguishes textual mathematical descriptions from visual circuit diagrams, while Quantum Entity distinguishes qubits, states, operators, operations, and measurements. Interaction Complexity distinguishes manipulation of individual entities, groups of entities, and relationships among entities. Action covers generating, editing, moving, focusing, comparing, and using external visualizations. Figure 2 illustrates the correspondence between mathematical symbols and circuit elements, then maps eight design patterns to these dimensions. The framework organizes the prototype's interaction techniques and offers a vocabulary for future tools; the paper does not establish that it exhaustively covers all quantum algorithm design workflows.
Interface and translation from mathematics
QuRAFT is a web-based prototype with four coordinated areas, illustrated in Figure 1. The Quantum Circuit View places gate blocks on horizontal qubit wires, the Math Board presents the corresponding formulas, the Gate Component View provides components for circuit assembly, and the Visualization View displays measurement comparisons. Blue operator highlights in formulas correspond to blue gate blocks, while selection outlines, links, and matching annotations make relationships visible across views. The interface example shows quantum phase estimation, including state preparation, phase kickback, alternative controlled operations, and probability histograms.
The underlying translation mechanism is a rule-based parser that uses regular expressions to recognize common quantum notation in LaTeX strings, including state definitions, unitary matrices, and state transformations. Recognized expressions are converted into structured circuit components. A user-defined matrix is checked for unitarity before becoming a custom gate. For a matrix of size , the gate acts on qubits; this encapsulation does not imply that the system automatically discovers a hardware-native decomposition of an arbitrary matrix. The parser and unitarity check support the implemented mappings, while broader mathematical reasoning is identified as future work.
State Preparation detects an initial-state equation and generates preparation components, such as and gates for the examples in Figure 3A. Users can expand or collapse preparation details and edit the represented values. Math-to-Circuit Mapping turns matrix definitions into individual gates and translates state-transition expressions into sequences of operators with input and output state labels. Selecting a formula highlights its circuit counterpart, and formula edits update the mapping. Figure 3B illustrates both a matrix-defined gate and a symbolic transformation linking an operator to its input and output qubits.
Circuit composition and linked validation
Gate Composition uses shared state labels to suggest how generated components connect. For example, and indicate that the output of supplies the input of . The interface highlights these correspondences while users drag components into position, keeping the related formulas visible. Qubit Arrangement lets users manually reorder qubits to improve layout and reduce crossings, with corresponding changes represented in both the circuit and formulas. These techniques help users assemble a mathematically described circuit; the paper does not present automatic global layout optimization or a proof that every assembled algorithm is correct.
Four further techniques support review and modification, shown schematically in Figure 4. Synchronized Annotation propagates notes and highlights between corresponding formulas and circuit elements, allowing users to mark roles or operations without maintaining separate annotations. State Evolution Tracing highlights the progression of a selected state across formulas and circuit positions and supports editing its transformations. This is a linked selection and tracing mechanism, rather than a separate geometric encoding of the complete quantum state space. Component Replacement lets users activate alternative formulations and their corresponding circuit components while retaining the surrounding context.
Measurement Correlation runs the circuit on a local Qiskit simulator and compares its measurement distribution with a mathematically specified expected distribution. Selecting a state in a formula locates the associated measurement position in the circuit. The result is a histogram over computational basis states, with probability on the vertical axis and visual encodings for the measured and expected outcomes. Figure 5 documents the design's progression from a single distribution through side-by-side and overlapping bars to bars incorporating a similarity encoding. The authors motivate this final encoding as a way to retain comparison information while reducing clutter and ambiguous color overlap. The figure is an illustration of iterative visual design, not an experiment demonstrating superior performance for one histogram design. Agreement between simulated and expected measurements supplies evidence for the selected examples; it does not by itself prove arbitrary circuits equivalent or correct for every input.
Demonstrated algorithm workflows
The first case study follows two experts implementing and modifying Grover's algorithm. They specify the initial state , a controlled-controlled- operation, and a matrix-defined Grover operator, then assemble the generated components. Figure 6 shows the formulas, generated circuit fragments, drag-based composition, and output histograms in a single workflow. The initial implementation produces the expected search result . The experts then replace the matrix-defined operator with gate-level alternatives, observe an equivalent result for one variant and for another, and explore reordering qubits to obtain a variant targeting . This case demonstrates linked construction and comparison of alternatives within a familiar algorithm.
The second case reproduces quantum phase estimation from an existing textbook description. The experts define a controlled unitary by its matrix, initialize qubits, annotate their roles, and compose Hadamard and controlled-unitary operations while comparing intermediate outcomes with the formulas. The linked representations help them examine phase kickback and change the phase parameter. They then explore repeated controlled operations, expand the estimation register, and introduce an inverse quantum Fourier transform to improve estimation precision. These cases illustrate reproduction and modification of established algorithms; they do not demonstrate the discovery of a previously unknown quantum algorithm.
User evaluations and findings
The qualitative evaluation involved ten participants from university quantum computing laboratories who were separate from the experts involved in designing the system. Participants included two undergraduates and eight graduate students, all proficient in Qiskit. After an introduction and tutorial, they reproduced a known algorithm and redesigned part of it, followed by interviews and seven-point Likert ratings. Mean ratings were 6.35 for formulation techniques, 6.3 for implementation techniques, and 6.35 for validation techniques. Usability ratings were also favorable: 6.3 for ease of learning, 6.2 for ease of use, 6.5 for willingness to use the system again, and 6.6 for overall satisfaction. Figure 7 presents the distributions as stacked horizontal bars, grouped by formulation and implementation, validation, and usability. Participants valued the reduced need to switch contexts and the guidance for connecting components, while also requesting undo/redo, better support for larger circuits, and more flexible formula input.
A separate quantitative evaluation used a within-subject comparison with six additional university quantum computing researchers, each with at least one year of relevant experience. Each implemented the same three-qubit quantum phase-estimation task using QuRAFT and using Qiskit in Jupyter Notebook, with IBM Quantum Composer available in the baseline condition. The task supplied mathematical expressions and pseudocode and required formulation, circuit implementation, and validation. The order was counterbalanced, and sessions were separated by several days. Recorded task time and observed errors were the quantitative measures.
Table 1 reports mean completion times of 13.01 minutes for the baseline, with a standard deviation of 3.32 minutes, and 1.16 minutes for QuRAFT, with a standard deviation of 0.45 minutes. The baseline produced seven errors across participants, compared with one using QuRAFT. Baseline errors involved gate placement, qubit assignment, and circuit structure when inserting measurement code; the QuRAFT error concerned the ordering of mathematical expressions. These descriptive results support a substantial reduction in manual work for this small, specified task. The paper reports no inferential statistical test, and the comparison does not establish the same gains for larger algorithms, open-ended invention, industry workflows, or long-term use.
Contributions, limitations, and future directions
The main contributions are the design space connecting mathematical and circuit representations, a working prototype integrating eight techniques across the design workflow, and case-study and user-study evidence about the usefulness of those connections. The design implications emphasize maintaining visible mathematical context, supporting interactions across representations, and giving more assistance when users manipulate relationships among components. Participants also suggested combining frequently paired techniques into higher-level actions.
The authors explicitly limit the demonstrated effectiveness to small circuits and toy problems. More gates and formulas can make both views cluttered, and the participant pool is confined to university laboratories. The prototype requires LaTeX input and predefined parsing rules, and participants identified the lack of undo/redo as a practical shortcoming. The evaluations concern logical design and local simulation rather than noisy hardware execution. Accordingly, the study provides evidence for prototyping and educational workflows without establishing production-scale applicability.
Proposed extensions include abstraction and simplification for larger circuits, integration of code as a third representation, pen and sketch input, and combined actions for recurring interaction sequences. The authors also suggest more sophisticated mappings through machine learning, mathematical reasoning and error checking, and support for noise visualization and error mitigation. These are future directions rather than capabilities evaluated in the reported system.
Cite this work
@article{wen_quraft_2026,
author = {Wen, Zhen and others},
publisher = {IEEE Computer Society},
doi = {10.1109/TVCG.2025.3642559},
issn = {1941-0506},
journal = {IEEE Transactions on Visualization \& Computer Graphics},
keywords = {Quantum algorithm;Visualization;Quantum circuit;Quantum computing;Translation;Logic gates;Quantum state;Quantum entanglement;Machine learning algorithms;Focusing},
month = dec,
number = {01},
pages = {1--15},
title = {{ QuRAFT: Enhancing Quantum Algorithm Design by Visual Linking between Mathematical Concepts and Quantum Circuits }},
year = {2025},
}