The goal of this notebooks is to evaluate your pyiron installation - to identify which components are working and which are might need some additional configuration.
import sys
sys.platform # ['linux', 'darwin', 'win32']
'linux'
! conda list pyiron
# packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel pyiron 0.2.11 pyh9f0ad1d_0 conda-forge
List where conda is installed:
import pyiron_atomistics
pyiron_atomistics.__file__ # location where pyiron is installed
'/srv/conda/envs/notebook/lib/python3.7/site-packages/pyiron/__init__.py'
Check pyiron configuration, if pyiron is not configured, configure it using:
python
>>> import pyiron
>>> pyiron.install()
from pyiron_base import Settings
s = Settings()
s._configuration
{'user': 'pyiron', 'resource_paths': ['/home/jovyan/resources'], 'project_paths': ['/home/jovyan/'], 'sql_connection_string': 'sqlite:////home/jovyan/resources/sqlite.db', 'sql_table_name': 'jobs_pyiron', 'sql_view_connection_string': None, 'sql_view_table_name': None, 'sql_view_user': None, 'sql_view_user_key': None, 'sql_file': '/home/jovyan/resources/sqlite.db', 'sql_host': None, 'sql_type': 'SQLite', 'sql_user_key': None, 'sql_database': None, 'project_check_enabled': True, 'disable_database': False}
pyiron restricts the users to execute notebooks only in the project_paths
. We check if the current working directory is part of the project_paths
.
from pyiron_atomistics import Project
pr = Project('.')
NGLView is used for visualisation of atomistic structures. First we check if NGLview was installed using conda:
! conda list nglview
# packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel nglview 2.7.5 pyh5ca1d4c_0 conda-forge
For jupyter notebooks nglview can be installed using:
conda install -c conda-forge nglview
jupyter nbextension install nglview --py --sys-prefix
jupyter nbextension enable nglview --py --sys-prefix
For jupyterlab the installation is slightly different:
conda install -c conda-forge nodejs nglview
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension install nglview-js-widgets
import nglview
nglview.demo() # You should see a molecule which you can rotate in 3D
_ColormakerRegistry()
NGLWidget()
pyiron does not include any simulation codes, these have to be installed separatley:
We start with installing Lammps directly from Anaconda (the conda-forge channel provides the executables for Linux and Mac Os X):
conda install -c conda-forge lammps
For windows Lammps is available from the pyiron conda channel:
conda install -c pyiron lammps
! conda list lammps
# packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel lammps 2020.03.03 py37_mpich_2 conda-forge
from pyiron_atomistics import Project
pr = Project('lammps')
lmp = pr.create_job(pr.job_type.Lammps, 'static')
lmp.structure = pr.create_structure('Fe', 'bcc', 2.55)
lmp.potential = '2008--Hepburn-D-J--Fe-C--LAMMPS--ipr1'
lmp.run() # The job static was saved and received the ID: 1
The job static was saved and received the ID: 1
The conda-forge channel includes the Lammps executables as well as the Lammps library, unfortunatley this is not available for windows. Therefore for Windows we recommend installing pyiron using the Linux subsystem.
from pyiron_atomistics import Project
pr = Project('lammps')
lmp = pr.create_job(pr.job_type.Lammps, 'interactive')
lmp.structure = pr.create_structure('Fe', 'bcc', 2.55)
lmp.potential = '2008--Hepburn-D-J--Fe-C--LAMMPS--ipr1'
lmp.server.run_mode.interactive = True
lmp.run() # The job interactive was saved and received the ID: 1
print(lmp.output.energy_tot) # [-6.38884508]
lmp.run()
print(lmp.output.energy_tot) # [-6.38884508 -6.38884508]
lmp.interactive_close()
The job interactive was saved and received the ID: 1 [-6.38884508 -6.38884508 -6.38884508] [-6.38884508 -6.38884508 -6.38884508 -6.38884508]
The Sphinx DFT code is developed at the MPIE and it can be installed for Linux using the conda-forge channel:
conda install -c conda-forge sphinxdft
! conda list sphinxdft
# packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel sphinxdft 2.6.1 h6ced99e_5 conda-forge
from pyiron_atomistics import Project
pr = Project('sphinx')
lmp = pr.create_job(pr.job_type.Sphinx, 'static')
lmp.structure = pr.create_structure('Fe', 'bcc', 2.55)
lmp.run() # The job static was saved and received the ID: 2
The job static was saved and received the ID: 2 The files are already compressed!
Besides Sphinx is GPAW a second opensource DFT code available for pyiron. For both Mac Os X and Linux GPAW is available from conda-forge available:
conda install -c conda-forge
! conda list gpaw
# packages in environment at /srv/conda/envs/notebook: # # Name Version Build Channel gpaw 19.8.1 py37_nompi_0 conda-forge
from pyiron_atomistics import Project
pr = Project('gpaw')
lmp = pr.create_job(pr.job_type.Gpaw, 'static')
lmp.structure = pr.create_structure('Fe', 'bcc', 2.55)
lmp.run() # The job static was saved and received the ID: 3
The job static was saved and received the ID: 3