\hypertarget{mdi_standard_standard_overview}{}\doxysection{Overview}\label{mdi_standard_standard_overview}
The M\+DI Standard provides a straightforward, A\+P\+I-\/like method for enabling interoperability among computational molecular sciences codes. It uses a driver/engine model in which a driver code controls the high-\/level program flow of one or more engine codes. The driver exercises this control through the use of \mbox{\hyperlink{mdi_standard_command_list}{commands}} that are defined by the M\+DI Standard. Commands are available that correspond to a variety of tasks, such as \char`\"{}receive a new set of nuclear coordinates from me\char`\"{} (\mbox{\hyperlink{mdi_standard_send_coords}{$>$C\+O\+O\+R\+DS}}), \char`\"{}start an M\+D simulation\char`\"{} (\mbox{\hyperlink{mdi_standard_init_md}{@\+I\+N\+I\+T\+\_\+\+MD}}) and \char`\"{}send me the forces on the nuclei\char`\"{} (\mbox{\hyperlink{mdi_standard_recv_forces}{$<$F\+O\+R\+C\+ES}}). The M\+DI standard defines the \mbox{\hyperlink{mdi_standard_standard_units}{units}}, data types, and formatting of any data communicated between codes in response to a command.\hypertarget{mdi_standard_standard_extension}{}\doxysection{Extending the M\+D\+I Standard}\label{mdi_standard_standard_extension}
Although the M\+DI Standard has been designed to enable a wide range of potential applications, it is inevitable that some use cases will require functionality that is not yet supported by the standard. Typically, supporting such use cases will simply require addition of one or more new \mbox{\hyperlink{mdi_standard_command_list}{commands}} to the M\+DI Standard. Users who find themselves in need of a new M\+DI command are encouraged to create an \href{https://github.com/MolSSI-MDI/MDI_Library/issues}{\texttt{ issue}} describing their needs or submit a \href{https://github.com/MolSSI-MDI/MDI_Library/pulls}{\texttt{ pull request}} suggesting a solution.\hypertarget{mdi_standard_standard_units}{}\doxysection{Units}\label{mdi_standard_standard_units}
All physical quantities communicated through M\+DI must be expressed in atomic units. Whenever it is necessary to perform a unit conversion on data communicated through M\+DI, the conversion factor should be obtained through the \mbox{\hyperlink{mdi_8c_aa1ccf61d45e842b50d72084735cb984a}{M\+D\+I\+\_\+\+Conversion\+\_\+\+Factor()}} function. Use of this function ensures self-\/consistency in unit conversions between codes, which is important for avoiding numerical instabilities.\hypertarget{mdi_standard_standard_nodes_sec}{}\doxysection{Nodes}\label{mdi_standard_standard_nodes_sec}
One of the powerful features of the M\+DI Standard is that it permits drivers to take advantage of existing implementations of time integrators and geometry optimizers in M\+DI engines. In particular, the \mbox{\hyperlink{mdi_standard_init_md}{@\+I\+N\+I\+T\+\_\+\+MD}} and \mbox{\hyperlink{mdi_standard_init_optg}{@\+I\+N\+I\+T\+\_\+\+O\+P\+TG}} commands cause an engine to begin a molecular dynamics trajectory or a geometry optimization, respectively. Upon receiving one of these commands, an engine will perform the corresponding simulation without requiring further instruction from the driver, except that it will pause at certain \char`\"{}nodes\char`\"{} and listen for new commands.

The M\+DI Standard defines several nodes. Their names and when they occur are as follows\+:

\begin{DoxyParagraph}{}
{\bfseries{ @\+D\+E\+F\+A\+U\+LT }} -\/ Upon initially connecting to the driver. ~\newline
 {\bfseries{ @\+I\+N\+I\+T\+\_\+\+MC }} -\/ Upon initializing a new Monte Carlo simulation. ~\newline
 {\bfseries{ @\+I\+N\+I\+T\+\_\+\+MD }} -\/ Upon initializing a new molecular dynamics simulation. ~\newline
 {\bfseries{ @\+I\+N\+I\+T\+\_\+\+O\+P\+TG }} -\/ Upon initializing a new geometry optimization. ~\newline

\end{DoxyParagraph}
Not all M\+DI engines are required to support each of these nodes, with the exception of the @\+D\+E\+F\+A\+U\+LT node, which every M\+DI engine must support. Additional nodes may be defined by individual codes. Examples of possible code-\/specific nodes include\+:

\begin{DoxyParagraph}{}
{\bfseries{ @\+P\+RE-\/F\+O\+R\+C\+ES }} -\/ After calculating all contributions to the atomic forces, {\bfseries{except}} those associated with a constraint algorithm like S\+H\+A\+KE or R\+A\+T\+T\+LE. ~\newline
 {\bfseries{ @\+F\+O\+R\+C\+ES }} -\/ After calculating all contributions to the atomic forces. ~\newline
 {\bfseries{ @\+C\+O\+O\+R\+DS }} -\/ After updating the atomic coordinates.
\end{DoxyParagraph}
Several M\+DI commands enable a driver to control the program flow of an engine through different nodes. The \mbox{\hyperlink{mdi_standard_send_node}{$<$@}} command instructs the engine to send the name of its node, while the \mbox{\hyperlink{mdi_standard_next_node}{@}} command instructs the engine to proceed in its simulation until it reaches the next node. In addition, there are commands associated with each type of node (\mbox{\hyperlink{mdi_standard_pre-forces_node}{@\+P\+RE-\/F\+O\+R\+C\+ES}}, \mbox{\hyperlink{mdi_standard_forces_node}{@\+F\+O\+R\+C\+ES}}, \mbox{\hyperlink{mdi_standard_coords_node}{@\+C\+O\+O\+R\+DS}}) which instruct the engine to proceed in its simulation until it reaches the next node of that particular type.

A specific MD implementation might progress from a @\+P\+RE-\/F\+O\+R\+C\+ES node, to the @\+F\+O\+R\+C\+ES node, to the @\+C\+O\+O\+R\+DS node, and then repeat the cycle; however, this behavior is {\bfseries{not}} guaranteed. Engines are permitted to pass through nodes in whatever order the implementation dictates. When writing drivers, it is a best practice to avoid assumptions about the ordering or frequency of nodes.

The M\+DI Library provides several functions that allow codes to define and communicate information about which nodes are supported\+:


\begin{DoxyItemize}
\item \mbox{\hyperlink{mdi_8c_ada45c73f15462764df0ac9e733b7d18e}{M\+D\+I\+\_\+\+Register\+\_\+\+Node()}}
\item \mbox{\hyperlink{mdi_8c_aeddcd7109a1206ce89a187960bfb3069}{M\+D\+I\+\_\+\+Check\+\_\+\+Node\+\_\+\+Exists()}}
\item \mbox{\hyperlink{mdi_8c_aa5988eb94d4e447720c3728f2ce1e310}{M\+D\+I\+\_\+\+Get\+\_\+\+N\+Nodes()}}
\item \mbox{\hyperlink{mdi_8c_a45bec162cf811d5f6411abd143e26af4}{M\+D\+I\+\_\+\+Get\+\_\+\+Node()}}
\end{DoxyItemize}

Engines are not required to support every M\+DI command at every node. The M\+DI Library provides several functions that allow codes to define and communicate information about which commands are supported at specific nodes\+:


\begin{DoxyItemize}
\item \mbox{\hyperlink{mdi_8c_a8eade50fb64b5bf5919b35cc2071952d}{M\+D\+I\+\_\+\+Register\+\_\+\+Command()}}
\item \mbox{\hyperlink{mdi_8c_a013856347b9026a7eb01e7803b3dc9b5}{M\+D\+I\+\_\+\+Check\+\_\+\+Command\+\_\+\+Exists()}}
\item \mbox{\hyperlink{mdi_8c_a82ee6d49380e2c24428aa6e5447c4567}{M\+D\+I\+\_\+\+Get\+\_\+\+N\+Commands()}}
\item \mbox{\hyperlink{mdi_8c_a632b49a3e745b7b381b60de530699298}{M\+D\+I\+\_\+\+Get\+\_\+\+Command()}}
\end{DoxyItemize}\hypertarget{mdi_standard_standard_constants_sec}{}\doxysection{Constants}\label{mdi_standard_standard_constants_sec}
The following constants are defined by the M\+DI Standard and are accessible through the \mbox{\hyperlink{library_page}{M\+DI Library}}\+:


\begin{DoxyItemize}
\item {\ttfamily M\+D\+I\+\_\+\+M\+PI} -\/ Identifier for the M\+PI communication method
\item {\ttfamily M\+D\+I\+\_\+\+T\+CP} -\/ Identifier for the T\+CP communication method
\item {\ttfamily M\+D\+I\+\_\+\+L\+I\+NK} -\/ Identifier for the L\+I\+NK communication method
\item {\ttfamily M\+D\+I\+\_\+\+T\+E\+ST} -\/ Identifier for the T\+E\+ST communication method
\item {\ttfamily M\+D\+I\+\_\+\+D\+R\+I\+V\+ER} -\/ Identifier for the D\+R\+I\+V\+ER role
\item {\ttfamily M\+D\+I\+\_\+\+E\+N\+G\+I\+NE} -\/ Identifier for the E\+N\+G\+I\+NE role
\item {\ttfamily M\+D\+I\+\_\+\+I\+NT} -\/ Data type identifier for integers
\item {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} -\/ Data type identifier for double precision floats
\item {\ttfamily M\+D\+I\+\_\+\+C\+H\+AR} -\/ Data type identifier for characters
\item {\ttfamily M\+D\+I\+\_\+\+I\+N\+T\+\_\+\+N\+U\+M\+PY} -\/ Data type identifier for Python Num\+Py integer arrays
\item {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+L\+E\+\_\+\+N\+U\+M\+PY} -\/ Data type identifier for Python Num\+Py double arrays
\item {\ttfamily M\+D\+I\+\_\+\+N\+A\+M\+E\+\_\+\+L\+E\+N\+G\+TH} -\/ Maximum number of characters in the name of an M\+DI code (see \mbox{\hyperlink{library_page_library_launching_sec}{Launching Codes with the M\+DI Library}}) or node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}})
\item {\ttfamily M\+D\+I\+\_\+\+C\+O\+M\+M\+A\+N\+D\+\_\+\+L\+E\+N\+G\+TH} -\/ Maximum number of characters in an M\+DI command (see \mbox{\hyperlink{mdi_standard_command_list}{Command List}})
\end{DoxyItemize}\hypertarget{mdi_standard_command_list}{}\doxysection{Command List}\label{mdi_standard_command_list}
The following is a list of commands that are officially part of the M\+DI standard.\hypertarget{mdi_standard_next_node}{}\doxysubsection{@}\label{mdi_standard_next_node}
The engine proceeds to the next node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}}). This command is typically not supported at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node.\hypertarget{mdi_standard_send_node}{}\doxysubsection{$<$@}\label{mdi_standard_send_node}
The engine sends the driver a string that corresponds to the name of its current node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}}).

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+C\+H\+AR} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  M\+D\+I\+\_\+\+N\+A\+M\+E\+\_\+\+L\+E\+N\+G\+TH }
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_cdensity}{}\doxysubsection{$<$\+C\+D\+E\+N\+S\+I\+TY}\label{mdi_standard_recv_cdensity}
The engine sends the Cartesian coordinates of a set of grid points. This command is intended to be used in conjuction with the \mbox{\hyperlink{mdi_standard_recv_ndensity}{$<$N\+D\+E\+N\+S\+I\+TY}} and \mbox{\hyperlink{mdi_standard_recv_density}{$<$D\+E\+N\+S\+I\+TY}} commands; these three commands enable a driver to acquire the electronic density distribution of an engine in a grid representation. See the \mbox{\hyperlink{mdi_standard_recv_density}{$<$D\+E\+N\+S\+I\+TY}} command for more details.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+D\+E\+N\+S\+I\+TY }
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_cell}{}\doxysubsection{$>$\+C\+E\+LL}\label{mdi_standard_send_cell}
The driver sends a set of cell vectors to the engine, which resizes its simulation cell to the dimensions specified by the cell vectors.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 9 ~\newline
 {\bfseries{ Format\+: }} The first 3 values correspond to the x, y, and z values, respectively, of the first cell vector. The next 3 values correspond to the x, y, and z values, respectively, of the second cell vector. The next 3 values correspond to the x, y, and z values, respectively, of the third cell vector. ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_cell}{}\doxysubsection{$<$\+C\+E\+LL}\label{mdi_standard_recv_cell}
