Kinect Monte Carlo Simulations Using LAMMPS

Requirements

  • You will need to install VOTCA using the instructions described here

  • Once the installation is completed you need to activate the VOTCA enviroment by running the VOTCARC.bash script that has been installed at the bin subfolder for the path that you have provided for the installation step above

Setting the environment

We will use matplotlib, seaborn and pandas libraries for plotting. You can install it using pip like

[1]:
!pip install seaborn --user
/bin/sh: 1: pip: not found

Notes

  • The ${VOTCASHARE} environmental variable is set to the path that you provided during the VOTCA installation, by the default is set to /usr/local/votca.

  • In Jupyter the ! symbol means: run the following command as a standard unix command

  • In Jupyter the command %env set an environmental variable

Check the mapping

Let us first output .pdb files for the segments, qmmolecules and classical segments in order to check the mapping.

We need to update the mapchecker options.

Now we can run the checker as follows,

[2]:
!xtp_run -e mapchecker -c map_file=system.xml -f state.hdf5
/bin/sh: 1: xtp_run: not found

Site energies and pair energy differences

We will compute the histrogram using resolution_sites of 0.03 eV. See eanalyze options and defaults for more information.

[3]:
!xtp_run -e eanalyze -c resolution_sites=0.03 -f state.hdf5
/bin/sh: 1: xtp_run: not found

In the current work directoy you can see the resulting files,

[4]:
!ls eanalyze*
ls: cannot access 'eanalyze*': No such file or directory

Plotting the energies

We will the previously installed pandas and seaborn library to plot the electron histrogram computed in the previous step,

[5]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
columns = ["E(eV)", "counts"]
df = pd.read_table("eanalyze.pairhist_e.out", comment="#", sep='\s+',names=columns, skiprows=2)
sns.relplot(x="E(eV)", y="counts", ci=None, kind="line", data=df)
plt.plot()
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [5], line 1
----> 1 import pandas as pd
      2 import matplotlib.pyplot as plt
      3 import seaborn as sns

ModuleNotFoundError: No module named 'pandas'

Couplings histrogram

In this step we will analyze the electron/hole couplings, using the ianalyze calculator using the resolution_logJ2 parameter of 0.1 units. See the ianalyze options and defaults for more information about the calculator.

[6]:
!xtp_run -e ianalyze -c resolution_logJ2=0.1 states=e,h -f state.hdf5
/bin/sh: 1: xtp_run: not found

Plotting the coupling histogram

We can now plot the logarithm of the squared coupling for the hole,

[7]:
columns = ["logJ2", "counts"]
df = pd.read_table("ianalyze.ihist_h.out", comment="#", sep='\s+',names=columns, skiprows=2)
sns.relplot(x="logJ2", y="counts", ci=None, kind="line", data=df)
plt.plot()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In [7], line 2
      1 columns = ["logJ2", "counts"]
----> 2 df = pd.read_table("ianalyze.ihist_h.out", comment="#", sep='\s+',names=columns, skiprows=2)
      3 sns.relplot(x="logJ2", y="counts", ci=None, kind="line", data=df)
      4 plt.plot()

NameError: name 'pd' is not defined

KMC simulations of multiple holes or electrons in periodic boundary conditions

Finally, lets do a 1000 seconds KMC simulation for the electron, with a 10 seconds window between output and a field of 10 V/m along the x-axis,

[8]:
!xtp_run -e kmcmultiple -c runtime=1000 outputtime=10 field=10,0,0 carriertype=electron -f state.hdf5
/bin/sh: 1: xtp_run: not found

You can find both the occupation data and the rates for the electron at 300 K, on files occupation.dat and rates.dat, respectively.