Beyond Marcus Rates tool

What it does

The BeyondMarcusRatesGenerelized module computes rates at which a process happens involving the change of the state of bimolecular system.

Physical picture.

There are identical molecules, molecule 1 (m1) and molecule 2 (m2), weakly interacting, the overlap integral is J. Both molecules overcome transition from their initial states to a final states. For instance, a hole hopping from m2 to m1 would correspond to a following process (as specified in settings file (yaml)):

  initial_state: ['neutral', 'cation'],
  final_state: ['cation', 'neutral'],

where first and second elements in the lists are states of the first and second molecules, respectively. Currently existing states are:

  • 'neutral' (self-explained),
  • 'cation' (self-explained),
  • 'anion' (self-explained),
  • 's1' (singlet 1)
  • 't2' (triplet 2)

See also: How to add additional state?

For every molecule i = {1,2}, the transition is completed in three steps (points), initial, final and transition state, so six points in total, see Table 1 below. Six points is a direct analogy to four points, using in Nelson scheme.

Table 1. 6 points = six simulations.

name meaning geometry optimized state actual state folder name
point (1, 1) molecule 1, initial state, optimized initial_state[0] initial_state[0] point_1_1
point (1, 2) molecule 1, final state, geometry from (1, 1) initial_state[0] final_state[0] point_1_2
point (1, 3) molecule 1, final state, optimized final_state[0] final_state[0] point_1_2
point (2, 1) molecule 2, initial state, optimized initial_state[1] initial_state[1] point_2_1
point (2, 2) molecule 2, final state, geometry from (2, 1) initial_state[1] final_state[1] point_2_2
point (2, 3) molecule 2, final state, optimized final_state[1] final_state[1] point_2_3

The goal of this module is to compute rates of the transition process according to the theoretical approach [1], which goes beyond Marcus theory. Needed if Marcus rates accuracy is not sufficient.

Technically speaking, the module performs 6 simulations of the molecule using DFT engine and some postprocessing.

Brief theory

Rates

The rates are computed according to formula A18 of [1].

The components of these formula that require quantum chemistry calculations are:

  1. Vibratioal frequencies ωi.
  2. Reduced masses of phonon modes, μi.
  3. Normal displacements Δqi.

Components 1 and 2 are computed and returned by Turbomole within the vibrational analysis. Component 3, normal displacements is computed from Cartesial displacement Δxi and normal modes mi:

  Δqi = Σj mij Δxj  (1)

where i numbers normal modes, j numbers Cartesian coordinates.

Normal displacement is simply the difference between the initial and final Cartesian coordinates of the molecule.

The normal modes in Turbomole is returned as columns of the matrix mTM. This matrix acts on normal coordinates to yield Cartesian coordinates:

  Δxj = Σi mTM,ji Δqi  (2)

or in a matrix form:

  Δx = mTM Δq  (2.1)

Therefore, the matrix that we need in (1) is an inverse of the matrix returned by Turbomole:

  m = (mTM)-1.  

All components in formula A18 are expressed through three mentioned vectors.

Reorganization energies

Reorganization energies associated with i-th normal mode, λi, are computed as:

  λi = 0.5 μi ωi2 Δqi2  

When the charge-phonon coupling is linear in the displacements Δqj of the phonon modes and when these displacements are within the harmonic regime, the total reorganization energy λ can be computed as a sum of λi:

  λ = Σi λi  

Cartesian displacement

Geometries of the molecule m at points (m, 1) and (m, 3) substracted from each other yield Cartesian displacement vector Δx.

Choice of the molecular state for the vibrational analysis

A key hessian_source specifies the state, for which the vibrational analysis will be performed yielding hessian and related output. This is the list specifying the state of molecule 1 and molecule 2, which will be used to perform vibrational analysis.

Implicitly specifying the source for the vibrational analysis

Natural choice of the source of the hessian is using either initial or final state of the molecule. Consequently, possible sources for every molecule is "initial" or "final". For instance, if an initial state of molecule 1 should be a source for molecule 1, and the final state of molecule 2 should be a source for molecule 2, set:

"hessian_source": ["initial", "final"]

This will look up, which state is initial for molecule 1 according to "initial_state" key, and which state is final for molecule 2 according to "final_state" key. For the first molecule, initial state is (always) point (1,1) and the final state is point (1,3). For the second molecule, initial state is (always) point (2,1) and the final state is point (3,3). Thus, we set the source of hessian explicitly.

Explicitly specify the source for the vibrational analysis

If it is inconvenient to perform vibrational analysis at mentioned points, one can also specify hessian_source for one or both molecules explicitly indicating the state, which has to be a source for the vibrational analysis. So far, this may only be "neutral". In this case, another simulation will be set up (name of the point is 0, folder name is "point_0", see Table 2). This may be redundant, if one of the optimized states is neutral.

Note: Other explicit hessian sources may be quickly implemented.

Table 2. Additional point as a source for vibrational analysis.

name meaning geometry optimized state actual state folder name
point 0 additional state to perform vibrational analysis neutral neutral point_0

How to use

It is a part of MolecularTools, extending QuantumPatch features.

Run

BeyondMarcusRatesGenerelized.py --help

to see the following command line arguments:

1 2 3 4 5
-h - --help - show this help message and exit
-f FILE --file FILE specify xyz or mol2 file of your molecule
-s SETTINGS --settings SETTINGS optional settings file
-t THREADS --threads THREADS specify number of threads
-ired INTERNAL_COORDINATES --internal_coordinates INTERNAL_COORDINATES if using internal coordinates
-func FUNCTIONAL --functional FUNCTIONAL functional to use
-path SIMULATION_PATH --simulation_path SIMULATION_PATH simulation directory

First run

Normally you run the module with settings and molecule specified:

BeyondMarcusRatesGenerelized.py -f h2o.xyz -s opt_external.yaml.

We do not provide the settings file template, but it is suggested to make of the following "first runs", which will generate an up-to-date sample settings file, opt_external.yaml.

1. Toy one-mode system.

No molecule is needed. Maximally quick. Uses parameters and reproduces Figure 1 (top/left) of [1].

Run the script with no arguments:

BeyondMarcusRatesGenerelized.py

2. Real molecule.

Prepare some molecule, e.g. create a file h2o.xyz with a following content:

3
water.xyz
O         -0.01310       -0.01860        0.00000
H         -0.29940        0.91860        0.00000
H          0.96590        0.02390        0.00000

Either of these runs will generate the default settings file called opt_external.yaml and output files.

Options

Options, for instanceopt_external.yaml looks as follows (this may be slightly different later):

DFT_options:
  basis: def2-SVP
  functional: BP86
  ired: true
  method: ridft
  threads: 1
final_state:
- cation
- neutral
hessian_source:
- initial
- initial
initial_state:
- neutral
- anion
rates:
  energy_range:
    high: 0.3
    low: -0.3
    num: 20
  integration:
    epsabs: 10.0
    epsrel: 0.0015
    limit: 500
    range:
      high: 1.0e-12
      low: -1.0e-12
      num: 10001
  physical_settings:
    lambda_classical: 0.01
    temperature: 300
    transfer_integral: 0.001
  visualization:
    ylim:
    - 1000000.0
    - 1000000000000.0
replay:
  from_sim_folders: true
  from_yaml: true


DFT_options key is the same as DFTEngine Turbomole settings in QuantumPatch. However, all settings specified the molecule state (charge, multiplicity, etc.) will be overwritten by the settings for every particular point, which, in turn, are set by initial_state and final_state keys, as well as hessian_source.

A key rates sets parameters that are directly related to rates calculations, including:

  • the energy difference range (energy_range),
  • integration parameters in formula A18 of [1],
  • physical_settings sets values of λcl [eV], T [K] and J [eV] (notations from [1]).
  • visualization represented by a figure energy_vs_rates.png.

A key replay allows or forbid replay from the simulation folders (e.g. point_*) or from output_*.yaml file. In the first case, replay is allowed from simulation folders, in the second case, replay is allowed from output_*.yaml. Replay from output_*.yaml has priority over the replay from simulation folders.

