Skip to content

Specify molecules names in the input file #137

Open
@Luthaf

Description

@Luthaf

This is an user interface improvement proposed by @g-bauer.

The idea is to specify molecules in a section of the input, and then use the molecules by names while specifying moves.

The current input look like this:

[[systems]]
file = "initial.pdb"

[[simulations]]
nsteps = 1000000
[simulations.propagator]
type = "MonteCarlo"
temperature = "500 K"
moves = [
    {type = "Translate", delta = "1 A", , molecule = "CO2.xyz"},
    {type = "Rotate", delta = "20 deg", molecule = "CO2.xyz"},
    {type = "Translate", delta = "2 A", , molecule = "water.xyz"},
    {type = "Rotate", delta = "10 deg", molecule = "water.xyz"},
    {type = "Resize", pressure = "5.00 bar"},
]

The idea is to add a 'molecule' section:

[molecules]
# Specify molecules from a file
water = {file = "water.xyz"}
# Specify molecules by hand inline
h2o = {atoms = ["C", "O", "O"], bonds = [[0, 1], [0, 2]]}

# Specify molecules by hand in a sub-table
[molecule.CO2]
atoms = ["C", "O", "O"]
bonds = [[0, 1], [0, 2]]

[[systems]]
file = "initial.pdb"

[[simulations]]
nsteps = 1000000
[simulations.propagator]
type = "MonteCarlo"
temperature = "500 K"
moves = [
    {type = "Translate", delta = "1 A", , molecule = "CO2"},
    {type = "Rotate", delta = "20 deg", molecule = "CO2"},
    {type = "Translate", delta = "2 A", , molecule = "water"},
    {type = "Rotate", delta = "10 deg", molecule = "h2o"},
    {type = "Resize", pressure = "5.00 bar"},
]

Proposed syntax

We only need the molecule type for most Monte-Carlo moves, which is derived from the atoms names and the bonding information. We can get it the same way as today, from a file:

[molecules]
water = {file = "water.xyz"}

Or explicitly specify it:

[molecules.water]
atoms = ["O", "H", "H"]
bonds = [[0, 1], [0, 2]

For GCMC moves, we also need the atomic positions:

[molecules.co2]
atoms = ["C", "O", "O"]
bonds = [[0, 1], [0, 2]]
positions = [
    [0, 0, 0],
    [1, 0, 0],
    [-1, 0, 0],
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions