#!/usr/bin/env python # coding: utf-8 # # Test your pyiron installation # 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. # # Your operation system # # In[1]: import sys sys.platform # ['linux', 'darwin', 'win32'] # # Test pyiron # Install pyiron from conda-forge: # ``` # conda install -c conda-forge pyiron # ``` # In[2]: get_ipython().system(' conda list pyiron') # ## Install location # List where conda is installed: # In[3]: import pyiron pyiron.__file__ # location where pyiron is installed # ## Your .pyiron configuration # Check pyiron configuration, if pyiron is not configured, configure it using: # ``` # python # >>> import pyiron # >>> pyiron.install() # ``` # In[4]: from pyiron.base.settings.generic import Settings s = Settings() s._configuration # ## Your pyiron working directory # 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`. # In[5]: from pyiron import Project pr = Project('.') # # NGLview for visualizing atomistic structures # NGLView is used for visualisation of atomistic structures. First we check if NGLview was installed using conda: # In[6]: get_ipython().system(' conda list nglview') # 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 # ``` # In[7]: import nglview nglview.demo() # You should see a molecule which you can rotate in 3D # # Simulation codes # pyiron does not include any simulation codes, these have to be installed separatley: # ## Lammps # 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 # ``` # In[8]: get_ipython().system(' conda list lammps') # In[9]: from pyiron import Project pr = Project('lammps') pr.remove_jobs(recursive=True) lmp = pr.create_job(pr.job_type.Lammps, 'static') lmp.structure = pr.create_structure('Fe', 'bcc', 2.55) lmp.potential = 'Fe_C_Hepburn_Ackland_eam' lmp.run() # The job static was saved and received the ID: 1 # ## Lammps interactive # 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. # In[10]: from pyiron import Project pr = Project('lammps') pr.remove_jobs(recursive=True) lmp = pr.create_job(pr.job_type.Lammps, 'interactive') lmp.structure = pr.create_structure('Fe', 'bcc', 2.55) lmp.potential = 'Fe_C_Hepburn_Ackland_eam' 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() # ## Sphinx # 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 # ``` # In[11]: get_ipython().system(' conda list sphinxdft') # In[12]: from pyiron import Project pr = Project('sphinx') pr.remove_jobs(recursive=True) 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 # ## GPAW # 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 # ``` # In[13]: get_ipython().system(' conda list gpaw') # In[14]: from pyiron import Project pr = Project('gpaw') pr.remove_jobs(recursive=True) lmp = pr.create_job(pr.job_type.GpawJob, 'static') lmp.structure = pr.create_structure('Fe', 'bcc', 2.55) lmp.run() # The job static was saved and received the ID: 3 # In[ ]: