Source-linked AI summary

LIQUi|>: A Software Design Architecture and Domain-Specific Language for Quantum Computing

Dave Wecker, Krysta M. Svore

arXiv:1402.4467v1quant-phcs.ETcs.PL

TL;DR

Quantum computing needs scalable programming and control tools that abstract hardware while supporting algorithm development. LIQUi|⟩ provides an embedded F# domain-specific language with modular compilation, simulation, circuit manipulation, and hardware-oriented backends. The system demonstrates end-to-end factoring of a 14-bit number on a single desktop and identifies further architectural extensions.

  • Problem

    Quantum software architectures need high-level abstractions and scalable tools for controlling hardware and developing quantum algorithms.

  • Method

    LIQUi|⟩ combines an embedded F# domain-specific language with modular circuit tools, simulators, runtimes, and hardware-oriented deployment support.

  • Results

    LIQUi|⟩ fully factored a 14-bit number on a single desktop by simulating an end-to-end implementation of Shor’s algorithm.

  • Takeaways & Limitations

    LIQUi|⟩ provides a modular platform for programming, optimizing, simulating, rendering, and exporting quantum circuits across environments.

  • Takeaways & Limitations

    Programmatic user access to LIQUi|⟩’s qubit creation and destruction was not yet provided, though it was planned for a future version.

Abstract

from arXiv · show

Languages, compilers, and computer-aided design tools will be essential for scalable quantum computing, which promises an exponential leap in our ability to execute complex tasks. LIQUi|> is a modular software architecture designed to control quantum hardware. It enables easy programming, compilation, and simulation of quantum algorithms and circuits, and is independent of a specific quantum architecture. LIQUi|> contains an embedded, domain-specific language designed for programming quantum algorithms, with F# as the host language. It also allows the extraction of a circuit data structure that can be used for optimization, rendering, or translation. The circuit can also be exported to external hardware and software environments. Two different simulation environments are available to the user which allow a trade-off between number of qubits and class of operations. LIQUi|> has been implemented on a wide range of runtimes as back-ends with a single user front-end. We describe the significant components of the design architecture and how to express any given quantum algorithm.

1. Introduction

Quantum computing needs high-level programming abstractions and an architecture for controlling quantum hardware. LIQUi|⟩ addresses this with an embedded F# language and modular tools spanning algorithm development through hardware control.

  • Motivation: Quantum programming requires abstractions that hide hardware details while adding constructs for manipulating quantum states.The paper frames quantum languages as analogous to higher-level classical languages, but requiring quantum-specific programming constructs.
  • Motivation: LIQUi|⟩ targets the grand challenge of designing a system architecture to control quantum hardware.
  • Motivation: Current quantum software architectures lack hardware-control tools and scalable, end-to-end support for algorithm development.LIQUi|⟩ is positioned as an environment covering algorithm writing, visualization, simulation, emulation, and deployment.
  • LIQUi|⟩: LIQUi|⟩ embeds a domain-specific language in F# and provides modular tools for circuit manipulation, simulation, export, and rendering.The architecture also supports noise studies, error correction, circuit optimization, classical control, and architecture-specific constraints.
  • Paper organization: The paper presents LIQUi|⟩’s architecture, quantum programming language, simulators, backends, examples, and a Shor’s algorithm case study.

2. Related Work

Prior quantum languages provide varied imperative, functional, simulation, and circuit-design capabilities. LIQUi|⟩ distinguishes itself through hardware-oriented design, optimized simulation, compilation, and Hamiltonian-model support.

  • Imperative languages: QCL and Q provide imperative quantum programming, but both lack quantum data types and formal semantics.
  • Functional languages: Functional quantum languages offer formal or operational semantics, while the quantum lambda calculus and Quantum IO Monad lack important circuit-design or development tools.
  • Comparison with Quipper: Quipper and LIQUi|⟩ both support extensible circuit description, optimization, classical control, multiple abstraction levels, export, and modularity.The paper notes that their exact implementation details differ.
  • LIQUi|⟩ design: LIQUi|⟩ is designed explicitly for quantum hardware, models qubits as mutable entities with lifetimes, and implements gates in replaceable libraries.
  • Simulation: LIQUi|⟩’s optimized simulators use memory management, cache analysis, parallelization, gate growing, and virtualization to investigate noisy and device-constrained algorithms.
  • Compilation and models: LIQUi|⟩ provides an optimizing compiler that can rewrite circuits while mathematically preserving their unitary operation.It also supports Hamiltonian simulation, including Trotterized circuits and the adiabatic model.

3. Quantum Computation

The paper introduces quantum states, unitary evolution, gates, measurement, teleportation, and hybrid quantum-classical computation. LIQUi|⟩ uses circuit representations to express, manipulate, simulate, and export these algorithms.

  • Qubits and states: A qubit is a superposition of computational-basis states with complex amplitudes whose squared magnitudes determine measurement probabilities.
  • Qubits and states: An n-qubit state uses a 2^n-dimensional state vector, enabling superposition over exponentially many basis states.
  • Gates and measurement: Closed quantum systems evolve through unitary operators, making quantum gates reversible, whereas measurement collapses the state and is not reversible.
  • Quantum circuits: Quantum circuits represent state evolution with qubit wires, classical wires, gates, controlled operations, and measurement symbols.
  • Teleportation: Teleportation combines superposition, entanglement, measurement, and classically controlled gates to transfer quantum information using classical communication.The protocol is illustrated by a circuit auto-generated by LIQUi|⟩.
  • Hybrid computation: Quantum algorithms require hybrid architectures because measurement produces probabilistic classical outputs and later operations may depend on those results.
  • LIQUi|⟩ representation: LIQUi|⟩ uses the universal quantum-circuit representation while supporting conditional operations, parallel execution, model interfaces, target-specific export, and noise investigation.

4. LIQUi|⟩Software Design Architecture

LIQUi|⟩ is a modular quantum-computing architecture with well-defined interfaces linking language, circuit manipulation, simulators, optimizers, and export backends. Its embedded F# language supports extensible quantum operations, circuit extraction, multiple simulation strategies, and several execution modes.

  • Architecture: LIQUi|⟩ uses modular input and output formats to support interoperability with other tools, languages, operating systems, and linear algebra packages.It can import quantum-chemistry orbital integrals and export state vectors, circuits, and compiled unitaries.
  • Architecture: The architecture accepts F#, the F# interpreter, or linkable high-level languages, then compiles programs or routes them through circuit manipulation for simulation, export, or drawing.Available simulators run on Windows clients and servers, including distributed environments.
  • Language: LIQUi|⟩ embeds a domain-specific language in F#, whose static typing and language features support quantum programming while preserving quantum-state constraints.The paper discusses no-cloning, unitary evolution, and the advantages of a functional language with an isolated physical model.
  • Circuit Representation: A Circuit data structure records operations instead of executing them, enabling drawing, parallelization, gate substitution, optimization, export, and re-execution.Qubits identify portions of the Ket, while Gates are applied directly or represented in the extracted circuit.
  • Operations: User-defined Gate functions or class instances can specify rendering and runtime behavior, making operations and subcircuits extensible.WrapOp allows sequential or parallel Gates to form reusable subcircuits, including larger Hamiltonian terms.
  • Optimization and Execution: LIQUi|⟩ provides generation-time circuit optimization and rewriting, including unitary and Hamiltonian optimization, depth optimization, gate replacement, hardware mapping, QECC mapping, and circuit output.Execution-time tools add direct and circuit simulation, noise injection, debugging, and distributed ensemble scheduling.
  • Simulators: The Universal Simulator supports universal quantum and classical operations but requires exponentially growing memory, whereas the Stabilizer Simulator handles Clifford-group operations with memory growing linearly in qubit count.The Universal Simulator can execute millions of gates; roughly 30 qubits fit in 32GB of RAM, while 45 qubits would require more than a petabyte.
  • Execution Modes: Users can run LIQUi|⟩ in test, script, or function mode, trading development flexibility, debugging, startup time, and ease of use.Script mode also supports submission to cloud services, while function mode exposes the full APIs for application development.

