All Projects → microsoft → Quantumkatas

microsoft / Quantumkatas

Licence: mit
Tutorials and programming exercises for learning Q# and quantum computing

Programming Languages

Jupyter Notebook
11667 projects
Q#
14 projects
C#
18002 projects
python
139335 projects - #7 most used programming language
TeX
3793 projects
powershell
5483 projects

Projects that are alternatives of or similar to Quantumkatas

Quantum
Microsoft Quantum Development Kit Samples
Stars: ✭ 3,453 (-7%)
Mutual labels:  jupyter-notebook, quantum-computing, qsharp
Tamburetei
Fazendo de tamburete as cadeiras de [email protected]
Stars: ✭ 177 (-95.23%)
Mutual labels:  hacktoberfest, jupyter-notebook
100daysofmlcode
My journey to learn and grow in the domain of Machine Learning and Artificial Intelligence by performing the #100DaysofMLCode Challenge.
Stars: ✭ 146 (-96.07%)
Mutual labels:  hacktoberfest, jupyter-notebook
Hacktoberfest2020 Contributions
A beginner-friendly project to help you in open-source contributions. Made specifically for contributions in HACKTOBERFEST 2020! Hello World Programs and Algorithms! Please leave a star ⭐ to support this project! ✨
Stars: ✭ 196 (-94.72%)
Mutual labels:  hacktoberfest, jupyter-notebook
Lacmus
Lacmus is a cross-platform application that helps to find people who are lost in the forest using computer vision and neural networks.
Stars: ✭ 142 (-96.18%)
Mutual labels:  hacktoberfest, jupyter-notebook
Jupyter
Stars: ✭ 145 (-96.09%)
Mutual labels:  hacktoberfest, jupyter-notebook
Virgilio
Virgilio is developed and maintained by these awesome people. You can email us virgilio.datascience (at) gmail.com or join the Discord chat.
Stars: ✭ 13,200 (+255.51%)
Mutual labels:  hacktoberfest, jupyter-notebook
Rasa Ptbr Boilerplate
Um template para criar um FAQ chatbot usando Rasa, Rocket.chat, elastic search
Stars: ✭ 128 (-96.55%)
Mutual labels:  hacktoberfest, jupyter-notebook
Naucse.python.cz
Website with learning materials / Stránka s učebními materiály
Stars: ✭ 248 (-93.32%)
Mutual labels:  hacktoberfest, jupyter-notebook
learn-qc-with-python-and-qsharp
Companion code for Learn Quantum Computing with Python and Q# Book by Dr. Sarah Kaiser and Dr. Chris Granade 💖
Stars: ✭ 62 (-98.33%)
Mutual labels:  quantum-computing, qsharp
awesome-qsharp
A curated list of Q# code and resources.
Stars: ✭ 123 (-96.69%)
Mutual labels:  quantum-computing, qsharp
Byte Sized Code
A collection of Jupyter notebooks for learning Python from the ground up.
Stars: ✭ 142 (-96.18%)
Mutual labels:  hacktoberfest, jupyter-notebook
99 Ml Learning Projects
A list of 99 machine learning projects for anyone interested to learn from coding and building projects
Stars: ✭ 139 (-96.26%)
Mutual labels:  hacktoberfest, jupyter-notebook
Sqlcell
SQLCell is a magic function for the Jupyter Notebook that executes raw, parallel, parameterized SQL queries with the ability to accept Python values as parameters and assign output data to Python variables while concurrently running Python code. And *much* more.
Stars: ✭ 145 (-96.09%)
Mutual labels:  hacktoberfest, jupyter-notebook
Dea Notebooks
Repository for Digital Earth Australia Jupyter Notebooks: tools and workflows for geospatial analysis with Open Data Cube and xarray
Stars: ✭ 133 (-96.42%)
Mutual labels:  hacktoberfest, jupyter-notebook
Nlp profiler
A simple NLP library allows profiling datasets with one or more text columns. When given a dataset and a column name containing text data, NLP Profiler will return either high-level insights or low-level/granular statistical information about the text in that column.
Stars: ✭ 181 (-95.13%)
Mutual labels:  hacktoberfest, jupyter-notebook
Pandaset Devkit
Stars: ✭ 121 (-96.74%)
Mutual labels:  hacktoberfest, jupyter-notebook
Mastering Python For Finance Second Edition
Sources codes for: Mastering Python for Finance, Second Edition
Stars: ✭ 127 (-96.58%)
Mutual labels:  hacktoberfest, jupyter-notebook
Hacktoberfest2020
A repo for new open source contributors to begin with open source contribution. Contribute and earn awesome swags.
Stars: ✭ 221 (-94.05%)
Mutual labels:  hacktoberfest, jupyter-notebook
Stock Analysis
Regression, Scrapers, and Visualization
Stars: ✭ 255 (-93.13%)
Mutual labels:  hacktoberfest, jupyter-notebook