The engine sends a set of cell vectors to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 9 ~\newline
 {\bfseries{ Format\+: }} The first 3 values correspond to the x, y, and z values, respectively, of the first cell vector. The next 3 values correspond to the x, y, and z values, respectively, of the second cell vector. The next 3 values correspond to the x, y, and z values, respectively, of the third cell vector. ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_cell_displ}{}\doxysubsection{$>$\+C\+E\+L\+L\+\_\+\+D\+I\+S\+PL}\label{mdi_standard_send_cell_displ}
The driver sends a displacement vector to the engine, which adjusts the origin of its simulation cell to the value of the displacement vector.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 3 ~\newline
 {\bfseries{ Format\+: }} The 3 values correspond to the x, y, and z values, respectively, of the simulation cell displacement vector. ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_cell_displ}{}\doxysubsection{$<$\+C\+E\+L\+L\+\_\+\+D\+I\+S\+PL}\label{mdi_standard_recv_cell_displ}
The engine sends the displacement vector of the origin of its simulation cell to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 3 ~\newline
 {\bfseries{ Format\+: }} The 3 values correspond to the x, y, and z values, respectively, of the simulation cell displacement vector. ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_charges}{}\doxysubsection{$>$\+C\+H\+A\+R\+G\+ES}\label{mdi_standard_send_charges}
The driver sends a set of atomic charges to the engine, which replaces its atomic charges with those sent by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+A\+T\+O\+MS} ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_charges}{}\doxysubsection{$<$\+C\+H\+A\+R\+G\+ES}\label{mdi_standard_recv_charges}
The engine sends a set of atomic charges to the driver, in the same format as specified for the {\ttfamily $>$C\+H\+A\+R\+G\+ES} command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+A\+T\+O\+MS} ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_clattice}{}\doxysubsection{$>$\+C\+L\+A\+T\+T\+I\+CE}\label{mdi_standard_send_clattice}
This command, along with the {\ttfamily $>$N\+L\+A\+T\+T\+I\+CE} and {\ttfamily $>$L\+A\+T\+T\+I\+CE} commands, allows the driver to assign a lattice of point charges to an engine, which incorporates the effects of these charges in all further calculations. After sending this command, the driver sends the coordinates of each of the point charges to the engine. Prior to sending this command, the driver must have set the number of point charges using the {\ttfamily $>$N\+L\+A\+T\+T\+I\+CE} command.

This command is primarily intended for use with gas-\/phase quantum mechanics codes. For an alternative command that is more appropriate for plane wave quantum mechanics codes, see the {\ttfamily $>$P\+O\+T\+E\+N\+T\+I\+AL} command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+L\+A\+T\+T\+I\+CE } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of lattice charge index, with the coordinates for each individual lattice charge being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_coords_node}{}\doxysubsection{@\+C\+O\+O\+R\+DS}\label{mdi_standard_coords_node}
The engine proceeds to the next {\ttfamily @\+C\+O\+O\+R\+DS}  node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}}). This command is not valid at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node.\hypertarget{mdi_standard_send_coords}{}\doxysubsection{$>$\+C\+O\+O\+R\+DS}\label{mdi_standard_send_coords}
The driver sends a set of atomic coordinates to the engine, which replaces its atomic coordinates with those sent by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the coordinates for each individual atom being provided in xyz order ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_coords}{}\doxysubsection{$<$\+C\+O\+O\+R\+DS}\label{mdi_standard_recv_coords}
The engine sends a set of atomic coordinates to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the coordinates for each individual atom being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_cpotential}{}\doxysubsection{$>$\+C\+P\+O\+T\+E\+N\+T\+I\+AL}\label{mdi_standard_send_cpotential}
The driver sends the Cartesian coordinates of a set of grid points. This command is intended to be used in conjuction with the \mbox{\hyperlink{mdi_standard_send_npotential}{$>$N\+P\+O\+T\+E\+N\+T\+I\+AL}} and \mbox{\hyperlink{mdi_standard_send_potential}{$>$P\+O\+T\+E\+N\+T\+I\+AL}} commands; these three commands enable a driver to set an external potential that is incorporated into a subsequent scf\+\_\+command command. See the \mbox{\hyperlink{mdi_standard_send_potential}{$>$P\+O\+T\+E\+N\+T\+I\+AL}} command for more details.