5. Code Example: Quantum Teleportation

LIQUi|⟩ expresses quantum teleportation in F# and transforms the program into manipulable circuits that can be optimized, simulated, rendered, and extended with quantum error correction.

  • 5.1 The Circuit: The teleportation example defines reusable EPR and teleport functions over qubit lists, combining Hadamard, CNOT, measurement, and classically controlled corrections.EPR creates entanglement; teleportation measures two qubits and conditionally applies X and Z corrections to the destination.
  • 5.1 The Circuit: LIQUi|⟩compiles the teleport function into a Circuit data structure that can be dumped, manipulated, optimized, run, or rendered.GrowGates combines gates into larger unitaries, while Fold removes identity gates before rendering.
  • 5.2 The Circuit with Error Correction: Quantum error correction replaces logical qubits and gates with encoded physical circuits, reducing logical error probability below an error threshold at substantially higher resource cost.LIQUi|⟩packages support replacing logical circuits with user-selectable QECC protocols involving physical qubits and gates.
  • 5.2 The Circuit with Error Correction: The teleportation circuit supports multiple abstraction levels, with high-level views useful for qubit usage and parallelization and detailed views useful for verifying physical operations.Figures 3 and 4 show quantum error correction layered over teleportation at different levels of detail.
  • 5.2 The Circuit with Error Correction: Switching from the Universal to the Stabilizer simulator enables LIQUi|⟩to model error-corrected circuits with tens of thousands of qubits when stabilizer operations apply.Injected depolarizing errors can be simulated and physical outputs decoded back to logical results; more general non-unitary noise uses the Universal simulator.

6. Shor’s Algorithm in LIQUi|⟩

The paper implements Shor’s algorithm components in LIQUi|⟩, including order finding, inverse QFT, and modular arithmetic, then evaluates optimized simulations across problem sizes. The examples demonstrate circuit compression and substantially improved simulation times, while larger instances remain computationally expensive.

  • 6. Shor’s Algorithm in LIQUi|⟩: Shor’s algorithm combines quantum order finding with modular exponentiation, inverse QFT, and classical post-processing to obtain factors probabilistically.The algorithm may repeat when post-processing fails to produce non-trivial factors.
  • 6.1 Code Example: Order Finding: The inverse QFT is implemented for arbitrary qubit lists using Hadamard gates and controlled adjoint rotations, and its 5-qubit circuit is rendered by LIQUi|⟩.The generated diagram uses controlled adjoint rotations represented through the Cgate, Adj, and R definitions.
  • 6.1 Code Example: Order Finding: Modular exponentiation is constructed from repeated multiplication, which requires modular addition based on quantum Fourier transforms and their inverses.The modular-adder design uses controlled addition subcircuits and QFT/QFT’ transformations.
  • 6.2 Simulation: For N=65, the 17-qubit circuit was compressed from 44,045 to 1,885 gates and executed with classical post-processing in less than a minute.The example produced the factorization 65 = 5x 13.
  • 6.2 Simulation: The largest reported factorization, 8193, used 31 qubits and ran for 43384 minutes (30.1 days), despite gate growing reducing roughly half a million gates per round to 18,000.The result was 8193 = 3 × 2731.
  • 6.2 Simulation: Optimized simulation reduced the 13-bit Shor simulation from 3 years to 4 days, highlighting the importance of optimized simulators and domain-specific tools.The comparison spans an early sequential implementation and later versions using gate growing and optimized memory and inner loops.

7. Conclusions and Future Work

