Giter Club home page Giter Club logo

learn-qc-with-python-and-qsharp's Introduction

Learn Quantum Computing with Python and Q#
Sample Code

Binder Prebuild Docker images

This repository provides sample code for Learn Quantum Computing with Python and Q# (Dr. Sarah Kaiser and Dr. Chris Granade, Manning Publications), available from Manning Publications, Amazon, and a variety of local resellers.

Below, we provide some instructions on getting started with each sample; please see Appendix A for more details.

Getting Started with Code Samples

The samples for Chapters 2 through 6 are written in Python, while the examples in Chapters 7 and later are written in Q# and are called from either Python or by IQ# Notebooks. All samples can be run in one of two ways, depending on your preferences:

Anaconda

The Anaconda distribution of Python 3 provides the conda package manager to help you install and work with software written in Python. You can use conda and the Quantum Development Kit together to run all of the samples in this book.

Prerequisites:

Once you have all of the prerequisites installed, you can create a conda environment using the configuration provided in this repository:

conda env create -f environment.yml

This will provide all of the Python software you'll need to get started into a new conda environment called qsharp-book. To use this new environment, run conda activate qsharp-book.

If you would optionally like to use IQ# from outside of your conda environment, you can use the .NET Core SDK:

dotnet tool install --global Microsoft.Quantum.IQSharp
dotnet iqsharp install

This step is not required to use the samples shown in the book.

Using devcontainers

If you prefer, you can also use Visual Studio Code and Docker together to automatically configure all of the software required for use with the code samples in this book.

Prerequisites:

For more details about how to install and use Docker, check out Docker in Action, 2nd Edition.

Once you have all of the prerequisites installed, open the folder containing these samples in Visual Studio Code. You should then be prompted to reopen the folder in a development container; if not, press Ctrl+Shift+P (Windows and Linux) or โŒ˜+Shift+P (macOS) to open the command pallet and type "Reopen in Container." This will automatically download and install all software required for use with these samples into a Docker container, and will run Visual Studio Code within that new container.

Known issues:

  • When using a devcontainer, the plotting examples in Chapter 8 and 9 can only be run through Jupyter Notebook, not by running host.py from the command line.
  • To run Jupyter Notebook, use jupyter notebook --ip 0.0.0.0 rather than just jupyter notebook, so as to allow your host operating system to access the Notebook server.

learn-qc-with-python-and-qsharp's People

Contributors

cgranade avatar crazy4pi314 avatar redxe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.