Last active
October 17, 2019 20:35
-
-
Save cgranade/6e1d177dc33f0bb34132319672c149bf to your computer and use it in GitHub Desktop.
Passing parameters from Q# to Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start from the IQ# base image. The definition for this image can be found at | |
# https://github.com/microsoft/iqsharp/blob/master/images/iqsharp-base/Dockerfile. | |
FROM mcr.microsoft.com/quantum/iqsharp-base:0.9.1909.3002 | |
ENV IQSHARP_HOSTING_ENV="cgranade/python-parameters" | |
USER root | |
RUN pip install numpy matplotlib | |
# Make sure the contents of our repo are in ${HOME}. | |
# These steps are required for use on mybinder.org. | |
USER root | |
COPY . ${HOME} | |
RUN chown -R ${USER} ${HOME} | |
# Finish by dropping back to the notebook user. | |
USER ${USER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Sample { | |
open Microsoft.Quantum.Intrinsic; | |
open Microsoft.Quantum.Canon; | |
open Microsoft.Quantum.Measurement; | |
operation SampleBiasedQrng(angle : Double) : Result { | |
using (q = Qubit()) { | |
Ry(angle, q); | |
return MResetZ(q); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment