Professional Documents
Culture Documents
DJMol An Open-Source Modeling Platform For Computational
DJMol An Open-Source Modeling Platform For Computational
DOI: 10.1002/jcc.26740
SOFTWARE NOTE
1
Department of Science and Humanities, Mar
Baselios College of Engineering and Abstract
Technology, Trivandrum, Kerala, India We present a modular and extendable software suite, DJMol, for performing molecu-
2
Department of Computer Science, Mar
lar simulations and it is demonstrated with DFTB+, Siesta, Atomic Simulation Envi-
Baselios College of Engineering and
Technology, Trivandrum, Kerala, India ronment, and OpenMD codes. It supports many of the standard features of an
3
Indo-Korea Science and Technology Center, integrated development environment and consists of a structure builder and viewer,
Bengaluru, Karnataka, India
which could be connected with these electronic structure codes along with a set of
Correspondence data analyzers. This program comprises Java and Python modules and its libraries to
Krishnamohan G. Prasanna, Department of
Science and Humanities, Mar Baselios College carry out a different set of modeling tasks in materials science and chemistry. By
of Engineering and Technology, Trivandrum, adopting a Python interpreter into the software, a range of scriptable Python codes,
Kerala 695015, India.
Email: krishna.mohan@mbcet.ac.in such as Pymatgen can be incorporated into this programmable modeling platform.
DJMol, through its common application programming interface (API), supports multi-
Seung-Cheol Lee, Indo-Korea Science and ple modeling codes in the backend and several post-processing tools. It benefits an
Technology Center (IKST), Bangalore-560064,
India. experienced user by increasing efficiency, while a nonexpert user by easy to use API.
Email: seungcheol.lee@ikst.res.in
KEYWORDS
application programming interface, atomistic simulations, molecular modeling, Python
corresponding JAR files (technically this add-on JAR includes all library source programs (like scikit-learn), can be coupled easily with DJMol
[*.jar] files). These JAR files are then placed into the application direc- platform.
tory along with a set of auxiliary files and folders (as it is kept in the To make Windows binaries of DFTB+, OpenMD, and Siesta,
Auxiliary directory). A detailed description of the build process is we used gfortran compiler (from GCC 6.4) as it is available in
included in the manual file. Cygwin environment (version 3.0, 64-bitversion). All these binaries
Though the Python interpreter is a mandated program for running are OpenMP compatible to get benefited from multicore proces-
DJMol, this interpreter can also be used interactively within the pro- sors. However, note that the current version of the program (nei-
gram through a plug-in—and it is highly recommended along with ther the platform nor its Java modules including the Jmol
Matplotlib, Numpy, and Scipy libraries. Several Python (uncompiled) visualizer) is not supported by multicore CPUs.Readme.Install.txt
scripts were used in various data processes and one can modify these file from the documentation page (https://djmolprogram.github.io)
scripts if it is found necessary. By using “pip” utilities, a user can easily can be referred for installation of the binary program and for com-
install these libraries from the internet. Since the application is inter- piling the source from the scratch, Readme.Compile.txt can
nally supported by the Git package repository, many standard open- be used.
(A)
F I G U R E 1 A schematic diagram of
DJMol software architecture
[Correction added on 24 Aug 2021,
after the first online publication:
Missing text restored in Figure 1.] (B)
4 G. PRASANNA ET AL.
F I G U R E 2 A screen shot of the main window (the Top Component) of the program embedded with Jmol visualizer. It also shows the
workspace in the left side along with a console window (bottom window panel)
5 | STRUCTURE OF THE DJMOL the DJMol program can be used as a local repository. Since Git sup-
APPLICATION ports text-based files, one can also use all the different types of input
files generated from the program for the staging and committing
To demonstrate the platform, we have chosen DFTB+ program as processes.
the default electronic structure program for the DJMol. DFTB+ is
considered as an approximate density functional theory (DFT)
method and, generally, it is an order of magnitude faster than other 5.2 | Utility programs
popular DFT implementations. In addition to this program, ASE is
also used to demonstrate the ability of the program for interactive A set of analytical tools were also attached to the program such as
sessions with Python scripting. ASE is, perhaps, the most widely point group (PG) analyzer, force component visualizer. We used a
used free and open-source Python library for performing a wide Java-based symmetrizer15 code to analyze and impose the PGs of
range of simulation tasks in materials science and in quantum chem- a molecule. This program works with Cartesian coordinates and hence
istry and it supports several computational codes (for example, to its data can be easily transformed to other codes. By including Open
find the transition state, or to create phonon density of states Babel library,16 several input as well as output files from various elec-
(DOS) spectra, one can use ASE scripts in conjunction with a suit- tronic structure programs can be converted, back and forth. Currently,
able electronic structure program). more than a hundred file formats are supported by this library (for
example 2D structural formula of an organic compound can be readily
converted into its 3D counterparts).
5.1 | Scripting tools The program also consists of two automated scriptwriter for
DFTB+ and Siesta programs. A batch processing tool is integrated,
Perhaps the most basic feature of this platform is the text editor, and it can be used when a user needs to sequentially execute multiple
which is capable of doing, standard text editing, syntax highlighting, DFTB+ files. A modified version of this tool is used to build a PES
code folding, spell-checks, rectangle selection, and so on. (See scan utility for DFTB+ code (here, a Mopac styled z-matrix is used for
Figure 3). In addition to this, a difference-viewer helps a user to view varying geometries in the internal coordinates).
the differences between two files. Basic refactor tools also have been A Z-Mat Tool is added (as an add-on program) into the platform,
integrated into the system for reverting the data from the previously to manipulate the structure of a molecule in z-matrix format (See
edited file(s). To assist collaboration between researchers, a Git Figure 4). It also uses the OpenBabel library during its conversion
version-control tool has been integrated into the program. In this case, (at present version, Mopac styled z-matrix is used). By using this,
G. PRASANNA ET AL. 5
FIGURE 3 The script editor of the program that displays a python file with syntax highlighting and other tools icons. Workspace is shown in
the left side
the internal coordinates of a molecule (i.e., bond length, bond angle, are created with this library and apart from this, Python's Matplotlib is
and dihedral angle) can be changed without altering the other coor- also used to render 2D graphs.
dinates of the system. To do minor displacements, a selected single
atom can be translated in Cartesian coordinate (in other words, a
selected atom can be displaced into x, y, and z directions, 5.4 | 3D viewers
arbitrarily).
3D tools are used to visualize or generate 3D data (to view MD tra-
jectories or molecular vibrations) or to analyze volumetric data such
5.3 | 2D visualizers as electron density, orbitals, and so on. To create molecular vibra-
tions, Modes binary, is used, which converts the force constant
Several 2D graphs were generated to analyze data. For example, a matrix (or Hessian matrix) into eigenvectors and eigenvalues by
data-fitting program was developed to generate an approximate applying a diagonalization routine. Animations of these vibrational
UV–Vis spectrum, by fitting its oscillator strengths (i.e., absorption modes (with or without or vectors) can be inspected using the
intensities of electronic transitions) with Gaussian, Lorentzian, or molecular vibrations viewer utility. To display Mulliken partial char-
pseudo-Voigt functions. In pseudo-Voigt fitting, we used a weighted ges a subprogram was set up and it read the geometry and the Mul-
superposition of Gaussian and Lorentzian curves.17 The spectrum data liken charges from the out file of DFTB+ calculation and displays
is visualized by using JFreeChart library and it facilitates interactive the atoms in the molecule according to its charges. To generate
mode, saving graphs into various formats. Figure 5 shows energy vari- molecular orbitals (MO) and other volumetric data Waveplot binary
ations of an OpenMD calculation. Though most of the 2D data plots is used. From this one can generate a range of Cube files (e.g., to
visualize total charges, MO, electron densities). These cube files can
6 G. PRASANNA ET AL.
be then displayed by using an orbital viewer as shown in Figure 6. cube files can be converted into JVXL (Jmol voxel) format since it
Note that Jmol is embedded with a cube file manipulating function shows a high-compression ratio with respect to the cube format.
so that it can be rendered the data, for example, translucent or Note that both the Modes and Waveplot programs are auxiliary
opaque surface, depending on its arguments. Furthermore, these codes of DFTB+ program suite.
F I G U R E 4 A z-matrix tool that edit internal coordinates of a molecule (C–C bond is highly exaggerated). Inset shows Mopac styled z-matrix
of the molecule
FIGURE 5 This 2D graph shows variation of energies of an MD run (with OpenMD program)
G. PRASANNA ET AL. 7
FIGURE 6 A MO of water molecule with a list (right side) of CUBE files. MO, molecular orbitals
FIGURE 7 Database files can be retrieved with Jmol library. Here a COD data is fetched and displayed by the database file loader utility
8 G. PRASANNA ET AL.
FIGURE 8 An interface of OpenMD program shows a nanoparticle of gold as it is generated by its nanoparticle builder tool
Abbreviations: DFTB+, density functional tight binding; MO, molecular orbitals; PES, potential energy surfaces; SCF, self-consistent field.
G. PRASANNA ET AL. 9
added into this module. To get 2D or 3D data, the Denchar utility pro- in conjunction with Siesta within this platform. To facilitate this termi-
gram of Siesta is attached in the add-on. By editing the appropriate nal window (either Cygwin or Windows Subsystem for Linux [WSL])
template script a user can readily compute and visualize these data. can be invoked from the platform. An interface to OpenMD package
Since the default 3D data file is in the Xcrysden (or XSF) format, a is included in the program as an add-on application (See Figure 8). This
Python script is used for the conversion.22 A Java library, jzy3d is used GPL-based program is mainly used to perform MD simulations in open
to visualize 2D grid data. systems by using a range of force-field type potentials. This can be
23
An independent program, Wannier90 code, is connected to this applied to a variety of systems including, bio-molecules, inorganic
add-on to obtain maximally localized Wannier functions and its DOS. materials, nanoparticles, and so on. Since OpenMD uses HTML-like
Standard band and DOS diagrams of metals or crystalline compounds input syntax a special text tool is designed to view and edit its input
can also be generated by modifying template files and running Siesta file (to expand and collapse its delimiter, tags, etc.). An OS terminal is
and other auxiliary scripts. For advanced calculation Python packages embedded into this application to execute its commands (with argu-
such as SISL, inelastica, PASTA,24–26 and so on, can be optionally used ments) or to use its Python utilities or commands. Some selected utili-
ties are also added to this interface to analyze energies, MD
trajectories, and so on.
F I G U R E 1 0 The two independent variables of H2O2 PES. The that store intermediate or scratch data in the binary formats hinder
unit of bond length is in angstrom and that of the dihedral angle is in the “error-tracking” process since one cannot generally obtain results
degrees. PES, potential energy surfaces from a broken binary file (e.g., when an MD run crashed after its
FIGURE 11 The convert tool is used to transform Cartesian file into a Mopin file (which essentially contain the z-matrix in Mopac's format)
G. PRASANNA ET AL. 11
F I G U R E 1 2 The converted MOPIN files content is inserted in the below text area and insert the variable name in the appropriate position.
Variable-I represents the O O bond length (starts from 1.2 Å) and variable-II, it H–H dihedral angle (starts with 0.0 )
hundredth-time step, one could not get the geometries of the system O O bond length and the H H dihedral angle (in degrees) as
if the program uses only a binary file to store its trajectory data). A list shown in Figure 10.In first, make the structure of the molecule
of selected post-processed files with their description is shown in (or see example folder for its coordinates); then using the <Convert
Table 1. Figure 9 illustrates some of the post-processed data visualiza- Structure> tool (See Figure 11), convert this XYZ formatted file into
tions from these files. the MOPIN format (which contains an equivalent z-matrix data).
And copy the content of this file into <Build PES HSD> tool and
insert Variable I and Variable II as shown in Figure 12.By clicking
6 | EXAMPLES USING DJMOL the button, <Generate PES HSD Files>, this will generate necessary
APPLICATION HSD (dftb script) files for the DFTB+ program (it may take around
10 min) and copy all of these HSD files into the <SCRATCH> folder
In this section, the DJMol modeling software is demonstrated by (1) (a user can also select any other directory instead of this one) and
creating a PES with DFTB+ calculations, (2) invoking the Siesta pro- then invoke the <Batch ProcessingTool>. This will start DFTB+
gram to calculate Wannier orbitals of bulk silicon, and (3) ASE scripting program to execute all these files and create the PES in the
in interactive mode. <PESScan> folder.
After finishing the batch process, <PESViewer> can be invoked
to get the plot of 2D PES or its contour diagram as shown in
6.1 | Using DFTB+ in DJMol program Figure 13. This utility will also indicate the minimum energy data
point on the PES (in other words from this point one can start
Here, the PES of H2O2 (hydrogen peroxide) molecule is created by geometry optimization to locate local minimum) and its
doing a batch process. To create 2D PES we need two independent corresponding geometry file. Table 2 describes data files in
internal coordinate variables and, arbitrarily, we have chosen the <PESScan> directory.
12 G. PRASANNA ET AL.
F I G U R E 1 3 Different views of the PES of cis-trans conversion of H2O2. Note that the optimum bond length is around 1.48 Å and for
shorter bond lengths the energy minimum is located near to 90.0◦ or 270.0◦. PES, potential energy surfaces. Numerical values of axes were
omitted for clarity
View2DPES.Dat Gives the data intervals in x and y directions and energy as E(x,y) in eV
2DPESscan.dat It contains the sorted file names used in the PES creation with energy (in eV and in Hartree)
2DPESscanmovie. Contains the geometry of the individual molecules in xyz format. It can be visualized/animated with DJMol. This can be used to
xyz construct PES with other programs
F I G U R E 1 4 A screenshot of the python project in the platform. The mainscript (phonon-bulkAl.py) and its console output are shown in the
upper and bottom panels along with the band diagram
G. PRASANNA ET AL. 13
6.2 | Wannier orbitals of bulk silicon using Siesta scripting language. These features give, many technical and compu-
add-on tational flexibilities for an end-user. An experienced user benefits
from several tools available in a single place using an API, also can
In this demonstration, the Siesta add-on is used to obtain Wannier easily integrate command-line based or programmatic codes/tools
orbital and DOS of bulk silicon. Execute the add-on <Siesta Calcula- through a Python interpreter. While a nonexpert user can easily
tor> from the <Execute> menu. This will launch the add-on. Choose perform simulations through easy API. The DJMol program is dis-
<Wannier DOS/Orbitals> from the <Analysis> tab. Click on the but- tributed as free and open-source (GPL) software and its binary and
tons from steps I–VII, one after another. Note that a user can edit the source codes are available at the URL https://djmolprogram.
temple files if found necessary (for example to increase the number of github.io
grid points). Finally, the user can select <Plot Bands> or <View
Wannier Orbitals> or both. This will results in the Wannier DOS and ACKNOWLEDG MENTS
its orbitals, respectively. See Figure 9D for the Wannier DOS which is Fruitful discussions with Dr. Balint Aradi and Prof. Thomas
saved in the <SiestaBinary.4.0.CygWin64> directory. Frauenheim from Bremen Center for Computational Materials Science
Additionally, the Wannier orbitals are saved in the <.XSF> for- (BCCMS), UniversitätBremen, Germany is gratefully acknowledged.
mat which in the same folder. To convert this into CUBE format GPKM would like to thank Indo-Korea science and technology center
and view this, we have to select <View Wannier Orbitals>. This will for a research grant and Google cloud platform (GCP) research credits
give a list of .XSF files and using <Convert CUBE> utility, CUBE program for academic researchers.
files can be generated and these files can be viewed by the option,
<View CUBE>. DATA AVAILABILITY STAT EMEN T
Data in this manuscript will be available upon request.
[14] R. M. Hanson, J. Appl. Crystallogr. 2010, 43, 1250. [21] S. P. Ong, W. D. Richards, A. Jain, G. Hautier, M. Kocher, S. Cholia, D.
[15] R. J. Largent, W. F. Polik, J. R. Schmidt, J. Comput. Chem. 2012, 33, Gunter, V. L. Chevrier, K. A. Persson, G. Ceder, Comp. Mater. Sci.
1637. 2013, 68, 314.
[16] N. M. O'Boyle, R. Guha, E. L. Willighagen, S. E. Adams, J. Alvarsson, [22] LAtticeDYnamic tools, https://github.com/ladyteam/LADYtools, (2020).
J.-C. Bradley, I. V. Filippov, R. M. Hanson, M. D. Hanwell, G. R. [23] A. A. Mostofi, J. R. Yates, G. Pizzi, Y. S. Lee, I. Souza, D. Vanderbilt, N.
Hutchison, C. A. James, N. Jeliazkova, A. S. Lang, K. M. Langner, D. C. Marzari, Comp. Phys. Commun. 2014, 185, 2309.
Lonie, D. M. Lowe, J. Pansanel, D. Pavlov, O. Spjuth, C. Steinbeck, [24] SISL, https://github.com/zerothi/sisl, (2020).
A. L. Tenderholt, K. J. Theisen, P. Murray-Rust, Aust. J. Chem. 2011, [25] inelastica, https://github.com/tfrederiksen/inelastica, (2020).
3, 1. [26] S. Kundu, S. Bhattacharjee, S. C. Lee, M. Jain, Comp. Phys. Commun.
[17] A. Thorne, U. Litzen, Spectrophysics: Principles and Applications, 2018, 233, 261.
Springer, Heidelberg 1997.
[18] Dipole autocorrelation function, https://github.com/LePingKYXK/
Dipole-ACF, (2020).
[19] Velocity autocorrelation function, https://github.com/LePingKYXK/ How to cite this article: K. G. Prasanna, R. Sunil, K. Gupta, S.-
Velocity-ACF,(2020). C. Lee, J. Comput. Chem. 2021, 1. https://doi.org/10.1002/jcc.
[20] Nanocut, https://github.com/aradi/nanocut (2020). 26740