The iLEGO-building tool is a program that generates ion pairs using translation vectors and rotation matrices, aiming to find different conformations with the center of mass of the reference species. For this purpose, the software follows 12 sequential steps, in which the ions are read and interpreted, translocated, rotated, written to a new file (.xyz), optimized using semiempirical method, analyzed, and their energies described in a diagram. The 12 steps are displayed in the program's flowchart shown below.
To begin, it is necessary to create a Conda environment for the proper functioning of iLEGO-Building. Therefore, create an environment by following the commands below:
conda create --name iLEGOconda activate iLEGOFor the correct setup of the environment, including all the required libraries, etc., try executing the Install_iLEGO.py script using the following command:
./Install_iLEGO.pyIf it is not already, make the iLEGO.py script executable using the following command:
chmod +x ~/path_to_script/iLEGO.pyThen, to use iLEGO as an environment variable, follow these commands:
export PATH="$PATH:$HOME/path_to_iLEGO.py"sudo ln -s ~/path_to_script/iLEGO.py /usr/local/bin/iLEGOFrom now on, calculations can be performed within the structured environment. To access the iLEGO commands, try the following:
iLEGO -hAnd this will return the following message:
usage: iLEGO [-h] [-i INPUT [INPUT ...]] [-c CHARGE] [-t TRANSLATION] [-a ANGLES] [-to TRANS_OPTIMIZATION] [-e ENGINE]
[-b BOX [BOX ...]] [-opt OPTMIZATION [OPTMIZATION ...]] [-freq FREQUENCY [FREQUENCY ...]] [-esp ESP [ESP ...]]
[-sapt SAPT]
| iLEGO Building v 1.0 | | Brum J. B; Torres, C; Costa, L. T; | | Department of Physical Chemistry, Institute of Chemistry | |
Federal Fluminense University | The iLEGO-Building is a program that performs the calculation of the ionic space between pairs of
ions through translation vectors and rotation matrices, aiming to find different conformations around a center of mass.
options:
-h, --help show this help message and exit
-i INPUT [INPUT ...], --input INPUT [INPUT ...]
Selects which systems will be used as inputs for the calculation of geometric arrangement.
-c CHARGE, --charge CHARGE
Select the total charge of the pair.
-t TRANSLATION, --translation TRANSLATION
Selects the vector that separates one system from another along the axis passing through the center of
mass.
-a ANGLES, --angles ANGLES
Selects the number of times that is divided the space between the angles π/2 and -π/2 is fragmented
-to TRANS_OPTIMIZATION, --trans_optimization TRANS_OPTIMIZATION
Find the best distance between the two charge centers. This replaces the flag -t.
-e ENGINE, --engine ENGINE
Select the semi-empirical method that will feed the energy analysis under angular perturbations.
-b BOX [BOX ...], --box BOX [BOX ...]
Select the desired solvent (.pdb), the respective concentration of solute and solvent, and the type of
solvation, which can be chosen from mixture, interface, bilayer, or spherical.
-opt OPTMIZATION [OPTMIZATION ...], --optmization OPTMIZATION [OPTMIZATION ...]
Select the geometric optimization option using DFT for the lowest energy combination, requiring the
insertion of the method and basis set.
-freq FREQUENCY [FREQUENCY ...], --frequency FREQUENCY [FREQUENCY ...]
Select the frequency and thermochemistry calculation option using DFT for the lowest energy combination,
requiring the insertion of the method and basis set.
-esp ESP [ESP ...], --ESP ESP [ESP ...]
Select the potential energy surface (ESP) calculation using DFT, requiring the insertion of the method and
basis set.
-sapt SAPT, --SAPT SAPT
Select the symmetry-adapted perturbation theory (SAPT) calculation, requiring the insertion of the basis
set.To use the input flag (-i), you must provide the paths to the coordinate files that will be combined.
Supported formats are those recognized by Open Babel. For optimal usage, please refer to the official documentation: Open Babel File Formats.
For SMILES input, you must add the smi: prefix followed by the SMILES string (without spaces).
Below are examples of coordinate file inputs and the equivalent SMILES-based input.
iLEGO -i Ammonium.xyz Formate.xyziLEGO -i smi:[NH4+] smi:C=O[O-]Be careful when using parentheses in SMILES, as they may cause reading and combination errors.
For the use of the translation flag (-t), you need to add a float number as an argument. This will be the initial distance between the two charged centers. Depending on the size difference between the systems, manual adjustment may be required to ensure that ions do not overlap.
To use the optimization of translations (-to) flag, you need to input a float number greater than 1, where a five-cycle algorithm will search for the translation vector with the greatest energy variation possible. This vector represents the ideal interaction distance, considering that a very small translation leads to atomic overlap, while very large translations result in a decrease in intermolecular interactions, both of which decrease the energy variation due to rotation.
To use the angles flag (-a), choose an integer value. This value will determine the number of divisions in which the rotation space will be split. The higher the value, the greater the computational cost, as well as the precision of the calculation. Considering that the rotation space for the three angles has a limit of π/2 and -π/2, it is recommended to set the value between 45 and 180. This will result in the rotational space being divided in increments of 6 degrees or 2 degrees, respectively, ensuring significant precision.
With the input, translation and angular division flags, it is already possible to perform the basic calculation.
For example, the ionic pair 3-butyl-1-methyl-1H-imidazol-3-ium (BMIN.xyz) and hexafluorophosphate (PF6.xyz).
iLEGO -i BMIM.xyz PF6.xyz -to 1 -a 30| Run in Line | T_Vec | Variations |
|---|---|---|
| 0 | 1.0 | 0.186385 |
| 1 | 2.0 | 0.159884 |
| 2 | 3.0 | 0.159884 |
| Run in Line | T_Vec | Variations |
|---|---|---|
| 0 | 0.5 | 0.358102 |
| 1 | 1.0 | 0.186114 |
| 2 | 1.5 | 0.305669 |
| Run in Line | T_Vec | Variations |
|---|---|---|
| 0 | 0.2 | 0.305669 |
| 1 | 0.5 | 0.358087 |
| 2 | 0.8 | 0.390141 |
| Run in Line | T_Vec | Variations |
|---|---|---|
| 0 | 0.6 | 0.350197 |
| 1 | 0.8 | 0.386347 |
| 2 | 1.0 | 0.186483 |
| Run in Line | T_Vec | Variations |
|---|---|---|
| 0 | 0.7 | 0.165134 |
| 1 | 0.8 | 0.383789 |
| 2 | 0.9 | 0.283629 |
And the result is precisely the overlapping of the van der Waals spheres' boundaries.
For ionic combinations of cations or anions where the total charge is different from zero, the (-c) flag can be used to define the total charge of the dimer.
For example, for the calculation of the combination between two acetate anions (acetate.pdb), the input should be something like this:
iLEGO -i acetate.pdb -to 1 -a 30 -c -2To select the semiempirical method for the calculation, use the (-e) flag followed by the method name. If the flag is not used, the GFN2-xTB method is used by default.
Since iLEGO utilizes the xTB (GitHub) and MOPAC (OpenMOPAC) software, the following methods can be selected:
- MNDO
- MNDOD
- AM1
- RM1
- PM3
- PM6
- PM7
- GFN0
- GFN1
- GFN2
For example, for the calculation of the combination between the tetrafluoroborate anion (BF4.xyz) and the pyridinium cation (Pyr.xyz) using the PM7 method, the following command can be used:
iLEGO -i BF4.xyz Pyr.xyz -to 1 -a 30 -e PM7For preparing input files for molecular dynamics, iLEGO uses Packmol (Packmol Website) as a plugin, which can be accessed through the (-b) flag, followed by the path to the desired solvent molecule (in pdb format), solvent concentrations, ionic pair, and the type of arrangement desired by the user.
There are four possible arrangements available in iLEGO, which are: mixture, interface, bilayer, and spherical, as defined in the examples on the official Packmol website (Packmol Examples).
For the molecular dynamics calculation of an aqueous solution with equal amounts of Ammonium and Acetate, the following command can be used:
iLEGO -i Ammonium.xyz Acetate.xyz -to 1 -a 30 -b Water.pdb, 5, 2.5, mixtureFor DFT calculations, Psi4 is used as a plugin. The -opt flag, followed by the method and basis set, enables geometric optimization at various levels of theory. The -freq flag performs vibrational frequency calculations and thermochemical analyses, including enthalpy and entropy. The -esp flag computes the potential energy surface of the pair. The -sapt flag executes Symmetry-Adapted Perturbation Theory (SAPT) calculations to analyze the interaction between ions.
All flags that utilize Psi4 require specifying a supported method (methods list) and basis set (basis sets list) as input.
For example, to compute the potential energy surface of the interaction between two 3-ethyl-1-methyl-1H-imidazol-3-ium cations (EMIM.xyz) using the B3LYP/6-31G level of theory, use the following command:
iLEGO -i EMIM.xyz EMIM.xyz -to 1 -a 30 -c 2 -esp B3LYP 6-31GTo facilitate the use of the software for users not familiar with the Unix system, an intuitive graphical interface and two executable files (.exe)
To use the tool, you need to run the Install_iLEGO.exe file. This will open a terminal, and all libraries will be installed, and the environment will be correctly configured for use. After that, the iLEGO.exe file can be executed without any difficulty. were developed for the Windows version. When executed, the software will reveal a screen containing buttons that replace the input (-i), fragmentation (-a) flags previously explained.
The input button opens a second window where it is possible to select the cation and the anion for the combination, as well as to have a brief summary of some properties. These include mass, energy of the HOMO, energy of the LUMO, the gap between them, electron affinity (EA), ionization potential (I), the global electrophilicity index (ω), and hardness (η). The Figure displays the input window showing an example of the cation 1-butylpyridin-1-ium and the acetate anion.
Dialog boxes are opened for the user to input both translation and fragmentation. When these are entered, the program displays information about the choices. Regarding translation, the chosen vector appears below the button. For fragmentation, the chosen value, the angular variation determined to sweep the rotation space, and the number of combinations to be performed are displayed. For the combination button, a menu with three options is opened: Cation/Anion, Cation/Cation, and Anion/Anion, corresponding to the arguments of the system flag (-s): CA, CC, and AA, respectively.
The run button executes the combinations with the chosen parameters. The screen in the center displays the calculation result and the steps that have been completed, following the flowchart. The Figure shows the calculation being executed for the example system.
Finally, the DataSet button opens a dropdown menu where it's possible to choose between Anion, Cation, or Ionic Pair, and thus a new window containing an interactive table is opened, containing the electronic and thermochemical properties for the entire dataset. The window, using cations as an example, is displayed in figure.
The iLEGO-building version for Windows is available in this Github folder as well as in the link below.