Output

Folders

Upon simulations, six folders will be created, corresponding to six simulations ("points"), see Table 1, where Turbomole output for every simulation point is saved.

Data

Data is represented in yaml.

Two files will be generated:

  1. output_<mol_name>.yaml where <mol_name> is a name of "*.xyz" file without ".xyz".
  2. energy_vs_rate.yaml.

Pictures

energy_vs_rate.png visualises Marcus and Quantum rates. Source of the data is stored in corresponding "*.yaml" files.

External run

For workflows, use a function external_main() from BeyondMarcusRatesGenerelized. Its arguments are same as command line parameters of the script BeyondMarcusRatesGenerelized.py.

Unit tests

Pytests: test_BeyondMarcusRatesGenerelized.py.

  • Quantitative test is done for antracene molecule.
  • Contains not only tests, but also examples.
  • Turbomole Engine is called only for H2O molecule.

Output examples.

Rates for toy, one-mode, system

Corresponds to Fig 1 (top left) of [1]

Computed with settings used to generate Figure 1, top left in [1].

Rates for a hole jump, α-NPD.

Hole jumps

Settings file: opts_external xyz file: opts_external

Advanced Usage

Saving and loading geometries and Hessians.

Already computed hessian and/or geometry for the final or initial state and want to reuse it? This is possible, see below.

Damping geometries and hessians per point

To save geometry and/or hessian separately for initial and final state for later usage, add this to the settings:

save:
  what:
    hessian: true
    geometry: true
    opts: true
  where:
    "per_molecule_info"
Key specifications:
Setting Description Possible Values (Default)
save.what.hessian Save Hessian matrix files true / false (true)
save.what.geometry Save molecular geometry files true / false (true)
save.what.opts Save DFT settings true / false (true)
save.where Folder where saved files will be stored <name_of_the_folder> ("per_molecule_info"`)
File Naming Conventions:
File Type Naming Template Example (mol_id=1, state=0)
Geometry mol_{mol_id}_state_{state}.xyz mol_1_state_0.xyz
Hessian mol_{mol_id}_state_{state}.hess.yaml mol_1_state_0.hess.yaml
Opts mol_{mol_id}_state_{state}.opts.yaml mol_1_state_0.opts.yaml

Notes:

  • per_molecule_info is the default folder where these files will be saved.
  • Ensure save.what.hessian, save.what.geometry, and save.what.opts are set to true if you need these files.
  • The {mol_id} and {state} placeholders will be replaced with actual molecule and state identifiers.

Loading precomputed geometries and hessians

To use already optimized geometries and/or hessians, set the state of interest and the hessian source of interest to the corresponding file names: Example:

initial_state:
- "per_molecule_info/mol_1_state_1.xyz"
- anion
final_state:
- anion
- neutral
hessian_source:
- "per_molecule_info/mol_2_state_3.hess.yaml"
- final

In this example:

  • The geometry of the initial state of the first molecule will be taken form the file "per_molecule_info/mol_1_state_1.xyz".
  • The Hessian of the first molecule will be taken from the file "per_molecule_info/mol_2_state_3.hess.yaml".
  • all other points will be computed during the runtime.

Important Notes:

  • Any reasonable combination of pre-computed and to-be-computed settings is possible. For example, you can use pre-computed Hessians for both molecules while computing geometries dynamically.
  • However, the hessian_source cannot be set to "initial" if "initial" is the geometry name. This would create ambiguity, as the tool would not know in which state the Hessian should be computed.

Precomputing Hessians and geometries of the individual points.

To only precompute the Hessian and the geometry use the function external_main_single_point. It uses absolutely same setting as external_main. The only difference: the molecule(s) as specified will only be computed in the initial state. If the Hessian has to be computed, set "hessian_source" to "initial". Otherwise, only geometry will be optimized.

References

[1] Xander de Vries et al. Full quantum treatment of charge dynamics in amorphous molecular semiconductors [link],

The results of the search are