Before sending this command, the driver must have first sent the number of grid points used to represent the potential via the \mbox{\hyperlink{mdi_standard_send_npotential}{$>$N\+P\+O\+T\+E\+N\+T\+I\+AL}} command. It is also necessary that the driver send the values of the grid points via the \mbox{\hyperlink{mdi_standard_send_cpotential}{$>$C\+P\+O\+T\+E\+N\+T\+I\+AL}} command prior to any subsequent scf\+\_\+command command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+P\+O\+T\+E\+N\+T\+I\+AL }
\end{DoxyParagraph}
\hypertarget{mdi_standard_default_node}{}\doxysubsection{@\+D\+E\+F\+A\+U\+LT}\label{mdi_standard_default_node}
If not already at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, the engine exists whatever simulation (i.\+e. MD, O\+P\+TG, etc.) it is performing (possibly after completing an unfinished time step or geometry optimization step) and returns to the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node.\hypertarget{mdi_standard_recv_density}{}\doxysubsection{$<$\+D\+E\+N\+S\+I\+TY}\label{mdi_standard_recv_density}
The engine sends the value of its electronic density on a set of grid points. This command is intended to be used in conjuction with the \mbox{\hyperlink{mdi_standard_recv_ndensity}{$<$N\+D\+E\+N\+S\+I\+TY}} and \mbox{\hyperlink{mdi_standard_recv_cdensity}{$<$C\+D\+E\+N\+S\+I\+TY}} commands; these three commands enable a driver to acquire the electronic density distribution of an engine in a grid representation.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+D\+E\+N\+S\+I\+TY} 
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_dimensions}{}\doxysubsection{$<$\+D\+I\+M\+E\+N\+S\+I\+O\+NS}\label{mdi_standard_recv_dimensions}
The engine sends basic information about the dimensionality of its system to the driver. For each of its three cell vectors (see the {\ttfamily $<$C\+E\+LL} command) the engine sends an integer that indicates whether that dimension is represented as periodic, non-\/periodic, or not represented at all (in the case of 1d or 2d systems). The possible values for each cell vector are\+:


