4 Star 8 Fork 4

Gitee 极速下载 / QuantumKatas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/Microsoft/QuantumKatas
克隆/下载
Dockerfile 4.67 KB
一键复制 编辑 原始数据 按行查看 历史
Alex Hansen 提交于 2023-09-19 11:43 . update QDK version (#892)
# We use the iqsharp-base image, as that includes
# the .NET Core SDK, IQ#, and Jupyter Notebook already
# installed for us.
FROM mcr.microsoft.com/quantum/iqsharp-base:0.28.302812
# Add metadata indicating that this image is used for the katas.
ENV IQSHARP_HOSTING_ENV=KATAS_DOCKERFILE
# Make sure the contents of our repo are in ${HOME}
# Required for mybinder.org
COPY . ${HOME}
# Run some commands as root
USER root
# Install Python dependencies for the Python visualization and tutorial notebooks
RUN pip install -I --no-cache-dir \
matplotlib \
numpy \
pytest && \
# Give permissions to the jovyan user
chown -R ${USER} ${HOME} && \
chmod +x ${HOME}/scripts/*.sh
# From now on, just run things as the jovyan user
USER ${USER}
RUN cd ${HOME}/ && \
# Install packages needed to submit jobs to hardware separately, since they are not part of any project
dotnet restore ./tutorials/ExploringDeutschJozsaAlgorithm/AQ/ProviderDependencies.csproj
RUN cd ${HOME}/ && \
# `dotnet restore` for each solution to ensure NuGet cache is fully populated
for solution in $(find . -type f -name "*.sln"); do dotnet restore "$solution"; done && \
# Pre-exec notebooks to improve first-use start time
# (the katas that are less frequently used on Binder are excluded to improve overall Binder build time)
./scripts/prebuild-kata.sh BasicGates && \
./scripts/prebuild-kata.sh CHSHGame && \
./scripts/prebuild-kata.sh DeutschJozsaAlgorithm && \
#./scripts/prebuild-kata.sh DistinguishUnitaries && \
#./scripts/prebuild-kata.sh GHZGame && \
#./scripts/prebuild-kata.sh GraphColoring && \
./scripts/prebuild-kata.sh GroversAlgorithm && \
#./scripts/prebuild-kata.sh JointMeasurements && \
#./scripts/prebuild-kata.sh KeyDistribution_BB84 && \
#./scripts/prebuild-kata.sh MagicSquareGame && \
./scripts/prebuild-kata.sh Measurements && \
#./scripts/prebuild-kata.sh PhaseEstimation && \
#./scripts/prebuild-kata.sh QEC_BitFlipCode && \
./scripts/prebuild-kata.sh QFT && \
#./scripts/prebuild-kata.sh RippleCarryAdder && \
#./scripts/prebuild-kata.sh SolveSATWithGrover && \
#./scripts/prebuild-kata.sh SuperdenseCoding && \
./scripts/prebuild-kata.sh Superposition && \
./scripts/prebuild-kata.sh Teleportation && \
#./scripts/prebuild-kata.sh TruthTables && \
# Exclude Unitary patterns, since it times out in Binder prebuild
#./scripts/prebuild-kata.sh UnitaryPatterns && \
./scripts/prebuild-kata.sh tutorials/ComplexArithmetic ComplexArithmetic.ipynb && \
./scripts/prebuild-kata.sh tutorials/ExploringDeutschJozsaAlgorithm DeutschJozsaAlgorithmTutorial_P1.ipynb && \
./scripts/prebuild-kata.sh tutorials/ExploringGroversAlgorithm ExploringGroversAlgorithmTutorial.ipynb && \
./scripts/prebuild-kata.sh tutorials/LinearAlgebra LinearAlgebra.ipynb && \
./scripts/prebuild-kata.sh tutorials/MultiQubitGates MultiQubitGates.ipynb && \
./scripts/prebuild-kata.sh tutorials/MultiQubitSystems MultiQubitSystems.ipynb && \
./scripts/prebuild-kata.sh tutorials/MultiQubitSystemMeasurements MultiQubitSystemMeasurements.ipynb && \
#./scripts/prebuild-kata.sh tutorials/Oracles Oracles.ipynb && \
./scripts/prebuild-kata.sh tutorials/Qubit Qubit.ipynb && \
./scripts/prebuild-kata.sh tutorials/RandomNumberGeneration RandomNumberGenerationTutorial.ipynb && \
./scripts/prebuild-kata.sh tutorials/SingleQubitGates SingleQubitGates.ipynb && \
./scripts/prebuild-kata.sh tutorials/SingleQubitSystemMeasurements SingleQubitSystemMeasurements.ipynb && \
# Exclude VisualizationTools, as %debug cell times out in Binder prebuild
#./scripts/prebuild-kata.sh tutorials/VisualizationTools VisualizationTools.ipynb && \
# To improve performance when loading packages at IQ# kernel initialization time,
# we remove all online sources for NuGet such that IQ# Package Loading and NuGet dependency
# resolution won't attempt to resolve package dependencies again (as it was already done
# during the prebuild steps above).
# The downside is that only packages that were already downloaded to .nuget/packages folder
# will be available to get loaded.
# Users that require loading additional packages should use the iqsharp-base image instead.
rm ${HOME}/NuGet.config && \
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\
<configuration>\
<packageSources>\
<clear />\
</packageSources>\
</configuration>\
" > ${HOME}/.nuget/NuGet/NuGet.Config
# Set the working directory to $HOME (/home/jovyan/)
WORKDIR ${HOME}
# Set default command when running a Docker container instance
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0"]
C#
1
https://gitee.com/mirrors/QuantumKatas.git
git@gitee.com:mirrors/QuantumKatas.git
mirrors
QuantumKatas
QuantumKatas
main

搜索帮助