You are on page 1of 14

Received: 13 April 2021 Revised: 29 June 2021 Accepted: 27 July 2021

DOI: 10.1002/jcc.26740

SOFTWARE NOTE

DJMol: An open-source modeling platform for computational


chemistry and materials science with a Python interpreter

Krishnamohan G. Prasanna1 | Rahul Sunil2 | Kapil Gupta3 | Seung-Cheol Lee3

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

1 | I N T RO DU CT I O N Javascript, Python is currently the most used general-purpose open


source scripting language and it shows more readability, clear syn-
In general, a modeling platform helps to create various data files, tax, support object-oriented programming (OOP), and web support,
including the structure of the system as well as different types of and so on. In this platform, Python is used as a “gluing tool,”
scripts that contain calculational parameters, and so on. Additionally, which combines many routine tasks of molecular modeling. Apart
it enables a user to visualize molecular or crystalline geometries, from adopting the Python language to our software, we inherited
assists to run various levels of modeling calculations, and aids to ana- many non-computational tools of the integrated development envi-
lyze a variety of simulated data with or without post-processing. At ronment (IDE) into the code. An IDE typically has the several appli-
present, not many modeling platforms for computational materials sci- cations needed to analyze, write, debug, and execute a program.
ence and chemistry exist and many of them are not in the public Many of IDE's features can help significantly in the scripting and
domain.1–3 Though most of these programs are developed as desktop post-processing of data. Thus, by combining Python and IDE, a
applications, by the advent of cloud technology, some modeling plat- programmable molecular modeling platform has been developed,
forms are exclusively available in cloud platform.4,5 Here, we present which could connect and interact with standard modeling codes.
a free and open-source modeling program, DJMol, which demon- This platform is coupled with density functional tight binding
strates several features of a standard modeling platform for molecular (DFTB+), Siesta, Atomic Simulation Environment (ASE), and
modeling and computational nanoscience. OpenMD to demonstrate its features,6–9 through a common appli-
Since modeling materials and molecules involve numerous cation programming interface (API). In addition to an easy API, an
interrelated tasks (which can be encapsulated in commands), a integrated Python interpreter allows experienced users to further
scripting language can be applied to “embed” these tasks very use command-line-based or programmatic codes/tools within the
effectively. And among many scripting languages, like Perl or DJMol.

J Comput Chem. 2021;1–14. wileyonlinelibrary.com/journal/jcc © 2021 Wiley Periodicals LLC. 1


2 G. PRASANNA ET AL.

2 | P R O G R A M OV E R V I E W example, it has an advanced source code editor with code completion