\begin{DoxyItemize}
\item 0\+: Not represented
\item 1\+: Non-\/periodic
\item 2\+: Periodic
\end{DoxyItemize}

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 3 ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of cell vector (see the $<$C\+E\+LL command)
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_mult}{}\doxysubsection{$>$\+E\+L\+E\+C\+\_\+\+M\+U\+LT}\label{mdi_standard_send_mult}
The driver sends the electronic multiplicity of the system to the engine. This command is typically only appropriate for quantum mechanics engines.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_mult}{}\doxysubsection{$<$\+E\+L\+E\+C\+\_\+\+M\+U\+LT}\label{mdi_standard_recv_mult}
The engine sends the electronic multiplicity of its system to the driver. This command is typically only appropriate for quantum mechanics engines.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_elements}{}\doxysubsection{$<$\+E\+L\+E\+M\+E\+N\+TS}\label{mdi_standard_recv_elements}
The engine sends the atomic number of each atom in its system to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+A\+T\+O\+MS} ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_elements}{}\doxysubsection{$>$\+E\+L\+E\+M\+E\+N\+TS}\label{mdi_standard_send_elements}
The driver sends a set of atomic numbers to the engine, which replaces the atomic number of each atom in its system with the values sent by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+A\+T\+O\+MS} ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_energy}{}\doxysubsection{$<$\+E\+N\+E\+R\+GY}\label{mdi_standard_recv_energy}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its total energy to the driver. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated total energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_exit_command}{}\doxysubsection{E\+X\+IT}\label{mdi_standard_exit_command}
The engine terminates and can no longer be sent commands.\hypertarget{mdi_standard_forces_node}{}\doxysubsection{@\+F\+O\+R\+C\+ES}\label{mdi_standard_forces_node}
The engine proceeds to the next {\ttfamily @\+F\+O\+R\+C\+ES}  node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}}). This command is not valid at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node.\hypertarget{mdi_standard_send_forces}{}\doxysubsection{$>$\+F\+O\+R\+C\+ES}\label{mdi_standard_send_forces}
The driver sends a set of atomic forces to the engine, which replaces its internal forces with the forces sent by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the forces for each individual atom being provided in xyz order ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_add_forces}{}\doxysubsection{$>$+\+F\+O\+R\+C\+ES}\label{mdi_standard_send_add_forces}
The driver sends a set of atomic forces to the engine, which adds the forces sent by the driver to its internal forces.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the forces for each individual atom being provided in xyz order ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_forces}{}\doxysubsection{$<$\+F\+O\+R\+C\+ES}\label{mdi_standard_recv_forces}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its atomic forces to the driver. These forces include all force contributions, including the force contributions associated with any constraint algorithm (e.\+g. S\+H\+A\+KE, R\+A\+T\+T\+LE, etc.). If the engine has previously calculated the atomic forces of the system, and no intervening commands from the driver could have changed the atomic forces, the engine is permitted to send the previously calculated atomic forces instead of recalculating them.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated atomic forces to the driver. Depending on the engine\textquotesingle{}s current node, these forces may not include all contributions to the atomic forces. See the descriptions of the different nodes for more details.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the forces for each individual atom being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_init_mc}{}\doxysubsection{@\+I\+N\+I\+T\+\_\+\+MC}\label{mdi_standard_init_mc}
The engine performs any initialization operations that are necessary before a Monte Carlo simulation can be performed, proceeding to the @\+I\+N\+I\+T\+\_\+\+MC node.\hypertarget{mdi_standard_init_md}{}\doxysubsection{@\+I\+N\+I\+T\+\_\+\+MD}\label{mdi_standard_init_md}
The engine performs any initialization operations that are necessary before a molecular dynamics simulation can be performed, proceeding to the @\+I\+N\+I\+T\+\_\+\+MD node.

\begin{DoxyParagraph}{}
{\bfseries{ Note\+: }} This command may change the engine\textquotesingle{}s atomic coordinates under certain circumstances, such as if the S\+H\+A\+KE algorithm is used.
\end{DoxyParagraph}
\hypertarget{mdi_standard_init_optg}{}\doxysubsection{@\+I\+N\+I\+T\+\_\+\+O\+P\+TG}\label{mdi_standard_init_optg}
The engine performs any initialization operations that are necessary before a geometry optimization can be performed, proceeding to the @\+I\+N\+I\+T\+\_\+\+O\+P\+TG node.

