Molecular dynamics of Coronene

Molecular dynamics of Coronene

A. Simple dynamics

Edit a new file tutorial_2_A.py with the following instructions.

This imports deMonPy and loads the global configuration (executable and basis paths) from global.json.

import deMonPy

deMonPy.configure_from_file("global.json")

This reads the coronene structure from the XYZ file into ASE images; coro keeps the last image, the starting geometry of the dynamics.

from deMonPy.molden import read_XYZ

images, comm = read_XYZ("./data/coronene.xyz")
coro = images[-1]

This sets up the molecular-dynamics calculation on coronene: SCC-DFTB, initial velocities set to zero (MDYNAMICS ZERO), a 0.5 fs time step, 100 MD steps with the structure written at each step, and trajectory output enabled.

from deMonPy.deMonNano import deMonNano

WORKDIR = ".run/tutorial-2/A/"

parameters = {
    "DEMON_EXECUTABLE": deMonPy.DEMON_EXECUTABLE,
    "BASIS": {"PTYPE": "BIO", "SKFILE": deMonPy.DEMON_BASIS},
    "DEMON_PARAMETERS": {
        "ACTIVE": {
            "DFTB": {"SCC": True},
        },
    },
    "DEMON_MODULE": {
        "ACTIVE": {
            "MD": {
                "MDYNAMICS": {
                    "ZERO": True,
                },
                "TIMESTEP": 0.5,
                "MDSTEP": {"MAX": 100, "OUT": 1},
                "TRAJECTORY": True,
            }
        }
    },
}

dem = deMonNano(title="CALCULATION DEMONANO", workdir=WORKDIR, **parameters)

dem.calculate(symbols=coro.symbols, positions=coro.positions)

Run the command :

$ python3 tutorial_2_A.py

Note: In future, we will no longer remind you to run this command using the correct script name.

Try to visualize molecular evolution in MD.

from ase.visualize import view

view(dem.results["trajectory"])

B. Dynamics at 300K

Same setup as in section A, except that MDYNAMICS RANDOM starts the trajectory with random initial velocities corresponding to 300 K.

from deMonPy.deMonNano import deMonNano

WORKDIR = ".run/tutorial-2/B/"

parameters = {
    "DEMON_EXECUTABLE": deMonPy.DEMON_EXECUTABLE,
    "BASIS": {"PTYPE": "BIO", "SKFILE": deMonPy.DEMON_BASIS},
    "DEMON_PARAMETERS": {
        "ACTIVE": {
            "DFTB": {"SCC": True},
        },
    },
    "DEMON_MODULE": {
        "ACTIVE": {
            "MD": {
                "MDYNAMICS": {
                    "RANDOM": 300,
                },
                "TIMESTEP": 0.5,
                "MDSTEP": {"MAX": 100, "OUT": 1},
                "TRAJECTORY": True,
            }
        }
    },
}

dem = deMonNano(title="CALCULATION DEMONANO", workdir=WORKDIR, **parameters)

dem.calculate(symbols=coro.symbols, positions=coro.positions)

As before, this displays the molecular evolution, now for the 300 K trajectory.

from ase.visualize import view

view(dem.results["trajectory"])

Next steps

Tutorial 3 — Harmonic spectra of Coronene monomer and dimer continues with the coronene system and adds a frequency analysis of the monomer and the dimer. The MDYNAMICS keyword page documents the velocity options used here (zero or random), and the DeMonNanoPy Examples section scales the same workflow to larger systems such as the graphene calculation.