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\).
-
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
(self, frame_0, frame_1)¶ 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
modules). - frame_1 ((\(N_{particles}\), \(N_{bonds}\))
numpy.ndarray
) – Next/current bonding frame (as output fromBondingR12
modules).
- frame_0 ((\(N_{particles}\), \(N_{bonds}\))
-
getBondLifetimes
(self)¶ Return the bond lifetimes.
Returns: Lifetime of bonds. Return type: (\(N_{particles}\), varying) numpy.ndarray
-
getNumBonds
(self)¶ Get number of bonds tracked.
Returns: Number of bonds. Return type: unsigned int
-
getNumFrames
(self)¶ Get number of frames calculated.
Returns: Number of frames. Return type: unsigned int
-
getNumParticles
(self)¶ Get number of particles being tracked.
Returns: Number of particles. Return type: unsigned int
-
getOverallLifetimes
(self)¶ Return the overall lifetimes.
Returns: Lifetime of bonds. Return type: (\(N_{particles}\), varying) numpy.ndarray
-
getTransitionMatrix
(self)¶ Return the transition matrix.
Returns: Transition matrix. Return type: numpy.ndarray
-
initialize
(self, frame_0)¶ 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
modules).
-
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
(self, box, ref_points, ref_orientations, points, orientations, nlist=None)¶ Calculates the correlation function and adds to the current histogram.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points to calculate the bonding. - ref_orientations ((\(N_{particles}\), 4) – Orientations as angles to use in computation.
- points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points to calculate the bonding. - orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value = None).
- box (
-
getBonds
(self)¶ Return the particle bonds.
Returns: Particle bonds. Return type: numpy.ndarray
-
getBox
(self)¶ Get the box used in the calculation.
Returns: freud Box. Return type: freud.box.Box
-
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
(self, box, ref_points, ref_orientations, points, orientations, nlist=None)¶ Calculates the correlation function and adds to the current histogram.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points to calculate the bonding. - ref_orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points to calculate the bonding. - orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value = None).
- box (
-
getBonds
(self)¶ Return the particle bonds.
Returns: Particle bonds. Return type: numpy.ndarray
-
getBox
(self)¶ Get the box used in the calculation.
Returns: freud Box. Return type: freud.box.Box
-
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
(self, box, ref_points, ref_orientations, points, orientations, nlist=None)¶ Calculates the correlation function and adds to the current histogram.
Parameters: - box (
freud.box.Box
) – Simulation box - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points to calculate the bonding. - ref_orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points to calculate the bonding. - orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value = None).
- box (
-
getBonds
(self)¶ Return the particle bonds.
Returns: Particle bonds. Return type: numpy.ndarray
-
getBox
(self)¶ Get the box used in the calculation.
Returns: freud Box. Return type: freud.box.Box
-
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
(self, box, ref_points, ref_orientations, points, orientations, nlist=None)¶ Calculates the correlation function and adds to the current histogram.
Parameters: - box (
freud.box.Box
) – Simulation box. - ref_points ((\(N_{particles}\), 3)
numpy.ndarray
) – Reference points to calculate the bonding. - ref_orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - points ((\(N_{particles}\), 3)
numpy.ndarray
) – Points to calculate the bonding. - orientations ((\(N_{particles}\), 4)
numpy.ndarray
) – Orientations as angles to use in computation. - nlist (
freud.locality.NeighborList
, optional) – NeighborList to use to find bonds (Default value = None).
- box (
-
getBonds
(self)¶ Return the particle bonds.
Returns: Particle bonds. Return type: numpy.ndarray
-
getBox
(self)¶ Get the box used in the calculation.
Returns: freud Box. Return type: freud.box.Box