\begin{DoxyParagraph}{}
{\bfseries{ Note\+: }} This command may change the engine\textquotesingle{}s atomic coordinates under certain circumstances, such as if the S\+H\+A\+KE algorithm is used.
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_ke}{}\doxysubsection{$<$\+KE}\label{mdi_standard_recv_ke}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its total kinetic energy to the driver. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated total kinetic energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_ke_elec}{}\doxysubsection{$<$\+K\+E\+\_\+\+E\+L\+EC}\label{mdi_standard_recv_ke_elec}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends the total kinetic energy of all electrons in its system to the driver. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated electronic kinetic energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_ke_nuc}{}\doxysubsection{$<$\+K\+E\+\_\+\+N\+UC}\label{mdi_standard_recv_ke_nuc}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends the total kinetic energy of all nuclei in its system to the driver. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated nuclear kinetic energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_labels}{}\doxysubsection{$<$\+L\+A\+B\+E\+LS}\label{mdi_standard_send_labels}
The engine sends a label for each atom in its system. \char`\"{}\+Labels\char`\"{} are intended primarily for the purpose of providing a human-\/readable identifier for each of the atoms, and do not have a standardized physical meaning. It is recommended that the labels correspond to the element of each atom (i.\+e., \char`\"{}\+H\char`\"{}, \char`\"{}\+He\char`\"{}, \char`\"{}\+Li\char`\"{}, etc.), a name associated with atoms of a particular type (i.\+e., \char`\"{}\+Carboxyl\+\_\+\+Hydrogen\char`\"{}, \char`\"{}\+Methyl\+\_\+\+Hydrogen\char`\"{}), or a similarly descriptive term. The atom labels may correspond to a number identifier (i.\+e., \char`\"{}1\char`\"{}, \char`\"{}2\char`\"{}, \char`\"{}3\char`\"{}, etc.) in cases where more descriptive labels are not practical, but note that such labels must be represented using the {\ttfamily M\+D\+I\+\_\+\+C\+H\+AR} data type, as indicated below. It is required that atoms having different physical properties (i.\+e., different force field terms in a molecular mechanics simulation or different nuclear charges in a quantum chemistry simulation) have different labels.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+C\+H\+AR} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily M\+D\+I\+\_\+\+L\+A\+B\+E\+L\+\_\+\+L\+E\+N\+G\+TH} $\ast$ {\ttfamily N\+A\+T\+O\+MS} ~\newline
 {\bfseries{ Format\+: }} An array of characters corresponding to the label of each atom in ascending order of atomic index, with each label consisting of {\ttfamily M\+D\+I\+\_\+\+L\+A\+B\+E\+L\+\_\+\+L\+E\+N\+G\+TH} characters and being padded with spaces (\char`\"{} \char`\"{}) where necessary ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_lattice}{}\doxysubsection{$>$\+L\+A\+T\+T\+I\+CE}\label{mdi_standard_send_lattice}
This command, along with the {\ttfamily $>$N\+L\+A\+T\+T\+I\+CE} and {\ttfamily $>$C\+L\+A\+T\+T\+I\+CE} commands, allows the driver to assign a lattice of point charges to an engine, which incorporates the effects of these charges in all further calculations. After sending this command, the driver sends the charges of each of the point charges to the engine. Prior to sending this command, the driver must have set the number of point charges using the {\ttfamily $>$N\+L\+A\+T\+T\+I\+CE} command.

This command is primarily intended for use with gas-\/phase quantum mechanics codes. For an alternative command that is more appropriate for plane wave quantum mechanics codes, see the {\ttfamily $>$P\+O\+T\+E\+N\+T\+I\+AL} command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  N\+L\+A\+T\+T\+I\+CE } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of lattice charge index
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_lattice_forces}{}\doxysubsection{$<$\+L\+A\+T\+T\+I\+C\+E\+\_\+\+F\+O\+R\+C\+ES}\label{mdi_standard_recv_lattice_forces}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends the forces on any lattice charges (which must have previously assigned with the {\ttfamily $>$L\+A\+T\+T\+I\+CE} command) to the driver. Prior to sending this command, the driver must have set the number, coordinates, and magnitudes of the lattice charges using the {\ttfamily $>$N\+L\+A\+T\+T\+I\+CE}, {\ttfamily $>$C\+L\+A\+T\+T\+I\+CE}, and {\ttfamily $>$L\+A\+T\+T\+I\+CE} commands. These forces must include only electrostatic interactions between the lattice charges and the atomic nuclei, and between the lattice charges and any electrons. They must not include electrostatic interactions between the lattice charges and other lattice charges. If the engine has previously calculated these forces, and no intervening commands from the driver could have changed the forces, the engine is permitted to send the previously calculated forces instead of recalculating them.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated lattice forces to the driver.

This command is primarily intended for use with gas-\/phase quantum mechanics codes.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+L\+A\+T\+T\+I\+CE } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of lattice charge index, with the forces for each individual lattice charge being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_masses}{}\doxysubsection{$<$\+M\+A\+S\+S\+ES}\label{mdi_standard_recv_masses}
The engine sends the driver the mass of each of the atoms.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  $<$N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_Monkhorst_Pack}{}\doxysubsection{$>$\+M\+O\+N\+K\+H\+O\+R\+S\+T-\/\+P\+A\+C\+K\+\_\+\+N\+P\+O\+I\+N\+TS}\label{mdi_standard_send_Monkhorst_Pack}
This command is typically expected for use with plane wave D\+FT engines. The driver sends the engine the number of k-\/points to generate on a Monkhorst-\/\+Pack grid. The engine then uses the k-\/points generated on this Monkhorst-\/\+Pack grid for all further simulations.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 } ~\newline
 {\bfseries{ Format\+: }} The number of k-\/points to generate along each vector of the Brillouin zone, in ascending order of vector.
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_Monkhorst_Pack_shift}{}\doxysubsection{$>$\+M\+O\+N\+K\+H\+O\+R\+S\+T-\/\+P\+A\+C\+K\+\_\+\+S\+H\+I\+FT}\label{mdi_standard_send_Monkhorst_Pack_shift}
This command is typically expected for use with plane wave D\+FT engines. The driver sends the engine a set of values that indicate the extent to which a set of k-\/points on a Monkhorst-\/\+Pack grid should be displaced relative to the original (non-\/displaced) Monkhorst-\/\+Pack grid. The engine then uses the shifted k-\/points for all further simulations.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 } ~\newline
 {\bfseries{ Format\+: }} The fraction of a grid step by which the k-\/points should be displaced, in ascending order of vector. A value of 0.\+0 indicates no displacement along the corresponding vector, while a value of 0.\+5 indicates a displacement of half a grid step in along the corresponding vector. Note that some engines can only support values of 0.\+0 or 0.\+5.
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_name}{}\doxysubsection{$<$\+N\+A\+ME}\label{mdi_standard_send_name}
The engine sends the driver a string that corresponds to the argument of {\ttfamily -\/name} in the M\+DI initialization options. This argument allows a driver to identify the purpose of connected engine codes within the simulation. For example, a particular Q\+M/\+MM driver might require a connection with a single MM code and a single QM code, with the expected name of the MM code being \char`\"{}\+M\+M\char`\"{} and the expected name of the QM code being \char`\"{}\+Q\+M\char`\"{}. After initializing M\+DI and accepting communicators to the engines, the driver can use this command to identify which of the engines is the MM code and which is the QM code.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+C\+H\+AR} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  M\+D\+I\+\_\+\+N\+A\+M\+E\+\_\+\+L\+E\+N\+G\+TH }
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_natoms}{}\doxysubsection{$<$\+N\+A\+T\+O\+MS}\label{mdi_standard_recv_natoms}
The engine sends the driver the number of atoms in the engine\textquotesingle{}s system.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_ndensity}{}\doxysubsection{$<$\+N\+D\+E\+N\+S\+I\+TY}\label{mdi_standard_recv_ndensity}
The engine sends the number of grid points it is using to represent its electronic density on a grid. This command is intended to be used in conjuction with the \mbox{\hyperlink{mdi_standard_recv_cdensity}{$<$C\+D\+E\+N\+S\+I\+TY}} and \mbox{\hyperlink{mdi_standard_recv_density}{$<$D\+E\+N\+S\+I\+TY}} commands; these three commands enable a driver to acquire the electronic density distribution of an engine in a grid representation. See the \mbox{\hyperlink{mdi_standard_recv_density}{$<$D\+E\+N\+S\+I\+TY}} command for more details.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_nlattice}{}\doxysubsection{$>$\+N\+L\+A\+T\+T\+I\+CE}\label{mdi_standard_send_nlattice}
This command, along with the {\ttfamily $>$C\+L\+A\+T\+T\+I\+CE} and {\ttfamily $>$L\+A\+T\+T\+I\+CE} commands, allows the driver to assign a lattice of point charges to an engine, which incorporates the effects of these charges in all further calculations. After sending this command, the driver sends the number of point charges to the engine. This command must be sent before either the {\ttfamily $>$C\+L\+A\+T\+T\+I\+CE} or {\ttfamily $>$L\+A\+T\+T\+I\+CE} commands can be sent.

