\hypertarget{mdi_ecosystem_ecosystem_overview}{}\doxysection{Overview}\label{mdi_ecosystem_ecosystem_overview}
This section provides basic usage instructions for the drivers, engines, and other codes that compose the M\+DI ecosystem.\hypertarget{mdi_ecosystem_ecosystem_lammps}{}\doxysection{L\+A\+M\+M\+PS}\label{mdi_ecosystem_ecosystem_lammps}
To use L\+A\+M\+M\+PS as an engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Acquire and compile L\+A\+M\+M\+PS, following the \href{https://lammps.sandia.gov/doc/Build.html}{\texttt{ L\+A\+M\+M\+PS build guide}}. You will need to \href{https://docs.lammps.org/Build_extras.html}{\texttt{ enable the U\+S\+E\+R-\/\+M\+DI package}} when building L\+A\+M\+M\+PS.
\item Prepare a L\+A\+M\+M\+PS input file that specifies the initial molecular geometry of the system, the force field to be used, and any other desired settings. At the end of the input file, call the {\bfseries{mdi/engine}} command, which does not accept any arguments. For example\+: \begin{DoxyVerb}units           real
neigh_modify    delay 0 every 1 check yes
atom_style      full
bond_style      harmonic
angle_style     harmonic
pair_style      lj/cut/coul/long 10.0
pair_modify     mix arithmetic
kspace_style    pppm 1e-4
special_bonds   amber

atom_modify     sort 0 0

read_data       lammps.data

timestep        1.0

dump            1 all custom 1 dump.lammpstrj id element xu yu zu
dump            2 all custom 1 dump.force id element fx fy fz
dump            3 all xyz 1 dump.xyz
dump_modify     1 element O H
dump_modify     2 element O H

thermo_style    multi
thermo          1

fix             1 all nvt temp 300.0 300.0 70.0
fix             2 all shake 0.0001 20 0 b 1 a 1

mdi/engine
\end{DoxyVerb}

\item Launch L\+A\+M\+M\+PS using the "{\ttfamily -\/mdi"} runtime option, which is described in \mbox{\hyperlink{library_page_library_launching_sec}{Launching Codes with the M\+DI Library}}. For example\+: \begin{DoxyVerb}lammps -in lammps.in -mdi "-role ENGINE -name my_name -method TCP -port 8021 -hostname localhost" &
\end{DoxyVerb}

\end{DoxyEnumerate}\hypertarget{mdi_ecosystem_ecosystem_openmm}{}\doxysection{Open\+MM}\label{mdi_ecosystem_ecosystem_openmm}
\href{https://github.com/taylor-a-barnes/MDI_OpenMM_Plugin}{\texttt{ An M\+DI plugin}} for \href{http://openmm.org/}{\texttt{ Open\+MM}} is available that enables Open\+MM to be run as an M\+DI engine. To use Open\+MM as an engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Install Open\+MM
\item Install the Open\+MM M\+DI plugin
\item Prepare Open\+MM input files that specify the initial molecular geometry of the system and any other desired settings.
\item In the Open\+MM run script, replace the normal call to {\ttfamily Simulation} with a call to {\ttfamily M\+D\+I\+Simulation}, which requires a new argument that corresponds to the M\+DI runtime options. For example\+: \begin{DoxyVerb}simulation = MDISimulation("-name MM -role ENGINE -method TCP -port 8021 -hostname localhost", pdb.topology, system, integrator, platform)
\end{DoxyVerb}

\item At the end of the run script (or at whatever point Open\+MM should begin accepting commands from the driver) call the {\ttfamily run\+M\+D\+I()} function on the {\ttfamily M\+D\+I\+Simulation} object you created in the last step\+: \begin{DoxyVerb}simulation.runMDI()
\end{DoxyVerb}

\end{DoxyEnumerate}\hypertarget{mdi_ecosystem_ecosystem_psi4}{}\doxysection{Psi4}\label{mdi_ecosystem_ecosystem_psi4}
To use Psi4 as an engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Install M\+DI as a Python package, using either Conda ({\ttfamily conda install -\/c conda-\/forge pymdi}) or pip ({\ttfamily pip install pymdi}).
\item Acquire and compile Psi4, following the \href{http://www.psicode.org/psi4manual/master/external.html}{\texttt{ Psi4 installation guide}}. Installing via Conda is recommended.
\item Prepare a Psi4 input file that specifies the initial molecular geometry of the system and any other desired settings. At the end of the input file, call the {\bfseries{energy}} command with the {\ttfamily mdi=True} optional argument. For example\+: \begin{DoxyVerb}molecule {
O 4.92718 4.99809 1.10308
H 5.80905 5.31488 0.90767
H 4.87602 4.14701 0.667997
}

energy("scf/sto-3g", mdi=True)
\end{DoxyVerb}

\item Launch Psi4 using the "{\ttfamily -\/-\/mdi"} runtime option, which is described in \mbox{\hyperlink{library_page_library_launching_sec}{Launching Codes with the M\+DI Library}}. For example\+: \begin{DoxyVerb}psi4 -i psi4.dat --mdi "-role ENGINE -name my_name -method TCP -port 8021 -hostname localhost" &
\end{DoxyVerb}

\end{DoxyEnumerate}\hypertarget{mdi_ecosystem_ecosystem_qcengine}{}\doxysection{Q\+C\+Engine}\label{mdi_ecosystem_ecosystem_qcengine}
To use Q\+C\+Engine as an M\+DI engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Install Q\+C\+Engine, following the \href{https://qcengine.readthedocs.io/en/latest/install.html}{\texttt{ Q\+C\+Engine installation guide}}.
\item Prepare a Q\+C\+Engine input file that specifies the initial molecular geometry of the system and any other desired settings. At the end of the input file, create an "{\ttfamily M\+D\+I\+Server"} object and call the "{\ttfamily start()"} method on it. For example\+: \begin{DoxyVerb}import qcengine as qcng
import qcelemental as qcel

