Chain

Manipulate the chain of spin systems (also called images), e.g. add, remove or change active image. Get information, such as number of images or energies and reaction coordinates.

spirit.chain.delete_image(p_state, idx_image=-1, idx_chain=-1)

Removes the specified image from the chain.

Note that the active image might change.

If it is the last remaining image in the chain, no action is taken.

spirit.chain.get_energy(p_state, idx_chain=-1)

Returns an array of shape(NOI) containing the energies of the images.

spirit.chain.get_energy_interpolated(p_state, idx_chain=-1)

Returns an array containing the interpolated energy values along the chain.

The number of interpolated values between images can be set in the GNEB parameters.

spirit.chain.get_noi(p_state, idx_chain=-1)

Get number of images (NOI) in the chain.

spirit.chain.get_reaction_coordinate(p_state, idx_chain=-1)

Returns an array of shape(NOI) containing the reaction coordinates of the images.

spirit.chain.get_reaction_coordinate_interpolated(p_state, idx_chain=-1)

Returns an array containing the interpolated reaction coordinate values along the chain.

The number of interpolated values between images can be set in the GNEB parameters.

spirit.chain.image_to_clipboard(p_state, idx_image=-1, idx_chain=-1)

Copies an image to the clipboard of Spirit. It can then be later e.g. inserted or appended.

spirit.chain.insert_image_after(p_state, idx_image=-1, idx_chain=-1)

Inserts an image after the specified index.

Note that the active image might change.

If no image is in the clipboard, no action is taken.

spirit.chain.insert_image_before(p_state, idx_image=-1, idx_chain=-1)

Inserts an image in front of the specified index.

Note that the active image might change.

If no image is in the clipboard, no action is taken.

spirit.chain.jump_to_image(p_state, idx_image=-1, idx_chain=-1)

Set the index of the active image in the chain.

spirit.chain.next_image(p_state, idx_chain=-1)

Switch the active image index to the next highest in the chain.

spirit.chain.pop_back(p_state, idx_chain=-1)

Removes the last image from the chain.

Note that the active image might change.

If it is the last remaining image in the chain, no action is taken.

spirit.chain.prev_image(p_state, idx_chain=-1)

Switch the active image index to the next lowest in the chain.

spirit.chain.push_back(p_state, idx_chain=-1)

Appends an image to the chain.

If no image is in the clipboard, no action is taken.

spirit.chain.replace_image(p_state, idx_image=-1, idx_chain=-1)

Replaces the image from the one in the clipboard.

If no image is in the clipboard, no action is taken.

spirit.chain.set_length(p_state, n_images, idx_chain=-1)

Set the number of images (NOI) in the chain.

If the chain is longer, the corresponding number of images is erased from the end.

If the chain is shorter, the corresponding number of images is appended.

Note that the active image might change.

If no image is in the clipboard, no action is taken.

spirit.chain.setup_data(p_state, idx_chain=-1)
spirit.chain.update_data(p_state, idx_chain=-1)

Updates various data of the chain, including:

  • Energies of images
  • Reaction coordinates of images
  • Interpolated energy and reaction coordinate values