This command is primarily intended for use with gas-\/phase quantum mechanics codes. For an alternative command that is more appropriate for plane wave quantum mechanics codes, see the {\ttfamily $>$P\+O\+T\+E\+N\+T\+I\+AL} command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1 ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_npotential}{}\doxysubsection{$>$\+N\+P\+O\+T\+E\+N\+T\+I\+AL}\label{mdi_standard_send_npotential}
The driver sends the number of grid points it is using to represent a potential on a grid. This command is intended to be used in conjuction with the \mbox{\hyperlink{mdi_standard_send_cpotential}{$>$C\+P\+O\+T\+E\+N\+T\+I\+AL}} and \mbox{\hyperlink{mdi_standard_send_potential}{$>$P\+O\+T\+E\+N\+T\+I\+AL}} commands; these three commands enable a driver to set an external potential that is incorporated into a subsequent scf\+\_\+command command. See the \mbox{\hyperlink{mdi_standard_send_potential}{$>$P\+O\+T\+E\+N\+T\+I\+AL}} command for more details.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_potential}{}\doxysubsection{$>$\+P\+O\+T\+E\+N\+T\+I\+AL}\label{mdi_standard_send_potential}
The driver sends an set of values to the engine that correspond to a potential on a grid. If an scf\+\_\+command command is later issued, this potential will be incorporated into the S\+CF calculation as an external potential.

Before sending this command, the driver must have first sent the number of grid points used to represent the potential via the \mbox{\hyperlink{mdi_standard_send_npotential}{$>$N\+P\+O\+T\+E\+N\+T\+I\+AL}} command. It is also necessary that the driver send the Cartesian coordinates of the grid points via the \mbox{\hyperlink{mdi_standard_send_cpotential}{$>$C\+P\+O\+T\+E\+N\+T\+I\+AL}} command prior to any subsequent scf\+\_\+command command.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily N\+P\+O\+T\+E\+N\+T\+I\+AL} 
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_pe}{}\doxysubsection{$<$\+PE}\label{mdi_standard_recv_pe}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its total potential energy to the driver. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated total potential energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_pe_elec}{}\doxysubsection{$<$\+P\+E\+\_\+\+E\+L\+EC}\label{mdi_standard_recv_pe_elec}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its electronic potential energy to the driver. The electronic potential energy is defined as including all interactions between the electrons and any other particles or fields in the system. It also includes the interactions between the electrons and themselves. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated electronic potential energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_pe_nuc}{}\doxysubsection{$<$\+P\+E\+\_\+\+N\+UC}\label{mdi_standard_recv_pe_nuc}
If the engine is at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it calculates and sends its nuclear potential energy to the driver. The nuclear potential energy is defined as including all interactions between the nuclei and any other particles or fields in the system, excluding any electrons. It also includes the interactions between the nuclei and themselves. If the engine has previously calculated the energy of the system, and no intervening commands from the driver could have changed the energy, the engine is permitted to send the previously calculated energy instead of recalculating it.

