Bond Module¶
Overview
freud.bond.BondingAnalysis |
Analyze the bond lifetimes and flux present in the system. |
freud.bond.BondingR12 |
Compute bonds in a 2D system using a (\(r\), \(\theta_1\), \(\theta_2\)) coordinate system. |
freud.bond.BondingXY2D |
Compute bonds in a 2D system using a (\(x\), \(y\)) coordinate system. |
freud.bond.BondingXYT |
Compute bonds in a 2D system using a (\(x\), \(y\), \(\theta\)) coordinate system. |
freud.bond.BondingXYZ |
Compute bonds in a 3D system using a (\(x\), \(y\), \(z\)) coordinate system. |
Details
The bond module allows for the computation of bonds as defined by a map. Depending on the coordinate system desired, either a two or three dimensional array is supplied, with each element containing the bond index mapped to the pair geometry of that element. The user provides a list of indices to track, so that not all bond indices contained in the bond map need to be tracked in computation.
The bond module is designed to take in arrays using the same coordinate systems as the PMFT Module in freud.
Note
The coordinate system in which the calculation is performed is not the same as the coordinate system in which particle positions and orientations should be supplied. Only certain coordinate systems are available for certain particle positions and orientations:
2D particle coordinates (position: [\(x\), \(y\), \(0\)], orientation: \(\theta\)):
- \(r\), \(\theta_1\), \(\theta_2\).
- \(x\), \(y\).
- \(x\), \(y\), \(\theta\).
3D particle coordinates:
- \(x\), \(y\), \(z\).
Bonding Analysis¶
-
class
freud.bond.
BondingAnalysis
(num_particles, num_bonds)¶ Analyze the bond lifetimes and flux present in the system.
Module author: Eric Harper <harperic@umich.edu>
Parameters: - num_particles (unsigned int) – Number of particles over which to calculate bonds.
- num_bonds (unsigned int) – Number of bonds to track.
Variables: - bond_lifetimes ((\(N_{particles}\), varying)
numpy.ndarray
) – Bond lifetimes. - overall_lifetimes ((\(N_{particles}\), varying)
numpy.ndarray
) – Overall bond lifetimes. - transition_matrix (
numpy.ndarray
) – Transition matrix. - num_frames (unsigned int) – Number of frames calculated.
- num_particles (unsigned int) – Number of tracked particles.
- num_bonds (unsigned int) – Number of tracked bonds.
-
compute
¶ Calculates the changes in bonding states from one frame to the next.
Parameters: - frame_0 ((\(N_{particles}\), \(N_{bonds}\))
numpy.ndarray
) – Current/previous bonding frame (as output fromBondingR12
and similar modules). - frame_1 ((\(N_{particles}\), \(N_{bonds}\))
numpy.ndarray
) – Next/current bonding frame (as output fromBondingR12
and similar modules).
- frame_0 ((\(N_{particles}\), \(N_{bonds}\))
-
initialize
¶ Calculates the changes in bonding states from one frame to the next.
Parameters: frame_0 ((\(N_{particles}\), \(N_{bonds}\)) numpy.ndarray
) – First bonding frame (as output fromBondingR12
and similar modules).
Bonding \(\left(r, \theta_1, \theta_2\right)\)¶
-
class
freud.bond.
BondingR12
(r_max, bond_map, bond_list)¶ Compute bonds in a 2D system using a (\(r\), \(\theta_1\), \(\theta_2\)) coordinate system.
Module author: Eric Harper <harperic@umich.edu>
Parameters: - r_max (float) – Distance to search for bonds.
- bond_map (
numpy.ndarray
) – 3D array containing the bond index for each r, \(\theta_2\), \(\theta_1\) coordinate. - bond_list (
numpy.ndarray
) – List containing the bond indices to be tracked,bond_list[i] = bond_index
.
Variables: - bonds (
numpy.ndarray
) – Particle bonds. - box (
freud.box.Box
) – Box used in the calculation. - list_map (dict) – The dict used to map bond index to list index.
- rev_list_map (dict) – The dict used to map list idx to bond idx.
-
compute
¶ Calculates the bonds.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points used to calculate the bonding. - ref_orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
) – Reference orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points used to calculate the bonding. Usesref_points
if not provided orNone
. - orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
, optional) – Orientations as angles to use in computation. Usesref_orientations
if not provided orNone
. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value =None
).
- box (
Bonding \(\left(x, y\right)\)¶
-
class
freud.bond.
BondingXY2D
(x_max, y_max, bond_map, bond_list)¶ Compute bonds in a 2D system using a (\(x\), \(y\)) coordinate system.
Module author: Eric Harper <harperic@umich.edu>
Parameters: - x_max (float) – Maximum \(x\) distance at which to search for bonds.
- y_max (float) – Maximum \(y\) distance at which to search for bonds.
- bond_map (
numpy.ndarray
) – 3D array containing the bond index for each \(x\), \(y\) coordinate. - bond_list (
numpy.ndarray
) – List containing the bond indices to be tracked,bond_list[i] = bond_index
.
Variables: - bonds (
numpy.ndarray
) – Particle bonds. - box (
freud.box.Box
) – Box used in the calculation. - list_map (dict) – The dict used to map bond index to list index.
- rev_list_map (dict) – The dict used to map list idx to bond idx.
-
compute
¶ Calculates the bonds.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points used to calculate the bonding. - ref_orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
) – Reference orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points used to calculate the bonding. Usesref_points
if not provided orNone
. - orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
, optional) – Orientations as angles to use in computation. Usesref_orientations
if not provided orNone
. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value =None
).
- box (
Bonding \(\left(x, y, \theta\right)\)¶
-
class
freud.bond.
BondingXYT
(x_max, y_max, bond_map, bond_list)¶ Compute bonds in a 2D system using a (\(x\), \(y\), \(\theta\)) coordinate system.
For each particle in the system determine which other particles are in which bonding sites.
Module author: Eric Harper <harperic@umich.edu>
Parameters: - x_max (float) – Maximum \(x\) distance at which to search for bonds.
- y_max (float) – Maximum \(y\) distance at which to search for bonds.
- bond_map (
numpy.ndarray
) – 3D array containing the bond index for each \(x\), \(y\) coordinate. - bond_list (
numpy.ndarray
) – List containing the bond indices to be tracked,bond_list[i] = bond_index
.
Variables: - bonds (
numpy.ndarray
) – Particle bonds. - box (
freud.box.Box
) – Box used in the calculation. - list_map (dict) – The dict used to map bond index to list index.
- rev_list_map (dict) – The dict used to map list idx to bond idx.
-
compute
¶ Calculates the bonds.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points used to calculate the bonding. - ref_orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
) – Reference orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points used to calculate the bonding. Usesref_points
if not provided orNone
. - orientations ((\(N_{particles}\), 1) or (\(N_{particles}\),)
numpy.ndarray
, optional) – Orientations as angles to use in computation. Usesref_orientations
if not provided orNone
. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value =None
).
- box (
Bonding \(\left(x, y, z\right)\)¶
-
class
freud.bond.
BondingXYZ
(x_max, y_max, z_max, bond_map, bond_list)¶ Compute bonds in a 3D system using a (\(x\), \(y\), \(z\)) coordinate system.
For each particle in the system determine which other particles are in which bonding sites.
Module author: Eric Harper <harperic@umich.edu>
Parameters: - x_max (float) – Maximum \(x\) distance at which to search for bonds.
- y_max (float) – Maximum \(y\) distance at which to search for bonds.
- z_max (float) – Maximum \(z\) distance at which to search for bonds.
- bond_map (
numpy.ndarray
) – 3D array containing the bond index for each \(x\), \(y\), \(z\) coordinate. - bond_list (
numpy.ndarray
) – List containing the bond indices to be tracked,bond_list[i] = bond_index
.
Variables: - bonds (
numpy.ndarray
) – Particle bonds. - box (
freud.box.Box
) – Box used in the calculation. - list_map (dict) – The dict used to map bond index to list index.
- rev_list_map (dict) – The dict used to map list idx to bond idx.
-
compute
¶ Calculates the bonds.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points used to calculate the bonding. - ref_orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Reference orientations as quaternions to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points used to calculate the bonding. Usesref_points
if not provided orNone
. - orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as quaternions to use in computation. Usesref_orientations
if not provided orNone
. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value =None
).
- box (