Skip to content

Commit e507609

Browse files
Update june 2022 (#27)
* Update devcontainer to latest QDK version. * Rerun notebooks inside container. * Update name. * Update for changes in latest QuTiP. * Rebuild devcontainer. * Update GH action. Co-authored-by: Cassandra Granade <[email protected]>
1 parent 7ffb011 commit e507609

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3257
-4940
lines changed

.devcontainer/Dockerfile

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# This Dockerfile is used by the GitHub Action in
2-
# .github/workflows/build-container.yml to build the Docker image used for
3-
# Visual Studio Code remote development, Visual Studio Online.
4-
FROM mcr.microsoft.com/quantum/iqsharp-base:0.17.2105143879
5-
6-
ENV IQSHARP_HOSTING_ENV=QSHARP_BOOK_DEVCONTAINER
7-
8-
USER root
9-
10-
# Install additional system packages from apt.
11-
RUN apt-get -y update && \
12-
apt-get -y install \
13-
g++ && \
14-
apt-get clean && rm -rf /var/lib/apt/lists/
15-
16-
RUN pip install cython \
17-
numpy \
18-
matplotlib \
19-
scipy && \
20-
pip install qutip
21-
22-
USER ${USER}
1+
# This Dockerfile is used by the GitHub Action in
2+
# .github/workflows/build-container.yml to build the Docker image used for
3+
# Visual Studio Code remote development, and for GitHub Codespaces.
4+
FROM mcr.microsoft.com/quantum/iqsharp-base:0.24.210930
5+
6+
ENV IQSHARP_HOSTING_ENV=QSHARP_BOOK_DEVCONTAINER
7+
8+
USER root
9+
10+
# Install additional system packages from apt.
11+
RUN apt-get -y update && \
12+
apt-get -y install \
13+
g++ && \
14+
apt-get clean && rm -rf /var/lib/apt/lists/
15+
16+
RUN pip install cython \
17+
numpy \
18+
matplotlib \
19+
scipy && \
20+
pip install qutip
21+
22+
USER ${USER}

.devcontainer/devcontainer.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{
2-
"image": "sckaiser/learn-qc-with-python-and-qsharp:latest",
3-
"remoteEnv": {
4-
"IQSHARP_HOSTING_ENV": "QSHARP_BOOK_DEVCONTAINER"
5-
},
6-
"extensions": [
7-
"quantum.quantum-devkit-vscode",
8-
"ms-python.python"
9-
]
10-
}
1+
{
2+
"image": "sckaiser/learn-qc-with-python-and-qsharp:latest",
3+
"remoteEnv": {
4+
"IQSHARP_HOSTING_ENV": "QSHARP_BOOK_DEVCONTAINER"
5+
},
6+
"extensions": [
7+
"quantum.quantum-devkit-vscode",
8+
"ms-python.python"
9+
]
10+
}

.github/workflows/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# GitHub Actions Configuration
2-
3-
The files in this folder are used to configure GitHub Actions for use with the code samples in this repository.
4-
For example, `build-devcontainer.yml` provides GitHub with instructions on how to prebuild and deploy these samples so that it is quicker for you to get started learning quantum computing.
5-
If you're interested in how these actions work, please read more on the [GitHub Actions documentation site](https://help.github.com/en/actions).
1+
# GitHub Actions Configuration
2+
3+
The files in this folder are used to configure GitHub Actions for use with the code samples in this repository.
4+
For example, `build-devcontainer.yml` provides GitHub with instructions on how to prebuild and deploy these samples so that it is quicker for you to get started learning quantum computing.
5+
If you're interested in how these actions work, please read more on the [GitHub Actions documentation site](https://help.github.com/en/actions).
+28-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
##
2-
# build-devcontainer.yml: GitHub Actions configuration for building sample
3-
# Docker images.
4-
##
5-
# Copyright (c) Sarah Kaiser and Chris Granade.
6-
# Code sample from the book "Learn Quantum Computing with Python and Q#" by
7-
# Sarah Kaiser and Chris Granade, published by Manning Publications Co.
8-
# Book ISBN 9781617296130.
9-
# Code licensed under the MIT License.
10-
##
11-
12-
on:
13-
- push
14-
name: Prebuild Docker images
15-
16-
jobs:
17-
devcontainer:
18-
runs-on: ubuntu-latest
19-
20-
steps:
21-
- uses: actions/checkout@v2
22-
- uses: elgohr/Publish-Docker-Github-Action@master
23-
with:
24-
name: sckaiser/learn-qc-with-python-and-qsharp
25-
username: ${{ secrets.DOCKER_USERNAME }}
26-
password: ${{ secrets.DOCKER_PASSWORD }}
27-
dockerfile: .devcontainer/Dockerfile
28-
snapshot: true
1+
##
2+
# build-devcontainer.yml: GitHub Actions configuration for building sample
3+
# Docker images.
4+
##
5+
# Copyright (c) Sarah Kaiser and Cassandra Granade.
6+
# Code sample from the book "Learn Quantum Computing with Python and Q#" by
7+
# Sarah Kaiser and Cassandra Granade, published by Manning Publications Co.
8+
# Book ISBN 9781617296130.
9+
# Code licensed under the MIT License.
10+
##
11+
12+
on:
13+
- push
14+
name: Prebuild Docker images
15+
16+
jobs:
17+
devcontainer:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: elgohr/Publish-Docker-Github-Action@v4
23+
with:
24+
name: sckaiser/learn-qc-with-python-and-qsharp
25+
username: ${{ secrets.DOCKER_USERNAME }}
26+
password: ${{ secrets.DOCKER_PASSWORD }}
27+
dockerfile: .devcontainer/Dockerfile
28+
snapshot: true

Dockerfile

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
FROM mcr.microsoft.com/quantum/iqsharp-base:0.17.2105143879
2-
3-
ENV IQSHARP_HOSTING_ENV=QSHARP_BOOK_DOCKERFILE
4-
5-
USER root
6-
7-
# Install additional system packages from apt.
8-
RUN apt-get -y update && \
9-
apt-get -y install \
10-
g++ && \
11-
apt-get clean && rm -rf /var/lib/apt/lists/
12-
13-
RUN pip install cython \
14-
numpy \
15-
matplotlib \
16-
scipy && \
17-
pip install qutip
18-
19-
COPY . ${HOME}
20-
RUN chown -R ${USER} ${HOME}
21-
22-
USER ${USER}
1+
FROM mcr.microsoft.com/quantum/iqsharp-base:0.17.2105143879
2+
3+
ENV IQSHARP_HOSTING_ENV=QSHARP_BOOK_DOCKERFILE
4+
5+
USER root
6+
7+
# Install additional system packages from apt.
8+
RUN apt-get -y update && \
9+
apt-get -y install \
10+
g++ && \
11+
apt-get clean && rm -rf /var/lib/apt/lists/
12+
13+
RUN pip install cython \
14+
numpy \
15+
matplotlib \
16+
scipy && \
17+
pip install qutip
18+
19+
COPY . ${HOME}
20+
RUN chown -R ${USER} ${HOME}
21+
22+
USER ${USER}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Sarah Kaiser and Chris Granade.
3+
Copyright (c) 2019 Sarah Kaiser and Cassandra Granade.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![](https://img.shields.io/github/license/crazy4pi314/learn-qc-with-python-and-qsharp)](https://github.com/crazy4pi314/learn-qc-with-python-and-qsharp/blob/main/LICENSE)
77

88

9-
This repository provides sample code for [_Learn Quantum Computing with Python and Q#_](https://www.manning.com/books/learn-quantum-computing-with-python-and-q-sharp) (Dr. Sarah Kaiser and Dr. Chris Granade, Manning Publications), available from [Manning Publications](https://www.manning.com/books/learn-quantum-computing-with-python-and-q-sharp?a_aid=learn-qc-granade&a_bid=ee23f338), [Amazon](https://www.amazon.com/Learn-Quantum-Computing-Python-hands/dp/1617296139/), and a variety of local resellers.
9+
This repository provides sample code for [_Learn Quantum Computing with Python and Q#_](https://www.manning.com/books/learn-quantum-computing-with-python-and-q-sharp) (Dr. Sarah Kaiser and Dr. Cassandra Granade, Manning Publications), available from [Manning Publications](https://www.manning.com/books/learn-quantum-computing-with-python-and-q-sharp?a_aid=learn-qc-granade&a_bid=ee23f338), [Amazon](https://www.amazon.com/Learn-Quantum-Computing-Python-hands/dp/1617296139/), and a variety of local resellers.
1010

1111
Below, we provide some instructions on getting started with each sample; please see [Appendix A](https://livebook.manning.com/book/learn-quantum-computing-with-python-and-q-sharp/appendix-a?origin=product-toc) for more details.
1212

0 commit comments

Comments
 (0)