MateriApps
物質科学シミュレーションのポータルサイト

現在アプリ掲載数328件

お問合せ / アプリ掲載依頼
    • JP
    • EN
  • MateriApps について
  • レビュー募集
もっと詳しく探す
  • NEWS / 講習会・イベント
  • アプリ一覧
  • アプリ詳細検索
  • キーワード解説
  • レビュー
  • 事例
  • アプリコンシェルジュ
  • インストールしないでアプリを
    試せる「MateriApps LIVE!」

    詳細はこちら
  • MateriApps について
  • レビュー募集
  • プライバシーポリシー
  • お問合せ / アプリ掲載依頼
  • アプリ一覧
  • MateriApps LIVE!

MateriApps LIVE!

  • 公開度:3 ★★★
  • ドキュメント充実度:3 ★★★

OS、エディタ、計算物質科学アプリケーション、可視化ツールなどをおさめた Debian Live Linux システム。物質科学シミュレーションに必要な環境がひとつのパッケージとして提供されている。仮想マシン VirtualBox 上で起動することで、第一原理計算、分子動力学、量子化学計算、格子模型計算などのシミュレーションをすぐに始めることができる。

MateriApps LIVE!上での量子コンピュータシミュレータの実行
Last Update:2025/02/11
あなたはすでに投票済みです!

MateriApps開発チーム

1. はじめに

このレビューでは、MateriAppsで紹介されている様々な量子コンピュータのシミュレータ(blueqat, Cirq, Intel Quantum Simulator, OpenFermion, OpenJij, Qiskit, Qulacs, QuTiP, Strawberry Fields)をMateriApps LIVE!上にインストールし、チュートリアルを実行する方法について解説します。

Pythonベースのシミュレータの場合、Jupyter NotebookやGoogle Colabでの実行が想定されているチュートリアルが多いですが、ここではバッチ処理も想定して、コマンドライン(python3コマンドあるいはipython3コマンド)でPythonインタープリタを起動し、実行してみます。

2. venv環境の準備

ここでは、Pyrhonのvenv環境を新たに作り、その中に量子コンピュータシミュレータをインストールすることにします。ターミナルを開き以下を実行します。

python3 -m venv $HOME/qc
source $HOME/qc/bin/activate
pip3 install --upgrade pip
pip3 install ipython numpy matplotlib pylatexenc

activateを実行すると、シェルのプロンプトが(qc) ...のように変化します。これは、venv環境の中にいることを示しています。venv環境から抜けるときには deactivateを実行します。

3. 必要なライブラリのインストール

sudo apt-get update
sudo apt-get -y install libboost-dev pybind11-dev libssl-dev libffi-dev
パスワードを訊かれるので “live” と入力します

4. blueqat, Cirq, OpenFermion, OpenJij, Qiskit, Qulacs (Python版), QuTiP, Strawberry Fieldsのインストール

pip3を使ってインストールします。1行でインストール完了です。

pip3 install blueqat cirq openfermion openjij qiskit qulacs qutip strawberryfields

5. Intel Quantum Simulatorのインストール

GitHubからソースコードをcloneし、コンパイルを行います。Apple Silicon用のMateriApps LIVE! (Docker版)でコンパイルするには2行目のパッチが必要です。