If the engine is not at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node, it sends its most recently calculated electronic potential energy to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_pre-forces_node}{}\doxysubsection{@\+P\+R\+E-\/\+F\+O\+R\+C\+ES}\label{mdi_standard_pre-forces_node}
The engine proceeds to the next {\ttfamily  @\+P\+RE-\/F\+O\+R\+C\+ES } node (see \mbox{\hyperlink{mdi_standard_standard_nodes_sec}{Nodes}}). This command is not valid at the {\ttfamily @\+D\+E\+F\+A\+U\+LT}  node.\hypertarget{mdi_standard_send_spin_polarization}{}\doxysubsection{$<$\+S\+P\+I\+N\+\_\+\+P\+O\+L\+A\+R\+I\+Z\+A\+T\+I\+ON}\label{mdi_standard_send_spin_polarization}
The engine sends a value that indicates the manner in which it is currently simulating spin polarization. This command is typically intended for use with plane wave D\+FT engines.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1 ~\newline
 {\bfseries{ Format\+: }} A value of 0 indicates that simulations will be performed in a non-\/spin-\/polarized manner. A value of 1 indicates that simulations will be performed in a spin-\/polarized manner, within the local spin density approximation (L\+S\+DA). A value of 2 indicates that simulations will be performed in a spin-\/polarized, noncollinear manner.
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_spin_polarization}{}\doxysubsection{$>$\+S\+P\+I\+N\+\_\+\+P\+O\+L\+A\+R\+I\+Z\+A\+T\+I\+ON}\label{mdi_standard_recv_spin_polarization}
The driver sends a value that indicates the manner in which spin polarization should be simulated by the engine. This command is typically intended for use with plane wave D\+FT engines.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+I\+NT} ~\newline
 {\bfseries{ Quantity\+: }} 1 ~\newline
 {\bfseries{ Format\+: }} A value of 0 indicates that simulations should be performed in a non-\/spin-\/polarized manner. A value of 1 indicates that simulations should be performed in a spin-\/polarized manner, within the local spin density approximation (L\+S\+DA). A value of 2 indicates that simulations should be performed in a spin-\/polarized, noncollinear manner.
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_stress}{}\doxysubsection{$<$\+S\+T\+R\+E\+SS}\label{mdi_standard_send_stress}
The engine sends its virial stress tensor to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 9 ~\newline
 {\bfseries{ Format\+: }} The tensor components are sent in row-\/major order (xx, xy, xz, yx, yy, yz, zx, zy, zz). ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_stress}{}\doxysubsection{$>$\+S\+T\+R\+E\+SS}\label{mdi_standard_recv_stress}
The driver sends a virial stress tensor to the engine, which replaces its internal stress tensor with the stress tensor sent by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 9 ~\newline
 {\bfseries{ Format\+: }} The tensor components are sent in row-\/major order (xx, xy, xz, yx, yy, yz, zx, zy, zz). ~\newline

\end{DoxyParagraph}
\hypertarget{mdi_standard_send_totcharge}{}\doxysubsection{$>$\+T\+O\+T\+C\+H\+A\+R\+GE}\label{mdi_standard_send_totcharge}
The driver sends a value for the total charge of the system, including electron and nuclear charges, to the engine, which adjusts the number of electrons present in its system to the value required to reproduce the value sent by the driver. This command is typically only appropriate for quantum mechanics engines. Engines that support this command are not required to support non-\/integer charges; they are permitted to produce an error message if the value received deviates by more than 10$^\wedge$-\/12 from an integer, and to otherwise round the value received to the nearest integer.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_totcharge}{}\doxysubsection{$<$\+T\+O\+T\+C\+H\+A\+R\+GE}\label{mdi_standard_recv_totcharge}
The engine sends the total charge of its system, including electron and nuclear charges, to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} 1
\end{DoxyParagraph}
\hypertarget{mdi_standard_send_velocities}{}\doxysubsection{$>$\+V\+E\+L\+O\+C\+I\+T\+ES}\label{mdi_standard_send_velocities}
The driver sends a set of atomic velocities to the driver, which replaces its atomic velocities with those provided by the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the velocities for each individual atom being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_velocities}{}\doxysubsection{$<$\+V\+E\+L\+O\+C\+I\+T\+ES}\label{mdi_standard_recv_velocities}
The engine sends the velocities of the atoms in its system to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  3 $\ast$ N\+A\+T\+O\+MS } ~\newline
 {\bfseries{ Format\+: }} Sequentially ascending order of atomic index, with the velocities for each individual atom being provided in xyz order
\end{DoxyParagraph}
\hypertarget{mdi_standard_recv_version}{}\doxysubsection{$<$\+V\+E\+R\+S\+I\+ON}\label{mdi_standard_recv_version}
The engine sends the version number of the M\+DI Library to which it is linked to the driver.

\begin{DoxyParagraph}{}
{\bfseries{ Data Type\+: }} {\ttfamily M\+D\+I\+\_\+\+D\+O\+U\+B\+LE} ~\newline
 {\bfseries{ Quantity\+: }} {\ttfamily  1 } ~\newline
 
\end{DoxyParagraph}
