Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
page_type languages products description urlFragment
sample
qsharp
qdk
This sample demonstrates how to use Q# and Python together.
qsharp-with-python

Python Interoperability

This sample demonstrates the use of Python to call into Q# by using the QInfer and QuTiP.

Installation

As this sample demonstrates using Q# and Python together, make sure you have the qsharp package for Python installed first; see the Getting Started with Python guide for details.

If you are using the Anaconda distribution of Python, this can be done automatically by using the environment.yml file provided with this sample:

cd samples/interoperability/python
conda env create -f environment.yml
conda activate python-qsharp

Running the Sample

Once everything is installed, run jupyter notebook to start the Jupyter Notebook interface in your web browser:

jupyter notebook

In the browser, select the python-qsharp-interop.ipynb notebook in your browser to view the sample.

Manifest