The toml format
============
The toml format is a human-readable configuration file format that is easy to read and write.
It is used to define the parameters for the QCE input file and the clusterset file in Peacemaker.
More information about the toml format can be found in the `TOML documentation `_.
A typical toml file is structured with sections, each defined by square brackets, and key-value pairs
within those sections.
The key-value pairs are separated by an equal sign, and values can be strings, numbers, arrays or boleans.
An example of a toml file, which is actually a QCE input file, is shown bellow:
.. code-block:: toml
[system]
components = 1
[qce]
amf = [0.0, 0.5, 101]
bxv = [1.0, 2.0, 101]
[ensemble]
temperature = 298.15
pressure = 101325.0
monomer_amounts = 1.0
Since the values can have different types, they are presented in different ways:
* Strings are enclosed in double quotes, e.g., `"example"`.
* Numbers are written as is, e.g., `3.14`.
* Arrays are enclosed in square brackets, e.g., `[1, 2, 3]`.
* Booleans are written as `true` or `false`.
In our configuration files, sometimes the user can specify if a specific value is a single value or a range of values.
In this case, also if the user decides to give a single value, it must be enclosed in square brackets, e.g., `[1.0]`.
The mean field parameter :math:`a_{mf}` is an example of such a value, which can be specified as a single value or as a range of values.
Input files from earlier versions of Peacemaker
------------------------------
If you want to use QCE-input files and clusterset files from earlier versions of Peacemaker,
you can convert them to the toml format using the the following python scripts, located in the
``tools/convert2toml`` directory of the peacemaker4 repository:
* QCEinput2toml.py
* clusterset2toml.py
These scripts can be used from the command line as follows:
.. code-block:: bash
python QCEinput2toml.py