Introduction

The Quantum Katas are a collection of self-paced tutorials and programming exercises to help you learn quantum computing and Q# programming.

Each kata is a separate set of exercises that includes:

  • A sequence of tasks progressing from easy to hard. Each task requires you to fill in some code. The first task might require just one line, and the last one might require rather complicated code.
  • A testing framework that sets up, runs, and validates your solutions. Each task is covered by a unit test which initially fails. Once you write the code to make the test pass, you can move on to the next task.
  • Links to quantum computing and Q# reference material you might need to solve the tasks.
  • Hints, reference solutions and detailed explanations to help you if you're stuck.

The Quantum Katas also include tutorials that introduce the learner to the basic concepts and algorithms used in quantum computing, starting with the necessary math (complex numbers and linear algebra). They follow the same pattern of supplementing the theory with Q# demos and hands-on programming exercises.

Table of contents

Learning path

Here is the learning path we suggest you to follow if you are starting to learn quantum computing and quantum programming. Once you're comfortable with the basics, you're welcome to jump ahead to the topics that pique your interest!

Quantum Computing Concepts: Qubits and Gates

Quantum Computing Concepts: Measurements

Q# and Microsoft Quantum Development Kit Tools

Simple Algorithms

Quantum Oracles and Simple Oracle Algorithms

Grover's search algorithm

Tools and libraries/Building up to Shor's algorithm

Entanglement games

Reversible computing

  • Truth tables. Learn to represent and manipulate Boolean functions as truth tables and to implement them as quantum operations.
  • Ripple-carry adder. Build a ripple-carry adder on a quantum computer.

Miscellaneous

For a Q# programming language quick reference sheet, see Q# Language Quick Reference.

Run the katas and tutorials online

The Quantum Katas are now available as Jupyter Notebooks online! See index.ipynb for the list of all katas and tutorials, and instructions for running them online.

While running the Katas online is the easiest option to get started, if you want to save your progress and enjoy better performance, we recommend you to choose the local option.

Run the katas locally

Quantum Development Kit Installation

To use the Quantum Katas locally, you'll need the Quantum Development Kit, available for Windows 10, macOS, and Linux. If you don't already have the Quantum Development Kit installed, see the install guide for the Quantum Development Kit.

If you want to run the katas and tutorials locally as Jupyter Notebooks:

  1. Follow the steps in the QDK install guide for Python and the QDK install guide for Jupyter Notebooks.
  2. Several tutorials require installing additional Python packages:

If you want to run the katas and tutorials locally as Q# projects:

Follow the steps in the QDK install guide for Visual Studio, Visual Studio Code or other editors.

Download the Quantum Katas

If you have Git installed, clone the Microsoft/QuantumKatas repository:

$ git clone https://github.com/Microsoft/QuantumKatas.git

[!TIP] Both Visual Studio 2019 and Visual Studio Code make it easy to clone repositories from within your development environment. For details, see the Visual Studio 2019 and Visual Studio Code documentation.

If you don't have Git installed, download the katas from https://github.com/Microsoft/QuantumKatas/archive/main.zip.

Run a kata as a Jupyter Notebook

The best way to run the katas as Jupyter Notebooks is to navigate to the root folder of the repository and to open index.ipynb using Jupyter:

$ cd QuantumKatas/
$ jupyter notebook index.ipynb

This will open the notebook that contains a list of all katas and tutorials, and you will be able to navigate to the one you want using links.

Note that this will start Jupyter Notebooks server in the same command line window you used to run the command. If you want to keep using that window for navigation, you can launch Jupyter Notebooks server in a new window using the following commands (on Windows):

$ cd QuantumKatas/
$ start jupyter notebook index.ipynb

You can also open an individual notebook directly, but this might render internal links invalid:

