LoginSignup
1
0

More than 1 year has passed since last update.

Docker, Jupyter-notebookでQiskitを使った量子計算の学習

Last updated at Posted at 2022-04-13

Macで確認しましたが、WindowsでもLinuxでもDockerが使える環境なら使えると思います。

適当なディレクトリを作って、

mkdir qiskit && cd qiskit

適当なテキストエディタでDockerfileとdocker-compose.ymlを作る。

Dockerfile
FROM qiskit/jupyter:0.1

RUN pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src
docker-compose.yml
version: "3.8"
services:
  qiskit-jupyter:
    build: .
    image: qiskit-jupyter
    volumes:
      - ${PWD}/:/home/jovyan/work
    ports:
      - 8888:8888
    container_name: qiskit-jupyter
    environment:
      - JUPYTER_ENABLE_LAB=yes

下の様にコンテナを立ち上げると、

docker-compose up

こんなのが出てくるので、

qiskit-jupyter  |
qiskit-jupyter  |     To access the notebook, open this file in a browser:
qiskit-jupyter  |         file:///home/jovyan/.local/share/jupyter/runtime/nbserver-10-open.html
qiskit-jupyter  |     Or copy and paste one of these URLs:
qiskit-jupyter  |         http://[何か英数字列]:8888/?token=[何か英数字列]
qiskit-jupyter  |      or http://127.0.0.1:8888/?token=[何か英数字列]

http://127.0.0.1:8888/?token=[何か英数字列]の箇所を選択し、URLとしてブラウザで開きます。
Jupyter Notebookが立ち上がるので、後はこのサイトを見て学習

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0