[ANN] Yao.jl: Extensible, Efficient Quantum Algorithm Design for Humans



A slide show is also available:

Yao is a framework for quantum algorithm design. The package provide Julians the ability to design and test your own quantum algorithm on a classical computer (like your laptop).

Background In near term future, quantum devices for computing will only be able to provide a few noisy physical qubits, and although we have IBM Q and many other cloud service, the resources of testing a quantum algorithm could still be limited. But we can use our classical machines to simulate the quantum and associate us to explore the quantum world! And you will be able to learn and explore quantum computation right on your laptop with up to 25+ simulated qubits (depends on the type of circuit and your machine type).

Features Yao is a framework that is about to have the following features:

  • Extensibility
    • define new operations with a minimum number of methods in principle.
    • extend with new operations on different hardware should be easy, (e.g GPUs, near term quantum devices, FPGAs, etc.)
  • Efficiency
    • comparing with python, julia have no significant overhead on small scale circuit.
    • special optimized methods are dispatched to frequently used blocks.
    • double interfaces “apply!” and “cache server + mat” allow us to choose freely when to sacrifice memory for faster simulation and when to sacrifice the speed to simulate more qubits.
  • Easy to Use
    • As a white-box simulator, rather than using a black box, users will be aware of what their simulation are doing right through the interface.
    • Hierarchical APIs from low abstraction quantum operators to highly abstract circuit block objects.

Benchmarks We beat ProjectQ on several benchmarks which could be crucial to classical simulation of a quantum computer. The whole project is implemented in pure Julia, and we achieve much better performance in small number of qubits and similar performance for large number of qubits. However, we are not able to beat all the gates comparing to ProjectQ’s C++ backend, which is only because of we have not optimized them. We will provide more optimization in the following version. For detailed benchmark, please check our docs: https://quantumbfs.github.io/Yao.jl/latest/dev/benchmark/

Please check our README for more info. Questions, Issues and Suggestions are welcome.


ProjectQ is a state of art quantum simulator, it kept the record of 45 qubit quantum circuit simulation for several months: https://arxiv.org/abs/1704.01127
It uses parallisms like SIMD, OpenMP, MPI to speed up calculation.

From the benchmark, we see both the Yao and ProjectQ are close to the theoretical bound in performance.

ProjectQ has C++ backend, while Yao.jl uses pure julia. Yao.jl has significantly less overhead than ProjectQ, which benefits from julia’s jit and multile dispatch.

In some benchmarks, like repeated blocks, Yao.jl can perform much better, this is an algorithmic win. Thanks to julia’s multiple dispatch, we can dispatch any advanced-speciallized algortihm to push the performance for frequently used gates easily, without touching the backend!