Skip to content
Introductions to key concepts in quantum machine learning, as well as tutorials and implementations from cutting-edge QML research.
Python HTML CSS TeX Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Bugfix for the barren plateau tutorial (#14) Oct 31, 2019
.github added readme Oct 14, 2019
_static update featured carousel Nov 5, 2019
beginner Update advanced usage tutorial with tensor observable feature (#8) Oct 25, 2019
concepts fix broken links Oct 19, 2019
implementations pasted change (#17) Nov 7, 2019
xanadu_theme update featured carousel Nov 5, 2019
.gitignore sphinx rendering issues Oct 16, 2019
LICENSE Initial commit Oct 10, 2019
Makefile added readme Oct 14, 2019 Update Nov 5, 2019
beginner.rst make site more repsonsive Oct 12, 2019
concepts.rst fix broken links Oct 19, 2019 Initial commit Oct 10, 2019
implementations.rst Tutorial coherent vqls (#12) Nov 6, 2019
index.rst update featured carousel Nov 5, 2019
references.bib Initial commit Oct 10, 2019
requirements.txt Bugfix for the barren plateau tutorial (#14) Oct 31, 2019
zreferences.rst Initial commit Oct 10, 2019

Quantum machine learning tutorials and implementations

This repository contains the Python tutorials and implementations available at Content includes:

  • Key concepts of QML. Explore and understand the key concepts underpinning variational quantum circuits and quantum machine learning.

  • Beginner tutorials. Tutorials introduce core QML concepts, including quantum nodes, optimization, and devices, via easy-to-follow examples.

  • Implementations of cutting-edge QML research. Take a deeper dive into quantum machine learning by exploring cutting-edge algorithms on near-term quantum hardware.


You can contribute by submitting a tutorial or a demonstration of a recent quantum machine learning paper/result.

Adding tutorials and implementations

  • Tutorials and demonstrations are written in the form of an executable Python script. Any package listed in requirements.txt you can assume is available to be imported. Matplotlib plots will be automatically rendered and displayed on the QML website.

    Note: try and keep execution time of your script to within 10 minutes.

  • If you would like to write the tutorial using a Jupyter notebook, you can convert the notebook to the required executable Python format by using this script.

  • All tutorials/implementations should have a file name beginning with tutorial_. Beginner tutorials go in the beginner directory, while implementations go in the implementations directory.

  • Restructured Text sections may be anywhere within the script by beginning the comment with 79 hashes (#). These are useful for breaking up large code-blocks.

  • You may add figures within ReST comments by using the following syntax:

    #.. figure:: ../<tutorial type>/<tutorial name>/image.png
    #    :align: center
    #    :width: 90%

    where <tutorial type> is one of beginner or implementation (depending on what content you submitting), and <tutorial name> is a sub-directory with the name of your tutorial.

  • When complete, create a gallery link to your tutorial/implementation, by adding the following to either beginner.rst or implementations.rst:

    .. customgalleryitem::
        :tooltip: An extended description of the tutorial/implementation
        :figure: <tutorial type>/<tutorial name>/thumbnail.png
        :description: :doc:`<build location>/pytorch_noise`

    Here, <build_location> is either tutorial (for beginner tutorials), or app (for implementations).

    You should also add a link to your tutorial to the table of contents, by adding to the end of the .. toctree::.

  • Finally, run your script through the Black Python formatter,

    pip install black
    black -l 100

    and you are ready to submit a pull request!

Tutorial guidelines

While you are free to be as creative as you like with your tutorial or implementation, there are a couple of guidelines to keep in mind.

  • Submissions should include your name (and optionally email) at the top under the title.

  • All contributions must be made under the Apache 2.0 license.

  • The title should be clear and concise, and if an implementation, be similar to the paper that is being implemented.

  • All tutorials/implementations should include a summary below the title. The summary should be 1-3 sentences that makes clear the goal and outcome of the tutorial, and links to any papers/resources used.

  • Code should be clearly commented and explained, either as a ReST-formatted comment or a standard Python comment.

  • Thumbnails should be legible, interesting, and unique --- but not too busy! Any included text should be minimal and legible

  • If your content contains random variables/outputs, a fixed seed should be set for reproducibility.

  • All content must be original or free to reuse subject to license compatibility. For example, if you are implementing someone elses research, reach out first to recieve permission to reproduce exact figures. Otherwise, avoid direct screenshots from papers, and instead refer to figures in the paper within the text.

  • All submissions must pass code review before being merged into the repository.


To build the website locally, simply run make html. The rendered HTML files will now be available in _build/html. Open _build/html/index.html to browse the built site locally.

Note that the above command may take some time, as all tutorials and implementations will be executed and built! Once built, only modified tutorials will be re-executed/re-built.

Alternatively, you may run make html-norun to build the website without executing tutorials/implementations.


If you are having issues, please let us know by posting the issue on our GitHub issue tracker.

We are committed to providing a friendly, safe, and welcoming environment for all. Please read and respect the Code of Conduct.


The materials, tutorials, and implementations in this repository are free and open source, released under the Apache License, Version 2.0.

The file is available under the BSD 3-Clause License with Copyright (c) 2017, Pytorch contributors.

You can’t perform that action at this time.