mol = qcel.models.Molecule.from_data("""
O  0.0  0.000  -0.129
H  0.0 -1.494  1.027
H  0.0  1.494  1.027
""")

o = qcng.MDIServer(mdi_options = "-role ENGINE -name QM -method TCP -port 8021 -hostname localhost",
                   program = "psi4",
                   molecule = mol,
                   model = {"method": "SCF", "basis": "sto-3g"},
                   keywords = {"scf_type": "df"})
o.start()
\end{DoxyVerb}

\item Run the input script as normal. Note that there is N\+OT a "{\ttfamily -\/-\/mdi"} runtime option.
\end{DoxyEnumerate}\hypertarget{mdi_ecosystem_ecosystem_qe}{}\doxysection{Quantum E\+S\+P\+R\+E\+S\+SO}\label{mdi_ecosystem_ecosystem_qe}
Mol\+S\+SI provides \href{https://github.com/MolSSI/q-e/tree/mdi}{\texttt{ an M\+D\+I-\/enabled fork}} of \href{https://www.quantum-espresso.org/}{\texttt{ Quantum E\+S\+P\+R\+E\+S\+SO}} (QE) that can be run as an M\+DI engine. To use QE as an engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Acquire the M\+D\+I-\/enabled fork of QE\+: \begin{DoxyVerb}git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git
\end{DoxyVerb}

\item Configure QE. You will need to configure QE to be compiled with position-\/independent code. If using G\+CC compilers, you can acomplish this by passing the {\ttfamily \char`\"{}-\/f\+P\+I\+C\char`\"{}} flag to the {\ttfamily \char`\"{}\+F\+F\+L\+A\+G\+S\char`\"{}}, {\ttfamily \char`\"{}\+F\+C\+F\+L\+A\+G\+S\char`\"{}}, {\ttfamily \char`\"{}\+C\+F\+L\+A\+G\+S\char`\"{}}, and {\ttfamily \char`\"{}try\+\_\+foxflags\char`\"{}} configuration options. For example\+: \begin{DoxyVerb}cd q-e
./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" try_foxflags="-fPIC -cpp"
\end{DoxyVerb}

\end{DoxyEnumerate}

For additional information about configuring QE, see the \href{https://www.quantum-espresso.org/Doc/user_guide/node10.html}{\texttt{ QE build guide}}.


\begin{DoxyEnumerate}
\item Compile {\ttfamily \char`\"{}qemdi.\+x\char`\"{}}. \begin{DoxyVerb}make mdi
\end{DoxyVerb}

\item Prepare a QE input file that specifies the initial molecular geometry of the system and any other desired settings.
\item Launch QE using the {\ttfamily \char`\"{}qemdi.\+x\char`\"{}} executable (which is located in {\ttfamily \char`\"{}q-\/e/\+M\+D\+I/src\char`\"{}}) "{\ttfamily -\/mdi"} runtime option, which is described in \mbox{\hyperlink{library_page_library_launching_sec}{Launching Codes with the M\+DI Library}}. For example\+: \begin{DoxyVerb}qemdi.x -in qe.in -mdi "-role ENGINE -name my_name -method TCP -port 8021 -hostname localhost" &
\end{DoxyVerb}

\item The {\ttfamily \char`\"{}q-\/e/\+M\+D\+I/src\char`\"{}} directory also contains a QE M\+DI Plugin, called {\ttfamily \char`\"{}qemdi\char`\"{}}.
\end{DoxyEnumerate}\hypertarget{mdi_ecosystem_ecosystem_tinker}{}\doxysection{Tinker}\label{mdi_ecosystem_ecosystem_tinker}
\href{https://github.com/taylor-a-barnes/Tinker/tree/mdi}{\texttt{ An M\+D\+I-\/enabled fork}} of \href{https://dasher.wustl.edu/tinker/}{\texttt{ Tinker}} is available that can be run as an M\+DI engine. To use Tinker as an engine, follow these steps\+:


\begin{DoxyEnumerate}
\item Acquire the M\+D\+I-\/enabled fork of Tinker\+: \begin{DoxyVerb}git clone --branch mdi git@github.com:taylor-a-barnes/Tinker.git
\end{DoxyVerb}

\item Compile dynamic.\+x, following the \href{https://dasher.wustl.edu/tinker/downloads/guide.pdf}{\texttt{ Tinker build guide}}.
\item Prepare Tinker input files that specify the initial molecular geometry of the system and any other desired settings.
\item Launch Tinker using the "{\ttfamily -\/mdi"} runtime option, which is described in \mbox{\hyperlink{library_page_library_launching_sec}{Launching Codes with the M\+DI Library}}. For example\+: \begin{DoxyVerb}dynamic.x input -mdi "-role ENGINE -name MM -method TCP -port 8021 -hostname localhost" 1000 1.0 10.0 2 298.0 778.0
\end{DoxyVerb}
 
\end{DoxyEnumerate}