LIQUi|⟩ is a modular quantum software platform supporting circuit simulation, manipulation, rendering, and export across environments. Its future development targets hardware-specific constraints, realistic noise, timing, layout, and expanded error-correction support.

  • LIQUi|⟩ provides a fully architected platform for efficiently simulating complex quantum circuits across different environments.
  • LIQUi|⟩ fully factored a 14-bit number on a single desktop while simulating an end-to-end implementation of Shor’s algorithm.
  • A generated circuit representation supports manipulation and visualization, including quantum modular-addition circuits.
  • The modular system offers three simulator classes, three runtimes, extensible gates, flexible circuit manipulation, and export to classical or quantum back-ends.
  • Future versions plan qubit layout, realistic noise models, gate timing constraints, additional quantum error correction, and architectural constraints such as communication latency and qubit proximity.

B. Large Shor Simulation Run

The large Shor simulation factored 8193 using a 31-qubit circuit and 28 Shor rounds. The run required substantial elapsed time and memory while reducing each round’s circuit for simulation.

  • 8193 was factored using 31 qubits and 28 Shor rounds in an end-to-end simulation.
  • 30.1 days was the reported runtime for the raw factoring log, including 28 rounds with 515,032 gates each.
  • 18,200 gates remained for simulation after gate growing reduced the circuit from the round implementations.
  • 20,430 MB was the logged memory level at the end of the 28-round run.
  • 31 was the maximum entangled-qubit count reported at the end of the run.

C. LIQUi|⟩Built-in Tests

LIQUi|⟩ includes built-in tests spanning entanglement, chemistry, teleportation, eigenvalue checks, circuit drawing, and magnetic-coupling simulations.

  • Built-in tests cover large entanglement experiments from 20 through 33 qubits and repeated 16-qubit entanglement circuits.
  • The test suite includes chemistry and H2O simulations, eigenvalue checks using ARPACK, teleportation tests, EPR circuit rendering, and ferromagnetic-coupling tests.
  • Additional tests evaluate entanglement entropy and other circuit behaviors through named LIQUi|⟩ test routines.

D. Hamiltonian Simulation

LIQUi|⟩ includes a Hamiltonian-simulation package built on its universal modeling simulator, with three primary ways to use that environment.

  • A Hamiltonian-simulation package is included in LIQUi|⟩ and built on top of the universal modeling simulator.
  • The Hamiltonian-simulation environment provides three main usage modes.

D.1 Adiabatic simulator

The adiabatic simulator models time-varying Hamiltonians for adiabatic spin-glass problems, supporting applications from D-Wave modeling to machine-learning algorithms.

  • The adiabatic approach begins in a known σx ground state and continuously moves toward an unknown σz ground state representing the problem solution.

D.2 Fermionic simulator

The fermionic simulator represents electron interactions in molecular models using second-quantized Hamiltonians and supports sophisticated molecular simulations, including H2 and H2O ground-state modeling.

  • The fermionic Hamiltonian is a second-quantized representation of electron interactions in molecular models.
  • LIQUi|⟩ provides gates for number, excitation, Coulomb, exchange, number-excitation, and double-excitation operators.
  • The simulator has been used to implement sophisticated molecular models including H2 and H2O.
  • For water ground-state modeling, the x axis varies oxygen–hydrogen bond length, the y axis varies hydrogen-bond angle, and the z axis gives predicted energy in Hartree.

D.3 Mixing simulators

LIQUi|⟩ can mix adiabatic and fermionic simulators to model time-varying fermionic systems, illustrated by a Hubbard lattice model for high-temperature superconductors.

  • The adiabatic and fermionic simulators can be combined for fermionic simulation of time-varying Hamiltonians.
  • The implementation uses a two-dimensional lattice whose plaquettes are separately evolved into ground states, merged, and separated to test for a superconducting state.
  • The experiment varies the interaction-to-hopping ratio U/t by modeling chemical-composition changes in cuprate copper-oxide layers.
  • Pairing is assessed by measuring the probability of finding three electrons on each plaquette, with pairing indicated by suppression of odd-number probability P33 during annealing.
Loading 1402.4467v1…