Extensible, Efficient Quantum Algorithm Design for Humans.


Yao Logo


Build Status Build status

Extensible, Efficient Quantum Algorithm Design for Humans.


Yao is an open source framework for

  • quantum algorithm design;
  • quantum software 2.0;
  • quantum computation education.

We are in an early-release beta. Expect some adventures and rough edges.


Yao is a julia language package. To install Yao, please open Julia's interactive session (known as REPL) and type ] in the REPL to use the package mode, then type this command:

pkg> add Yao

If you have problem to install the package, please file us an issue.

For CUDA support, see CuYao.jl.

Getting Started

Examples: understand Yao's code for quantum algorithms


  • STABLE — most recently tagged version of the documentation.
  • LATEST — in-development version of the documentation.


Algoritm Zoo

Some quantum algorithms are implemented with Yao in QuAlgorithmZoo.


Yao is a framework with 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.


The study of variational quantum algorithms is gaining popularity. Variational quantum optimization algorithms like quantum circuit Born machine (QCBM), quantum approximate optimization algorithm (QAOA), variational quantum eigensolver (VQE) and quantum circuit learning (QCL) et. al. are promising for near term quantum devices. These algorithms require the flexibility to tune parameters and to leverage circuit patterns such as "arbitrary rotation block" and "CNOT entangler". In a departure from traditional simulators and frameworks, we have designed and developed a framework along with an Intermediate Representation (IR) to represent, simulate and manipulate quantum circuits.

Our design enables:

  • Hierarchical design of quantum algorithms and greater abstraction for quantum circuits
  • Heterogeneous computing
  • Flexibility in dispatch parameters
  • Caching matrix forms to speed up simulation


Yao is a meta package based on several component packages in order to provide a highly modularized architecture, researchers and developers can extend the framework with different component packages for different purposes with minimal effort. The component packages includes:

  • YaoBase Interface definition and basic toolkits for registers.
  • YaoBlocks Standard basic quantum circuit simulator building blocks.
  • YaoArrayRegister Simulated Full Amplitude Quantum Register


To contribute to this project, please open an issue first to discuss with us in case we may not accept your PR.


This project is an effort of QuantumBFS, an open source organization for quantum science. All the contributors are listed in the contributors.

Papers Citing Yao

Variational Quantum Eigensolver with Fewer Qubits, Jin-Guo Liu, Yi-Hong Zhang, Yuan Wan, Lei Wang, https://arxiv.org/abs/1902.02663

Learning and inference on generative adversarial quantum circuits, Jinfeng Zeng, Yufeng Wu, Jin-Guo Liu, Lei Wang, and Jiangping Hu, Phys. Rev. A 99, 052306 – Published 6 May 2019


Yao is released under the Apache 2 license.

First Commit


Last Touched

3 days ago


355 commits