(cd $HOME/qc && git clone https://github.com/iqusoft/intel-qs.git)
(cd $HOME/qc/intel-qs && curl -sL https://github.com/cmsi/MateriAppsPackages/raw/main/qc/intel-qs.patch | patch -p1)
mkdir $HOME/qc/intel-qs/build
(cd $HOME/qc/intel-qs/build && cmake -DIqsPython=ON .. && make)
cp -fp $HOME/qc/intel-qs/include/* $HOME/qc/include
cp -rp $HOME/qc/intel-qs/build/lib/*.so $HOME/qc/lib/$(python -c "import sys; print('python{}.{}'.format(sys.version_info.major, sys.version_info.minor))")/site-packages
ln -s $HOME/qc/lib/$(python -c "import sys; print('python{}.{}'.format(sys.version_info.major, sys.version_info.minor))")/site-packages/libiqs.so $HOME/qc/lib/

6. Qulacs (C++版)のインストール

こちらもGitHubからソースコードをcloneし、コンパイルを行います。

(cd $HOME/qc && git clone https://github.com/qulacs/qulacs.git)
mkdir $HOME/qc/qulacs/build
(cd $HOME/qc/qulacs/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make)
cp -rfp $HOME/qc/qulacs/include/* $HOME/qc/include/
cp -fp $HOME/qc/qulacs/lib/* $HOME/qc/lib/

7. チュートリアルの実行

Pythonベースのシミュレータの場合は、ターミナルでpython3、あるいはipython3を実行し、コマンドをコピー・ペーストしながら実行していきます。
図を描いた際に、<Figure size 789.163x785.944 with 1 Axes>のような結果のみが表示され実際に図が表示されないときは、直後に_.show() を実行すると図が表示されるはずです。また、<IPython.core.display.Math object>と表示されて数式が表示されないときは、_.dataを実行することで、LaTeXソースコードを表示することができます。

以下のチュートリアルについて、(量子コンピュータの実機を使うものは除き) MateriApps LIVE!上での動作を確認しています。

blueqat: Blueqat Tutorials

  • https://github.com/Blueqat/Blueqat-tutorials

Cirq: Cirq basics

  • https://quantumai.google/cirq/start/basics

Intel Quantum Simulator: Getting started with Intel Quantum Simulator

  • https://github.com/intel/intel-qs/blob/master/tutorials/get_started_with_IQS.cpp
  • https://github.com/intel/intel-qs/blob/master/tutorials/get_started_with_IQS.ipynb
  • C++プログラムのコンパイル方法(例)
    g++ -O3  -I${HOME}/qc/include -Wl,--rpath ${HOME}/qc/lib -L${HOME}/qc/lib example.C -o example -liqs

Qiskit: Learn Quantum Computation using Qiskit

  • English: https://qiskit.org/textbook/preface.html
  • 日本語: https://qiskit.org/textbook/ja/preface.html
  • 実習教材のインストール:
    pip3 install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src

Qiskit: Getting Started with Qiskit

  • https://qiskit.org/documentation/tutorials/circuits/1_getting_started_with_qiskit.html

Qiskit: 量子コンピューティング・ワークブック

  • https://utokyo-icepp.github.io/qc-workbook/welcome.html
  • 単純な量子回路をゼロから書く
  • 実習教材のインストール:
    pip3 install pylatexenc tabulate
    (cd $HOME && git clone https://github.com/UTokyo-ICEPP/qc-workbook.git)
    ln -s $HOME/qc-workbook/source/qc_workbook $HOME

OpenFermion: Introduction to OpenFermion

  • https://quantumai.google/openfermion/tutorials/intro_to_openfermion

OpenJij: OpenJij 入門

  • https://openjij.github.io/OpenJij/tutorial/ja/001-openjij_introduction.html

Qulacs: Python Tutorial

  • http://docs.qulacs.org/en/latest/intro/4.1_python_tutorial.html

Qulacs: C++ Tutorial

  • http://docs.qulacs.org/en/latest/intro/4.2_cpp_tutorial.html
  • C++プログラムのコンパイル方法(例)
    g++ -O3  -fopenmp -I${HOME}/qc/include -L${HOME}/qc/lib example.C -o example -lvqcsim_static -lcppsim_static -lcsim_static

QuTiP: T2 Relaxation

  • https://qutip.org/docs/latest/gallery/build/qip/plot_qip_relaxation.html

Strawberry Fields: Basic tutorial: quantum teleportation

  • https://strawberryfields.ai/photonics/demos/run_teleportation.html

04 / 06

  • 01基本情報
  • 02事例・論文
  • 03講習会
  • 04レビュー
  • 05開発者の声
  • 06このアプリ情報に
    ついてのお問い合わせ
TOP

MateriApps
物質科学シミュレーションのポータルサイト

  • NEWS / 講習会・イベント
  • アプリ一覧
  • アプリ詳細検索
  • キーワード解説
  • 事例
  • アプリコンシェルジュ
  • プライバシーポリシー
お問合せ / アプリ掲載依頼
  • 東京大学 物性研究所 The Institute for Solid State Physics
  • 東京大学 The University of Tokyo
  • CDMSI
  • CCMS

© MateriApps, 2013-2025. All rights reserved.