$ cd QuantumKatas/tutorials/ComplexArithmetic
$ jupyter notebook ComplexArithmetic.ipynb

Run a kata as a Q# project

Each kata is in its own directory as a self-contained Q# project, solution and Jupyter Notebook triplet. For instance, the BasicGates directory structure is:

QuantumKatas/
  BasicGates/
    README.md                  # Instructions specific to this kata.
    .vscode/                   # Metadata used by Visual Studio Code.
    BasicGates.sln             # Visual Studio 2019 solution file.
    BasicGates.csproj          # Project file used to build both classical and quantum code.
    BasicGates.ipynb           # Jupyter Notebook front-end for this kata.

    Tasks.qs                   # Q# source code that you will fill as you solve each task.
    Tests.qs                   # Q# tests that verify your solutions.
    TestSuiteRunner.cs         # C# source code used to run the Q# tests.
    ReferenceImplementation.qs # Q# source code containing solutions to the tasks.

To open the BasicGates kata in Visual Studio 2019, open the QuantumKatas/BasicGates/BasicGates.sln solution file.

To open the BasicGates kata in Visual Studio Code, open the QuantumKatas/BasicGates/ folder. Press Ctrl + Shift + P (or ⌘ + Shift + P on macOS) to open the Command Palette. Type Open Folder on Windows 10 or Linux or Open on macOS.

[!TIP] Almost all commands available in Visual Studio Code are in the Command Palette. If you get stuck, press Ctrl + Shift + P (or ⌘ + Shift + P on macOS) and start typing to search through all available commands.

You can also launch Visual Studio Code from the command line:

$ code QuantumKatas/BasicGates/

Run kata tests

Once you have a kata open, it's time to run the tests using the following instructions. Initially all tests will fail. Don't panic! Open Tasks.qs and start filling in the code to complete the tasks. Each task is covered by a unit test. Once you fill in the correct code for a task, rebuild the project and re-run the tests, and the corresponding unit test will pass.

Visual Studio 2019

  1. Build the solution.
  2. From the main menu, open Test Explorer (Test > Windows) and select Run All to run all unit tests at once.
  3. Work on the tasks in the Tasks.qs file.
  4. To test your code changes for a task, rebuild the solution and re-run all unit tests using Run All, or run just the test for that task by right-clicking the test and selecting Run Selected Tests.

Visual Studio Code

  1. Press Ctrl + ` (or ⌘ + ` on macOS) to open the integrated terminal. The terminal should open to the kata directory. If it doesn't, navigate to the folder containing the *.csproj file for the kata using cd command.
  2. Run dotnet test in the integrated terminal. This should build the kata project and run all of the unit tests. All of the unit tests should fail.
  3. Work on the tasks in the Tasks.qs file.
  4. To test your code changes for a task, from the integrated terminal run dotnet test again.

For convenience, a tasks.json configuration file exists for each kata. It allows Visual Studio Code to run the build and test steps from the Command Palette. Press Ctrl + Shift + P (or ⌘ + Shift + P on macOS) to open the Palette and type Run Build Task or Run Test Task and press Enter.

Run katas locally with Docker

You can use the included Dockerfile to create a docker image with all the necessary tools to run the katas from the command line or Jupyter.

  1. Install Docker.
  2. Build the docker image and tag it katas:
docker build -t katas .
  1. Run the image in the container named katas-container with interactive command-line and redirect container port 8888 to local port 8888 (needed to run Jupyter):
docker run -it --name katas-container -p 8888:8888 katas /bin/bash
  1. From the same command line that you used to run the container, run the C# version of the BasicGates kata:
cd ~/BasicGates/
dotnet test
  1. Start a Jupyter Notebook within the image for the BasicGates kata:
cd ~/BasicGates/ && jupyter notebook --ip=0.0.0.0 --no-browser
  1. Once Jupyter has started, use your browser to open the kata in notebook format. You will need a token generated by Jupyter when it started on the previous step:
http://localhost:8888/notebooks/BasicGates.ipynb

To exit a docker container without killing it (daemon mode), press Ctrl+P, Ctrl+Q

To re-enter the existing katas-container (in daemon mode):

docker attach katas-container

Once you're done, remove the katas-container:

docker rm --force katas-container

Contributing

This project welcomes contributions and suggestions. See How Can I Contribute? for details.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].