Atomistic simulation introduction¶
本Tutorialの扱う、”原子シミュレーション”とはどんなことができるものなのでしょうか?その概要を説明します。
材料のいろいろな性質は、原子レベルで説明することができます。例えば、機械的特性(弾性定数・ヤング率など)・熱物性(比熱など)・粘性・化学反応の起こりやすさ、、、などです。 原子シミュレーションを用いることで、原子を並べたときにどんな風に動くのかを再現したり、そもそも自然界ではどのように原子が並んでいるのかといったことを解析することができます。
説明は追って行うことにして、まずは以下のコードをそのまま流してみましょう。
Initial setup¶
Matlantis環境で以下のコマンドを実行することで、本Tutorialの実行に必要なライブラリをインストールできます。
pfp-api-clientmatlantis-featurespfcc-extras
はMatlantis環境内で提供されているライブラリです。
※pfcc-extrasは、」Package Launcher」からフォルダをコピーし、内部のREADMEに従ってインストールを進めてください。 ※各ライブラリのインストール後、 インストールの反映にkernelの再起動が必要になる場合があります。インストールされたログが出たにもかかわらず、以降のimport が失敗する場合は、上部タブから」Restart kernel…」を選んでkernelの再起動をしてみてください。
[1]:
!pip install -U pfp-api-client matlantis-features pfcc-extras
# !pip install -e ../pfcc-extras # please specify the path
Looking in indexes: https://pypi.org/simple, http://pypi.artifact.svc:8080/simple
Requirement already satisfied: pfp-api-client in /home/jovyan/.py313/lib/python3.13/site-packages (2.6.1)
Requirement already satisfied: matlantis-features in /home/jovyan/.py313/lib/python3.13/site-packages (1.2.2)
Requirement already satisfied: pfcc-extras in /home/jovyan/.py313/lib/python3.13/site-packages (0.14.0)
Requirement already satisfied: ase<4.0.0,>=3.25.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfp-api-client) (3.27.0)
Requirement already satisfied: numpy<3.0.0,>=2.0.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfp-api-client) (2.2.6)
Requirement already satisfied: grpcio<2.0.0,>=1.70.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfp-api-client) (1.76.0)
Requirement already satisfied: protobuf<7.0.0,>=5.29.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfp-api-client) (5.29.5)
Requirement already satisfied: googleapis-common-protos<2.0.0,>=1.60.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfp-api-client) (1.72.0)
Requirement already satisfied: scipy>=1.8.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from ase<4.0.0,>=3.25.0->pfp-api-client) (1.18.0)
Requirement already satisfied: matplotlib>=3.5.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from ase<4.0.0,>=3.25.0->pfp-api-client) (3.11.1)
Requirement already satisfied: typing-extensions~=4.12 in /home/jovyan/.py313/lib/python3.13/site-packages (from grpcio<2.0.0,>=1.70.0->pfp-api-client) (4.16.0)
Requirement already satisfied: pandas>=1.2.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (3.0.5)
Requirement already satisfied: rdkit<=2026.9.1,>=2025.3.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (2026.9.1)
Requirement already satisfied: pymatgen>=2026.3.23 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (2026.5.4)
Requirement already satisfied: pyyaml>=5.4.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (6.0.3)
Requirement already satisfied: tqdm>=4.62.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (4.70.0)
Requirement already satisfied: seekpath==2.2.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (2.2.2)
Requirement already satisfied: ga4mp==2.0.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (2.0.4)
Requirement already satisfied: plotly>=6.1.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (7.2.0)
Requirement already satisfied: kaleido in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (0.2.1)
Requirement already satisfied: anywidget in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (0.9.21)
Requirement already satisfied: reactionstring<0.7.0,>=0.6.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (0.6.0)
Requirement already satisfied: restscan<0.4.0,>=0.3.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from matlantis-features) (0.3.0)
Requirement already satisfied: packaging in /home/jovyan/.py313/lib/python3.13/site-packages (from seekpath==2.2.2->matlantis-features) (26.2)
Requirement already satisfied: spglib>=1.14.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from seekpath==2.2.2->matlantis-features) (2.7.0)
Requirement already satisfied: Pillow in /home/jovyan/.py313/lib/python3.13/site-packages (from rdkit<=2026.9.1,>=2025.3.4->matlantis-features) (12.3.0)
Requirement already satisfied: more-itertools in /home/jovyan/.py313/lib/python3.13/site-packages (from reactionstring<0.7.0,>=0.6.0->matlantis-features) (10.8.0)
Requirement already satisfied: networkx in /home/jovyan/.py313/lib/python3.13/site-packages (from reactionstring<0.7.0,>=0.6.0->matlantis-features) (3.6.1)
Requirement already satisfied: pycryptodomex in /home/jovyan/.py313/lib/python3.13/site-packages (from reactionstring<0.7.0,>=0.6.0->matlantis-features) (3.23.0)
Requirement already satisfied: requests>=2.4.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from reactionstring<0.7.0,>=0.6.0->matlantis-features) (2.34.2)
Requirement already satisfied: nglview in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from pfcc-extras) (4.0)
Requirement already satisfied: ipywidgets in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (8.1.5)
Requirement already satisfied: numpngw in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (0.1.4)
Requirement already satisfied: joblib in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (1.5.3)
Requirement already satisfied: scikit-learn>=1.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (1.7.2)
Requirement already satisfied: statsmodels in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (0.15.0)
Requirement already satisfied: optuna>=3.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (4.9.0)
Requirement already satisfied: pymatgen-core in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (2026.7.27)
Requirement already satisfied: pymatgen-analysis-defects in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (2025.9.26)
Requirement already satisfied: mp-api in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (0.46.2)
Requirement already satisfied: orjson in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (3.11.9)
Requirement already satisfied: mdtraj in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (1.11.1.post1)
Requirement already satisfied: MDAnalysis in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (2.10.0)
Requirement already satisfied: pytz in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (2025.2)
Requirement already satisfied: psutil in /home/jovyan/.py313/lib/python3.13/site-packages (from pfcc-extras) (7.2.2)
Requirement already satisfied: nbformat in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from pfcc-extras) (5.10.4)
Requirement already satisfied: contourpy>=1.0.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (1.3.3)
Requirement already satisfied: cycler>=0.10 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (0.12.1)
Requirement already satisfied: fonttools>=4.28.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (4.63.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (1.5.0)
Requirement already satisfied: pyparsing>=3 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (3.3.2)
Requirement already satisfied: python-dateutil>=2.7 in /home/jovyan/.py313/lib/python3.13/site-packages (from matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (2.9.0.post0)
Requirement already satisfied: alembic>=1.5.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from optuna>=3.1.0->pfcc-extras) (1.17.2)
Requirement already satisfied: colorlog in /home/jovyan/.py313/lib/python3.13/site-packages (from optuna>=3.1.0->pfcc-extras) (6.10.1)
Requirement already satisfied: sqlalchemy>=1.4.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from optuna>=3.1.0->pfcc-extras) (2.0.44)
Requirement already satisfied: Mako in /home/jovyan/.py313/lib/python3.13/site-packages (from alembic>=1.5.0->optuna>=3.1.0->pfcc-extras) (1.3.10)
Requirement already satisfied: narwhals>=1.15.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from plotly>=6.1.1->matlantis-features) (2.24.0)
Requirement already satisfied: bibtexparser in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (1.4.4)
Requirement already satisfied: lxml>=6.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (6.1.1)
Requirement already satisfied: monty>=2026.7.16 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (2026.7.16)
Requirement already satisfied: palettable>=3.3.3 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (3.3.3)
Requirement already satisfied: sympy>=1.3 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (1.14.0)
Requirement already satisfied: tabulate>=0.9.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (0.10.0)
Requirement already satisfied: uncertainties>=3.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-core->pfcc-extras) (3.2.3)
Requirement already satisfied: ruamel.yaml in /home/jovyan/.py313/lib/python3.13/site-packages (from monty>=2026.7.16->pymatgen-core->pfcc-extras) (0.19.1)
Requirement already satisfied: six>=1.5 in /home/jovyan/.py313/lib/python3.13/site-packages (from python-dateutil>=2.7->matplotlib>=3.5.2->ase<4.0.0,>=3.25.0->pfp-api-client) (1.17.0)
Requirement already satisfied: charset_normalizer<4,>=2 in /home/jovyan/.py313/lib/python3.13/site-packages (from requests>=2.4.0->reactionstring<0.7.0,>=0.6.0->matlantis-features) (3.4.9)
Requirement already satisfied: idna<4,>=2.5 in /home/jovyan/.py313/lib/python3.13/site-packages (from requests>=2.4.0->reactionstring<0.7.0,>=0.6.0->matlantis-features) (3.18)
Requirement already satisfied: urllib3<3,>=1.26 in /home/jovyan/.py313/lib/python3.13/site-packages (from requests>=2.4.0->reactionstring<0.7.0,>=0.6.0->matlantis-features) (2.7.0)
Requirement already satisfied: certifi>=2023.5.7 in /home/jovyan/.py313/lib/python3.13/site-packages (from requests>=2.4.0->reactionstring<0.7.0,>=0.6.0->matlantis-features) (2026.7.22)
Requirement already satisfied: threadpoolctl>=3.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from scikit-learn>=1.4->pfcc-extras) (3.6.0)
Requirement already satisfied: greenlet>=1 in /home/jovyan/.py313/lib/python3.13/site-packages (from sqlalchemy>=1.4.2->optuna>=3.1.0->pfcc-extras) (3.2.4)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from sympy>=1.3->pymatgen-core->pfcc-extras) (1.3.0)
Requirement already satisfied: psygnal>=0.8.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from anywidget->matlantis-features) (0.15.0)
Requirement already satisfied: comm>=0.1.3 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipywidgets->pfcc-extras) (0.2.3)
Requirement already satisfied: ipython>=6.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipywidgets->pfcc-extras) (9.7.0)
Requirement already satisfied: traitlets>=4.3.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipywidgets->pfcc-extras) (5.14.3)
Requirement already satisfied: widgetsnbextension~=4.0.12 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipywidgets->pfcc-extras) (4.0.15)
Requirement already satisfied: jupyterlab-widgets~=3.0.12 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipywidgets->pfcc-extras) (3.0.16)
Requirement already satisfied: decorator>=4.3.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (5.2.1)
Requirement already satisfied: ipython-pygments-lexers>=1.0.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (1.1.1)
Requirement already satisfied: jedi>=0.18.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (0.19.2)
Requirement already satisfied: matplotlib-inline>=0.1.5 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (0.2.1)
Requirement already satisfied: pexpect>4.3 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (4.9.0)
Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (3.0.52)
Requirement already satisfied: pygments>=2.11.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (2.19.2)
Requirement already satisfied: stack_data>=0.6.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from ipython>=6.1.0->ipywidgets->pfcc-extras) (0.6.3)
Requirement already satisfied: wcwidth in /home/jovyan/.py313/lib/python3.13/site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython>=6.1.0->ipywidgets->pfcc-extras) (0.2.14)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from jedi>=0.18.1->ipython>=6.1.0->ipywidgets->pfcc-extras) (0.8.5)
Requirement already satisfied: ptyprocess>=0.5 in /home/jovyan/.py313/lib/python3.13/site-packages (from pexpect>4.3->ipython>=6.1.0->ipywidgets->pfcc-extras) (0.7.0)
Requirement already satisfied: executing>=1.2.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets->pfcc-extras) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets->pfcc-extras) (3.0.1)
Requirement already satisfied: pure-eval in /home/jovyan/.py313/lib/python3.13/site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets->pfcc-extras) (0.2.3)
Requirement already satisfied: MarkupSafe>=0.9.2 in /home/jovyan/.py313/lib/python3.13/site-packages (from Mako->alembic>=1.5.0->optuna>=3.1.0->pfcc-extras) (3.0.3)
Requirement already satisfied: GridDataFormats>=0.4.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from MDAnalysis->pfcc-extras) (1.1.0)
Requirement already satisfied: mmtf-python>=1.0.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from MDAnalysis->pfcc-extras) (1.1.3)
Requirement already satisfied: filelock in /home/jovyan/.py313/lib/python3.13/site-packages (from MDAnalysis->pfcc-extras) (3.20.3)
Requirement already satisfied: mda-xdrlib in /home/jovyan/.py313/lib/python3.13/site-packages (from MDAnalysis->pfcc-extras) (0.2.0)
Requirement already satisfied: mrcfile in /home/jovyan/.py313/lib/python3.13/site-packages (from GridDataFormats>=0.4.0->MDAnalysis->pfcc-extras) (1.5.4)
Requirement already satisfied: msgpack>=1.0.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from mmtf-python>=1.0.0->MDAnalysis->pfcc-extras) (1.1.2)
Requirement already satisfied: emmet-core<0.87.2,>=0.87.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from mp-api->pfcc-extras) (0.87.0)
Requirement already satisfied: boto3 in /home/jovyan/.py313/lib/python3.13/site-packages (from mp-api->pfcc-extras) (1.41.0)
Requirement already satisfied: pyarrow>=20.0.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from mp-api->pfcc-extras) (24.0.0)
Requirement already satisfied: deltalake<1.6.0,>=1.4.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from mp-api->pfcc-extras) (1.5.1)
Requirement already satisfied: arro3-core>=0.5.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from deltalake<1.6.0,>=1.4.0->mp-api->pfcc-extras) (0.8.0)
Requirement already satisfied: deprecated>=1.2.18 in /home/jovyan/.py313/lib/python3.13/site-packages (from deltalake<1.6.0,>=1.4.0->mp-api->pfcc-extras) (1.3.1)
Requirement already satisfied: pydantic>=2.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (2.14.3)
Requirement already satisfied: pydantic-settings>=2.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (2.12.0)
Requirement already satisfied: pymatgen-io-validation>=0.1.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (0.1.2)
Requirement already satisfied: pybtex~=0.24 in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (0.25.1)
Requirement already satisfied: blake3 in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (1.0.8)
Requirement already satisfied: inflect in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (7.5.0)
Requirement already satisfied: pubchempy in /home/jovyan/.py313/lib/python3.13/site-packages (from emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (1.0.5)
Requirement already satisfied: latexcodec>=1.0.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from pybtex~=0.24->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (3.0.1)
Requirement already satisfied: wrapt<3,>=1.10 in /home/jovyan/.py313/lib/python3.13/site-packages (from deprecated>=1.2.18->deltalake<1.6.0,>=1.4.0->mp-api->pfcc-extras) (2.0.1)
Requirement already satisfied: annotated-types>=0.6.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pydantic>=2.0->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (0.7.0)
Requirement already satisfied: pydantic-core==2.50.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from pydantic>=2.0->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (2.50.4)
Requirement already satisfied: typing-inspection>=0.4.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from pydantic>=2.0->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (0.4.5)
Requirement already satisfied: python-dotenv>=0.21.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from pydantic-settings>=2.0->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (1.2.1)
Requirement already satisfied: botocore<1.42.0,>=1.41.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from boto3->mp-api->pfcc-extras) (1.41.0)
Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from boto3->mp-api->pfcc-extras) (1.0.1)
Requirement already satisfied: s3transfer<0.15.0,>=0.14.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from boto3->mp-api->pfcc-extras) (0.14.0)
Requirement already satisfied: typeguard>=4.0.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from inflect->emmet-core<0.87.2,>=0.87.0->mp-api->pfcc-extras) (4.5.2)
Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbformat->pfcc-extras) (2.21.1)
Requirement already satisfied: jsonschema>=2.6 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbformat->pfcc-extras) (4.23.0)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbformat->pfcc-extras) (5.7.2)
Requirement already satisfied: attrs>=22.2.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema>=2.6->nbformat->pfcc-extras) (25.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema>=2.6->nbformat->pfcc-extras) (2024.10.1)
Requirement already satisfied: referencing>=0.28.4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema>=2.6->nbformat->pfcc-extras) (0.36.2)
Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema>=2.6->nbformat->pfcc-extras) (0.23.1)
Requirement already satisfied: platformdirs>=2.5 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-core!=5.0.*,>=4.12->nbformat->pfcc-extras) (4.3.6)
Requirement already satisfied: notebook>=7 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nglview->pfcc-extras) (7.3.2)
Requirement already satisfied: jupyterlab>=3 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nglview->pfcc-extras) (4.3.5)
Requirement already satisfied: async-lru>=1.0.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (2.0.4)
Requirement already satisfied: httpx>=0.25.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (0.28.1)
Requirement already satisfied: ipykernel>=6.5.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (6.29.2)
Requirement already satisfied: jinja2>=3.0.3 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (3.1.5)
Requirement already satisfied: jupyter-lsp>=2.0.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (2.2.5)
Requirement already satisfied: jupyter-server<3,>=2.4.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (2.15.0)
Requirement already satisfied: jupyterlab-server<3,>=2.27.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (2.27.3)
Requirement already satisfied: notebook-shim>=0.2 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (0.2.4)
Requirement already satisfied: setuptools>=40.8.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (80.9.0)
Requirement already satisfied: tornado>=6.2.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab>=3->nglview->pfcc-extras) (6.4.2)
Requirement already satisfied: anyio>=3.1.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (4.8.0)
Requirement already satisfied: argon2-cffi>=21.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (23.1.0)
Requirement already satisfied: jupyter-client>=7.4.4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (8.6.3)
Requirement already satisfied: jupyter-events>=0.11.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.12.0)
Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.5.3)
Requirement already satisfied: nbconvert>=6.4.4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (6.5.3)
Requirement already satisfied: overrides>=5.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (7.7.0)
Requirement already satisfied: prometheus-client>=0.9 in /home/jovyan/.py313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.26.0)
Requirement already satisfied: pyzmq>=24 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (26.2.1)
Requirement already satisfied: send2trash>=1.8.2 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.8.3)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.18.1)
Requirement already satisfied: websocket-client>=1.7 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.8.0)
Requirement already satisfied: babel>=2.10 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab-server<3,>=2.27.1->jupyterlab>=3->nglview->pfcc-extras) (2.17.0)
Requirement already satisfied: json5>=0.9.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyterlab-server<3,>=2.27.1->jupyterlab>=3->nglview->pfcc-extras) (0.10.0)
Requirement already satisfied: sniffio>=1.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.3.1)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from argon2-cffi>=21.1->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (21.2.0)
Requirement already satisfied: httpcore==1.* in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from httpx>=0.25.0->jupyterlab>=3->nglview->pfcc-extras) (1.0.7)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from httpcore==1.*->httpx>=0.25.0->jupyterlab>=3->nglview->pfcc-extras) (0.14.0)
Requirement already satisfied: debugpy>=1.6.5 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from ipykernel>=6.5.0->jupyterlab>=3->nglview->pfcc-extras) (1.8.12)
Requirement already satisfied: nest-asyncio in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from ipykernel>=6.5.0->jupyterlab>=3->nglview->pfcc-extras) (1.6.0)
Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (3.2.1)
Requirement already satisfied: rfc3339-validator in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.1.4)
Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.1.1)
Requirement already satisfied: fqdn in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.5.1)
Requirement already satisfied: isoduration in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (20.11.0)
Requirement already satisfied: jsonpointer>1.13 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (3.0.0)
Requirement already satisfied: uri-template in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.3.0)
Requirement already satisfied: webcolors>=24.6.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (24.11.1)
Requirement already satisfied: beautifulsoup4 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (4.13.3)
Requirement already satisfied: bleach in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (6.2.0)
Requirement already satisfied: defusedxml in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.7.1)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.4)
Requirement already satisfied: jupyterlab-pygments in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.3.0)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.8.4)
Requirement already satisfied: nbclient>=0.5.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.10.2)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.5.1)
Requirement already satisfied: tinycss2 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.4.0)
Requirement already satisfied: cffi>=1.0.1 in /home/jovyan/.py313/lib/python3.13/site-packages (from argon2-cffi-bindings->argon2-cffi>=21.1->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (2.0.0)
Requirement already satisfied: pycparser in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi>=21.1->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (2.22)
Requirement already satisfied: soupsieve>1.2 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (2.6)
Requirement already satisfied: webencodings in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from bleach->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (0.5.1)
Requirement already satisfied: arrow>=0.15.0 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (1.3.0)
Requirement already satisfied: types-python-dateutil>=2.8.10 in /usr/local/pyenv/versions/python313/lib/python3.13/site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab>=3->nglview->pfcc-extras) (2.9.0.20241206)
Requirement already satisfied: scikit-image>=0.19.3 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-analysis-defects->pfcc-extras) (0.25.2)
Requirement already satisfied: mp-pyrho>=0.4.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from pymatgen-analysis-defects->pfcc-extras) (0.5.1)
Requirement already satisfied: imageio!=2.35.0,>=2.33 in /home/jovyan/.py313/lib/python3.13/site-packages (from scikit-image>=0.19.3->pymatgen-analysis-defects->pfcc-extras) (2.37.2)
Requirement already satisfied: tifffile>=2022.8.12 in /home/jovyan/.py313/lib/python3.13/site-packages (from scikit-image>=0.19.3->pymatgen-analysis-defects->pfcc-extras) (2025.10.16)
Requirement already satisfied: lazy-loader>=0.4 in /home/jovyan/.py313/lib/python3.13/site-packages (from scikit-image>=0.19.3->pymatgen-analysis-defects->pfcc-extras) (0.4)
Requirement already satisfied: patsy>=0.5.6 in /home/jovyan/.py313/lib/python3.13/site-packages (from statsmodels->pfcc-extras) (1.0.3)
Requirement already satisfied: formulaic>=1.1.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from statsmodels->pfcc-extras) (1.2.2)
Requirement already satisfied: interface-meta>=1.2.0 in /home/jovyan/.py313/lib/python3.13/site-packages (from formulaic>=1.1.0->statsmodels->pfcc-extras) (2.0.1)
MD simulationサンプルの実行¶
以下は、地表の主要な成分である二酸化ケイ素(SiO2結晶)に対してMD (分子動力学)シミュレーションを行うサンプルとなっています。
この時点で、コードの内容は全く理解できていなくて構いません。 「百聞は一見にしかず」ということで、まずは動かして可視化を行ってみます。 (本Tutorialを終える頃にはこのコードが何を行っているのか、簡単にわかるようになるでしょう。)
[2]:
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution, Stationary
from ase.md.verlet import VelocityVerlet
from ase.optimize import BFGS
from ase.io import Trajectory, read
from ase import units
from pfp_api_client.pfp.calculators.ase_calculator import ASECalculator
from pfp_api_client.pfp.estimator import Estimator, EstimatorCalcMode
estimator = Estimator(calc_mode=EstimatorCalcMode.PBE, model_version="v8.0.0")
calculator = ASECalculator(estimator)
atoms = read("../input/SiO2_mp-6930_conventional_standard.cif")
atoms.calc = calculator
opt = BFGS(atoms)
opt.run()
atoms = atoms * (3, 3, 3)
atoms.calc = calculator
# Set the momenta corresponding to T=700K.
MaxwellBoltzmannDistribution(atoms, temperature_K=700.0)
# Sets the center-of-mass momentum to zero.
Stationary(atoms)
# Run MD using the VelocityVerlet algorithm
dyn = VelocityVerlet(atoms, 1.0 * units.fs, trajectory="output/dyn.traj")
def print_dyn():
print(f"Dyn step: {dyn.get_number_of_steps(): >3}, energy: {atoms.get_total_energy():.3f}")
dyn.attach(print_dyn, interval=10)
dyn.run(100)
Step Time Energy fmax
BFGS: 0 14:30:36 -57.072301 0.010032
Dyn step: 0, energy: -1520.919
Dyn step: 10, energy: -1520.865
Dyn step: 20, energy: -1520.875
Dyn step: 30, energy: -1520.892
Dyn step: 40, energy: -1520.879
Dyn step: 50, energy: -1520.877
Dyn step: 60, energy: -1520.884
Dyn step: 70, energy: -1520.886
Dyn step: 80, energy: -1520.879
Dyn step: 90, energy: -1520.884
Dyn step: 100, energy: -1520.884
[3]:
from pfcc_extras.visualize.view import view_ngl
traj = Trajectory("output/dyn.traj")[::5]
view_ngl(traj, representations=["ball+stick"])
[3]:
[4]:
from pfcc_extras.visualize.povray import traj_to_gif, traj_to_apng
from IPython.display import Image
traj_to_apng(traj, "output/sio2-md.png", rotation="30x,30y,30z", clean=True, n_jobs=16, width=600)
Image(url="output/sio2-md.png") # , width=150
[Parallel(n_jobs=16)]: Using backend ThreadingBackend with 16 concurrent workers.
[Parallel(n_jobs=16)]: Done 12 out of 21 | elapsed: 23.5s remaining: 17.7s
[Parallel(n_jobs=16)]: Done 21 out of 21 | elapsed: 31.4s finished
[4]:

上記では分子動力学法とよばれる手法を用いることで、700K の温度環境下でSiO2 結晶の各原子がどのように動くのか、そのダイナミクスを追っています。
上記の例では243原子のシミュレーションを行いました。 体積で約\(3 \times 10^{-27}\)m、長さスケールでみると一辺約 15Å = (\(15 \times 10^{-10}\)m)であり、私達が日常生活で扱っている 1m スケールからすると桁違いにミクロな世界です。
ここで、検討しなければならないこととして、私達が扱っている材料をそのままのスケールでまるごとコンピュータ上でシミュレーションすることはできないということです。グラムオーダーの材料でもアボガドロ数、すなわち \(10^{23}\)オーダーの原子が存在しており、これだけの多くの数の原子をコンピュータ上で扱うことはできないためです。
そのため、原子シミュレーションでは、扱いたい現象に応じて適切なモデリング を行うことにより、自然界と全く同じものをつくりあげるのではなく、所望の現象を再現できるように必要な要素だけを抜き出しコンピュータ上で解析できるサイズの簡易化された系をつくりあげて、計算を進めていくことが必要になります。 モデリングには様々なノウハウが存在しますが、本チュートリアルを通して学んでいくことでできるようになってくるでしょう。
[コラム] モデリング
例えば、地球をシミュレーションしたいと考えたとき、もしも気象に興味があるのであれば地球表面の大気に注目したモデリングが必要になるでしょう。一方でもし地震に興味があれば大気よりも地球の内部構造に集中してモデル化する必要があります。もし地表の環境を再現したければ地球全体ではなく大陸の一部だけを切り出してきて考えることもあるでしょう。
再度、シミュレーション結果を見てみましょう。ここで登場するものは、以下のようなものがあります。
原子
それぞれの原子が元素番号で指定され、xyz座標値をもち、速度を持っています
セル
上記図では立方体で表現されている箱のことで、このセルが周期境界条件に従って無限に続くような系を扱うことができます。
真空中に浮いている分子のようなものを扱う場合には、セル・周期境界条件は必要ありません。 固体のように規則的な構造が続くような系は、周期境界条件を課すことでx, y, z軸(厳密には結晶軸となるa, b, c軸)それぞれの方向に無限に続くような構造を扱えます。
セル・周期境界条件というのは計算理論・モデリングの都合上の人工的な概念です。 結晶構造は、現実では内部で規則正しい構造が続き表面では別の構造をとっていると考えられますが、物質の表面は内部とは異なる特殊な状態であるため、水中や結晶のように物質の内部を扱いたい場合に表面を作ってしまうとしばしば不都合が生じます。そこで、セルという世界の限界を人工的に設定し、右端と左端がつながっているという周期境界条件を課すことによって、表面がなく繰り返し続いていく世界を作り出して問題を扱います。
次節から、こういった構造をPythonプログラムで扱い、原子シミュレーションを行う方法を学んでいきます。