Name

NudgedElasticBand — Class for holding a series of configurations, ranging from an initial to a final configuration.

Synopsis

Namespace: NanoLanguage
NudgedElasticBand(
configuration_list,
image_distance,
generate_images
)

Description

Constructor for a nudged elastic band object. Sets up a series of configurations.

NudgedElasticBand Arguments

configuration_list

A list configurations that must be included in the series of configurations. Must hold at least two configurations.

Type: List of configurations, where all configurations must be of the same type, with the same elements and with the same spatial regions.

image_distance

Distance between the coordinates of successive configurations in the series of configurations if auto-generation is allowed.

Type: PhysicalQuantity with a length unit e.g. 0.5*Angstrom.

Default: 0.5*Angstrom
generate_images

Auto-generate intermediate images between specified configurations where necessary such that no distance between successive images is greater than the image_distance parameter.

Type: Boolean value e.g. True.

Default: True

NudgedElasticBand Methods

A NudgedElasticBand object provides the following methods:

  • calculator(): Returns the attached calculator - assumed to be the same across all images, we only select the first image's calculator.

  • configurationCopy(new_coordinates): Routine for getting a copy of a neb configuration, with new coordinates.

    new_coordinates

    The new coordinates to set.

    Type: A numpy array with dimensions (m*n,3), where m is the number of images, and n is the number of atoms in each image.

  • configurationType(): Returns the configuration type - e.g. BulkConfiguration.

  • dielectricRegions(): Return the dielectric regions for the configuration.

  • elements(): Returns a list of the atomic elements - e.g. [Oxygen, Hydrogen, Hydrogen]

  • ghostAtoms(): Returns the list of ghost_atoms.

  • imageDistance(): Returns the image distance, if it is set by the user.

  • images(): Returns all configurations.

  • indicesFromTags(): NEB presently contains no tags.

  • metallicRegions(): Return the metallic regions for the configuration.

  • nlprint(stream, name): Print a string containing an ASCII description of the NudgedElasticBand object.

    stream

    The stream the description should be written to.

    Type: A stream that supports strings being written to using 'write'.

    Default: sys.stdout
    name

    The name of the configuration being printed.

    Type: String.

    Default: 'NEB'
  • reactionCoordinates(): Returns the distance from the first image along the series of images - e.g. [0.0, 1.0, 2.1]*Angstrom.

  • refine(first, last, image_distance): Refine a section of the reaction path. Any current images between the specified starting and ending images are dropped in favor of new refinement images.

    first

    The starting image index in the reaction subpath being refined.

    Type: An integer

    last

    The ending image index in the reaction subpath being refined.

    Type: An integer

    image_distance

    The maximum distance between successive configurations - e.g. 0.2*Angstrom.

    Type: A strictly positive PhysicalQuantity of type length > 0.0*Angstrom

  • setCalculator(calculator, initial_state, initial_spin): Attach a calculator to the NudgedElasticBand, which will be used further calculations.

    calculator

    The calculator object that should be attached to the NudgedElasticBand.

    Type: A calculator compatible with the configuration type.

    initial_state

    A configuration to take the initial state from.

    Type: A configuration that the NudgedElasticBand was initialized with.

    Default: None
    initial_spin

    The initial InitialSpin object to be used for this configuration.

    Type: InitialSpin | None

    Default: None for calculators not supporting spin. Maximally spin-polarized InitialSpin for calculators supporting spin.
  • setDielectricRegions(dielectric_regions): Set the dielectric regions for the configuration.

    dielectric_regions

    A sequence of BoxRegion's.

  • setMetallicRegions(metallic_regions): Set the metallic regions for the configuration.

    metallic_regions

    A sequence of BoxRegion's.

  • symbols(): The element symbols of the configuration.

  • tags(): NEB presently contains no tags.

  • update():

Usage Examples

Setup a NudgedElasticBand calculation for conversion of ethane to ethene, i.e.

\displaystyle

\mathrm{C}_2\mathrm{H}_6 \rightarrow \mathrm{C}_2\mathrm{H}_4 +\mathrm{H}_2

# Nudged Elastic Band configuration

# Setup the configuration list
configuration_list = []

# Define elements
elements = [Carbon,]*2 + [Hydrogen,]*6

# Define initial configuration
cartesian_coordinates = [[  0.0000000,  -1.2257e-05,   0.7716335],
                         [  0.0000000,   1.2257e-05,  -0.7716335],
                         [  0.0000000,   1.02162746,   1.1513662],
                         [ -0.8847539,  -0.51081476,   1.1513615],
                         [  0.8847539,  -0.51081476,   1.1513615],
                         [  0.0000000,  -1.02162746,  -1.1513662],
                         [ -0.8847539,   0.51081476,  -1.1513615],
                         [  0.8847539,   0.51081476,  -1.1513615]]*Angstrom

initial_configuration = MoleculeConfiguration(
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# Append to the list of configurations
configuration_list.append(initial_configuration)

# Define final configuration
cartesian_coordinates = [[ 0.07475139, -0.04996446,  0.65332658],
                         [-0.07215805,  0.03485788, -0.6533275 ],
                         [ 0.66099367,  3.98448079, -0.09787249],
                         [-0.62932721,  0.35668865,  1.38033322],
                         [ 0.91714293, -0.53575571,  1.1465225 ],
                         [ 0.63207421, -0.37155137, -1.38032121],
                         [-0.91406328,  0.52147801, -1.1465376 ],
                         [ 1.05253733,  3.75843821, -0.68559951]]*Angstrom

final_configuration = MoleculeConfiguration(
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# Append to the list of configurations
configuration_list.append(final_configuration)

# Construct the Nudged Elastic Band object
neb_configuration = NudgedElasticBand(
    configuration_list,
    image_distance=0.2*Ang)

#define a calculator
calculator = LCAOCalculator()

#find the reaction path
optimized_neb = OptimizeNudgedElasticBand(
        neb_configuration,
        maximum_forces=0.05*eV/Ang)

neb_c6h6.py

Calculate the Total Energy for all images in a nudged elastic band configuration.

# Define elements.
elements = [Oxygen, Hydrogen, Hydrogen]

# Define coordinates.
c0 = [[  0.00,   0.00,   0.12],
      [  0.00,   0.76,  -0.48],
      [  0.00,  -0.76,  -0.48]]*Angstrom

c1 = [[  0.00,   0.00,   1.20],
      [  0.00,   0.76,  -0.48],
      [  0.00,  -0.76,  -0.48]]*Angstrom

# Set up a list of configurations.
configuration_list = [ MoleculeConfiguration(elements,c) for c in [c0,c1] ]

# Create the NudgedElasticBand object.
neb = NudgedElasticBand(configuration_list)

# Set a calculator on the configurations in the NEB - for analysis.
neb.setCalculator(LCAOCalculator())

# Create a Trajectory with a TotalEnergy analysis carried out on each configuration.
t = MakeTrajectory(neb, TotalEnergy)

maketrajectory2.py

Notes