utilities, tools for refactoring, version control systems, Git-based col-
In practice, molecular or materials modeling starts with creating geom- laboration tools, etc.) and these utilities can also be used efficiently
etry of the system and necessary input script(s) for a specific program for various modeling or scripting tasks. Moreover, this platform con-
(which usually contains the information on relevant parameters). Simi- sists of a set of independent modular software components called
lar to computer languages, all these scripts follow their syntax, and modules (e.g., an SSH [secure-shell] module to communicate with an
thus a standard programming IDE can be used for its construction, external cloud platform). Apart from this, the program supports plug-
editing, execution, and so on. By integrating this IDE with a suitable ins so that one can selectively add or remove new features into it
molecular or crystal visualizer, a modeling suite can be constructed, (e.g., Python interpreter) without being recompiled the code. Option-
such that it can be used as a workbench to generate different types of ally, users of the code can make their plug-ins, for example, to incor-
molecules, crystals, nanostructure, and so on. Simultaneously unique porate another computational package. See Figure 1 for the
features of an IDE (code completion or syntax checking, organize schematic structure of the program. To the best of our knowledge,
resources, project management, collaboration, etc.) can be effectively DJMol is the first open-source modeling platform that is built from a
utilized in various simulation tasks, such as to explore or analyze text- programming IDE.
based data files. By incorporating Python as a default scripting lan- To display the molecular, crystal, nanostructures a Java library, Jmol,
guage, a programmable modeling platform was created such that it has been embedded into the program13,14 (See Figure 2). The Jmol pro-
can be adequately coupled with a set of open-source utilities and gram is an open-source, cross-platform, and highly independent (i.e., it
scripts in conjunction with popular computational codes such as does not depend on any third-party libraries like Java3D or OpenGL) 3D
DFTB+, Siesta, ASE, and OpenMD. Recently, quantum chemical visualization application. Apart from this, there are two distinct features
modeling suites like Amsterdam Density Functional (ADF)10 used associated with Jmol: (1) Jmol can be programmatically embedded into
Python to simplify their analysis and automation tasks. any Java code, which uses Swing application programming interface (2),
it supports an internal command scripting facility so that a user can con-
trol or manipulate the display or send and retrieve parameters, data,
3 | S O FT W A R E A RC H I T E C T U R E commands, and so on. For example, to manipulate Gaussian cube files a
user can effectively apply this internal scripting ability of Jmol. Unlike
The programming language, Java (version 8) was chosen for this pro- most visualizers, Jmol is capable of perceiving the molecular structure in
ject since it is free, strongly object-oriented, and shows its neutrality three dimensions by applying stereographic projections. Apart from this,
to the various operating systems. OOP is arguably the most popular Jmol consists of a UFF (uniform force field) method and it can be used
software development technique, which effectively manages the com- to pre-optimize a variety of organic as well as inorganic molecules. To
plexity in codedevelopment.11 We preferred Java, since (1) it does not create 2Ddata plots we have used either Matplotlib based scripts or
use pointers and (2) it supports threads implicitly. Although pointers Jfreechart libraries. In the case of 3D data plots, (for example, the poten-
provide direct access to the computer memory, careless use of the tial energy surfaces [PES] or orbital contour diagrams), a Java-based
pointers will easily lead to segmentation faults and other vulnerabil- open-source library jzy3d has been used.
ities. It is our personal opinion that the bugs that emerged from the Although DJMol is mainly programmed in JAVA, a platform-
improper application of pointers are difficult to trace or debug, in agnostic language, its functions and add-ons are depend up on several
addition to this, code with pointers is difficult to translate into other system-dependent. Dynamic linking libraries (DLL) and .EXE (standard
computer languages without the pointer features. Concerning threads, executable) files. Hence, the current Windows-based source code
in this application, we used several threads (i.e., user threads), apart with some modifications needs to be recompiled for the Linux or
from the JVM-generated daemon threads. Since the threads are inher- Mac-OS platform, and the same is undergoing. In the coming future,
ently supported by the language one can readily create a thread by DJMol will be available for Windows, Linux, and Mac-OS.
extending a thread class. Exception handling of Java is equipped with
two types, namely, unchecked and checked exception handling. And
in most of the cases, we used checked exceptions, as it is less tedious 4 | B U I L D I N G A N D I N S T A L LA T I O N
to implement. Note that, apart from using modules, we also developed
several Java classes, which can also be used to adapt or handle other The present version of DJMol is released for Windows operating sys-
external binaries or libraries (e.g., in RunAction class, a generic way to tems with x86-64 architecture. To run the program Java Runtime
execute any external binary file, such as dftb+.exe binary). Environment (JRE with Java version 1.8) should be installed along with
The core of the DJMol application consists of (Apache-) Netbeans a Python interpreter (version 3.7 or later). We have used Netbeans
Platform12 and it can be regarded as the engine behind the 8.2 (64 bit, with JDK 8) version to compile the program or its add-on
Netbeans IDE. In other words, many of the technical features of sources. To build the main application, one needs to compile and build
DJMol program is inherited from Netbeans IDE which is initially the DJMol as a NetBeans platform application. Note that the individ-
designed for developing Java/JavaScript and C/C++ applications and ual add-ons should be compiled separately. The main source file direc-
consists of several utilities to increase the productivity of a user (for tory contains sources for nine different add-ons to produce
G. PRASANNA ET AL. 3

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

TABLE 1 Specifications of the selected post processed data

PESScan\2DPESscanmovie.xyz Geometries of molecules used for the PES


PESScan\2DPESscan.dat Energies and geometries of the PES
PESScan\View2DPES.dat Coordinates (initial, final step size) and PES energy
SCRATCH\MODFTB.dat MO energies in DFTB+
SCRATCH\MOSiesta.dat MO energies in Siesta
SCRATCH\ForceDFTB.dat Cartesian force components in DFTB+
SCRATCH\ForceSiesta.dat Cartesian force components in Siesta
SCRATCH\SCFSiesta.txt SCF convergence in Siesta
SCRATCH\Uvdata_2.csv Fitted UV–Vis data
SCRATCH\Uvdata_1.csv UV–Vis oscillator strength for the spectrum
SCRATCH\MDDFTBmovie.xyz Trajectory of MD in XYZ animation format
SCRATCH\TotalMD.dat Total energies of MD run
SCRATCH\KineticMD.dat Kinetic energies of MD run
SCRATCH\PotentialMD.dat Potential energies of MD run
SCRATCH\VelocityAC.out IR spectrum from MD using velocity autocorrelation
SCRATCH\DipoleAC.out IR spectrum from MD using dipole moment autocorrelation
SCRATCH\StdOrientation.xyz Standard orientation of the given molecule
SCRATCH\MullikenDFTB.dat Mulliken charges from DFTB+
Input\dftb_in.hsd DFTB+ script writer out file
Input\siestaTEMP.fdf Siesta script writer out file
ModesBinary\modes_in.hsd DFTB+ file used to construct vibrational data
ModesBinary\waveplot_in.hsd DFTB+ file used to construct MO and its density data
ModesBinary\modes.xyz DFTB vibrational modes and frequencies
ModesBinary\*.cube DFTB Cube files for MOs and Densities
SiestaApp\SiestaBinary.4.0CygWin64\*.cube Siesta Cube files
SiestaApp\SiestaBinary.4.0.CygWin64\SiestaVibModes.xyz Siesta vibrational modes and frequencies
SiestaApp\SiestaBinary.4.0.CygWin64\BAND.bands Siesta (DFT) bands
SiestaApp\SiestaBinary.4.0.CygWin64\wannier.bands Siesta Wannier bands
SiestaApp\SiestaBinary.4.0.CygWin64\wannier_*.xsf Siesta Wannier orbitals
OpenMD\ All OpenMD in and out files
Database\* All downloaded structural files from online repositories

Abbreviations: DFTB+, density functional tight binding; MO, molecular orbitals; PES, potential energy surfaces; SCF, self-consistent field.
G. PRASANNA ET AL. 9

processes during the dynamics. To generate IR and velocity autocor-


relation spectra from a trajectory file, autocorrelation scripts using
fast Fouriertransform18,19 can be executed. Note that the spectrum
from an MD calculation includes temperature and a harmonic
effects which is absent in the spectra obtained from finite differ-
ence methods using harmonic approximation. To generate radial dis-
tribution function (RDF), an ASE script can be used (see example
directory)—which only requires a Cartesian styled file (i.e., in .xyz
format) that contains the Cartesian position of the atoms at differ-
ent steps of the MD.
A web interface (via the default browser) is supported by this pro-
gram to fetch the structure of the compound or an extended material
from the different online database sources (see Figure 7). Using these
open-access databases for crystal structures (for example, Crystallog-
raphy Open Database, PubChem, or Cambridge Crystallographic Data
Center), crystallographic information file (CIF) or POSCAR files can be
obtained and this can be easily manipulated (by using Jmol scripts)
and modified with a Z-Mat editor if found necessary. In addition to
this, the Nanocut20 package was incorporated into the system to cre-
ate or modify nanosystems such as clusters, fullerenes, crystals, and
so on. For more complex structures one can optionally use
Pymatgen21 or ASE interactive commands in the DJMol.
By considering the importance of cloud-based computing, an
inbuilt tool was implemented to access the remote machines (with
SSH-based connection) to submit PBS jobs as well as to upload and
download files into it (using SCP protocol).It was then tested under
the Google cloud platform with a job scheduler, pbspro. However, an
equivalent, but command-based shell can also be used from Cygwin
environment through the DJMol program. In both cases, the needed
RSA public and private keys were generated by puttygen program
(note that one should always use an openssh format for these keys).
Although the program comes with windows binaries to perform com-
putational calculations, it is strongly recommended that more time-
consuming tasks should be submitted (e.g., finding reaction path/
transition states, growing PES, or molecular dynamics [MD] trajectory
simulations) on remote machines.
Though DJMol supports DFTB+ binaries by default, an add-on
program for Siesta code is included which contains a set of pre- and
post-processing tools. The program Siesta is a DFT code and it uses
numerical atomic orbitals and Order-N methods in conjunction with
pseudopotentials to give faster execution than planewave DFT codes.
F I G U R E 9 Mulliken partial charges of TNT, Wannier orbital of
bulk silicon, and 2D cut of a real wave function of water molecule, Additionally, it can also be used for molecular as well as extended or
and Si Wannier DOS are shown in (A), (B), (C), and (D) subimages, period systems. By using this Siesta module, a user can prepare a set
respectively. DOS, density of states of Siesta's input files (e.g., to perform geometry optimization calcula-
tion). Using this input writer tool, a different set of functionals, basis
sets, methods, and so on, can be added to the template-FDF file
5.5 | Miscellaneous utilities (Siesta script). Note that the Jmol program can visualize FDF data
(both in crystalline as well as molecular structure, except it is fractional
A DFTB-MD analysis module is added to the program which is or z-matrix coordinate). A Siesta Windows binary is integrated into
equipped with real-time monitoring of structure, along with potential, this module so that a user can run Siesta without ever returning to
the kinetic, and total energy of the system at every time step. After the command prompt. To check standard self-consistent field (SCF)
completion of an MD run, the trajectory file can be visualized by an convergence, or to plot MO energies, components of atomic forces,
inbuilt animation-viewer to inspect bond-breaking and formation and so on, some analyzing tools (which intake Siesta's log file) were
10 G. PRASANNA ET AL.

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.

5.6 | Post-processed data

A set of post-processing data from various visualizers or converters


were temporarily stored in different directories and it can be used for
a numerical comparison (e.g., how MO levels of DFTB+ are different
from that of Siesta for a given molecule). Note that all of these data
were stored in the text-based files (like all the temporary files gener-
ated by the DJMol program) and hence it is readily comparable and
can be easily manipulated. Another merit of the text-based data file is
it is platform-independent. It is our personal experience that programs

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

TABLE 2 Files and its descriptions for the DFTB-PES generation

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

Abbreviation: PES, potential energy surfaces.

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.

6.3 | Python scripting with ASE OR CID


Krishnamohan G. Prasanna https://orcid.org/0000-0001-7002-
To demonstrate ASE scripting within the platform, we must create a 4137
Python project (File►New Project►Python►Python Project - Ant) Seung-Cheol Lee https://orcid.org/0000-0002-9741-6955
and save this in a suitable directory. We name the main class as
<phononbulkAl>. The purpose of this ASE calculation is to obtain RE FE RE NCE S
the phonon dispersion for bulk aluminum using a 7  7  7 [1] S. Smidstrup, T. Markussen, P. Vancraeyveld, J. Wellendorff, J.
supercell within the effective medium theory (EMT) as it is Schneider, T. Gunst, B. Verstichel, D. Stradi, P. A. Khomyakov,
U. G. Vej-Hansen, M. Lee, S. T. Chill, F. Rasmussen, G. Penazzi, F.
implemented in ASE. As a result, it will create the band and the
Corsetti, A. Ojanperä, K. Jensen, M. L. N. Palsgaard, U. Martinez, A.
DOS diagram of the system.
Blom, M. Brandbyge, K. Stokbro, J. Phys. Condens. Matter 2020, 32,
The script is provided in the example directory. Once the script is 15901.
ready, use <Run Project> command from the <Run> menu. It will initi- [2] MedeA, https://www.materialsdesign.com, (2020).
ate the ASE engine and produce the band and DOS diagrams. See [3] V. Ganesh, J. Comput. Chem. 2009, 30, 661.
[4] ExaByte, https://exabyte.io, (2020).
Figure 14. Optionally, users can develop their python scripts in this
[5] Materials square, https://www.materialssquare.com, (2020).
project directory for different tasks (e.g., to save the animation of a [6] B. Aradi, B. Hourahine, T. Frauenheim, J. Phys. Chem. A 2007, 111,
particular mode). 5678.
n,
[7] J. M. Soler, E. Artacho, J. D. Gale, A. García, J. Junquera, P. Ordejo
D. Sánchez-Portal, J. Phys. Condens. Matter 2002, 14, 2745.
[8] A. Hjorth Larsen, J. Jørgen Mortensen, J. Blomqvist, I. E. Castelli, R.
7 | C O N CL U S I O N Christensen, M. Dułak, J. Friis, M. N. Groves, B. Hammer, C. Hargus,
E. D. Hermes, P. C. Jennings, P. Bjerre Jensen, J. Kermode, J. R.
An open-source, programmable, atomistic modeling platform, DJMol Kitchin, E. Leonhard Kolsbjerg, J. Kubal, K. Kaasbjerg, S. Lysgaard, J.
Bergmann Maronsson, T. Maxson, T. Olsen, L. Pastewka, A. Peterson,
is designed for modeling materials and molecules in conjunction
C. Rostgaard, J. Schiøtz, O. Schütt, M. Strange, K. S. Thygesen, T.
with a different set of computational chemistry programs with a Vegge, L. Vilhelmsen, M. Walter, Z. Zeng, K. W. Jacobsen, J. Phys.
selected number of pre- and post-processing tools. It is currently Condens. Matter 2017, 29, 273002.
demonstrated with DFTB+, Siesta, OpenMD, and ASE simulation [9] OpenMD, https://github.com/OpenMD/OpenMD (2020).
[10] ADF 2021. SCM, Theoretical Chemistry, Vrije Universiteit, Amster-
engines and a set of modifiable Python scripts. Jmol library is used
dam, The Netherlands, http://www.scm.com.
in visualization and scripting. Git features allow multiple users to [11] B. Strousstrup, Programming: Principles and Practice Using C++, Addi-
work simultaneously on the script files. Other characteristics include son-Wesley, MA, USA 2014.
tools for structure building and creating different types of input data [12] H. Bock, The Definitive Guide to NetBeans Platform 7, Apress, New
files to perform various levels of calculations and analyzing the York, USA 2012.
[13] Jmol: an open-source Java viewer for chemical structures in 3D,
results, including PES. As two important features of this platform, it
http://www.jmol.org, (2020).
uses an extendable IDE framework and it supports Python as its
14 G. PRASANNA ET AL.

[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

You might also like