Bond Module

The bond modules 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 bonding module is designed to take in arrays using the same coordinate systems in 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\)):
    • \(X\), \(Y\)
    • \(X\), \(Y\), \(\theta_2\)
    • \(r\), \(\theta_1\), \(\theta_2\)
  • 3D particle coordinates -> \(X\), \(Y\), \(Z\)

Bonding Analysis

class freud.bond.BondingAnalysis(num_particles, num_bonds)

Analyze the bonds as calculated by freud’s Bonding modules.

Determines 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 – number of bonds to track
bond_lifetimes

return – lifetime of bonds :rtype: numpy.ndarray, shape=(\(N_{particles}\), varying), dtype= numpy.uint32

compute(self, frame_0, frame_1)

Calculates the changes in bonding states from one frame to the next.

Parameters:
  • frame_0 (numpy.ndarray shape=(\(N_{particles}\), \(N_{bonds}\)), dtype= numpy.uint32) – current/previous bonding frame (as output from BondingR12 modules)
  • frame_1 (numpy.ndarray shape=(\(N_{particles}\), \(N_{bonds}\)), dtype= numpy.uint32) – next/current bonding frame (as output from BondingR12 modules)
getBondLifetimes(self)
Returns:lifetime of bonds
Return type:numpy.ndarray, shape=(\(N_{particles}\), varying), dtype= numpy.uint32
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)
Returns:lifetime of bonds
Return type:numpy.ndarray, shape=(\(N_{particles}\), varying), dtype= numpy.uint32
getTransitionMatrix(self)
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 (numpy.ndarray, shape=(\(N_{particles}\), \(N_{bonds}\)), dtype= numpy.uint32) – first bonding frame (as output from BondingR12 modules)
num_bonds

Get number of bonds being tracked

Returns:number of bonds
Return type:unsigned int
num_frames

Get number of frames calculated

Returns:number of frames
Return type:unsigned int
num_particles

Get number of particles being tracked

Returns:number of particles
Return type:unsigned int
overall_lifetimes

return – lifetime of bonds :rtype: numpy.ndarray, shape=(\(N_{particles}\), varying), dtype= numpy.uint32

transition_matrix

return – transition matrix :rtype: numpy.ndarray

Coordinate System: \(x\), \(y\)

class freud.bond.BondingXY2D(x_max, y_max, bond_map, bond_list)

Compute the bonds each particle in the 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
bonds

return – particle bonds :rtype: numpy.ndarray

box

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
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 (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • ref_orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • points (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • nlist (freud.locality.NeighborList) – freud.locality.NeighborList object to use to find bonds
getBonds(self)
Returns:particle bonds
Return type:numpy.ndarray
getBox(self)

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
getListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
getRevListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]
list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
rev_list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]

Coordinate System: \(x\), \(y\), \(\theta_2\)

class freud.bond.BondingXYT(x_max, y_max, bond_map, bond_list)

Compute the bonds each particle in the 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
bonds

return – particle bonds :rtype: numpy.ndarray

box

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
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 (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • ref_orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • points (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • nlist (freud.locality.NeighborList) – freud.locality.NeighborList object to use to find bonds
getBonds(self)
Returns:particle bonds
Return type:numpy.ndarray
getBox(self)

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
getListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
getRevListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]
list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
rev_list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]

Coordinate System: \(r\), \(\theta_1\), \(\theta_2\)

class freud.bond.BondingR12(r_max, bond_map, bond_list)

Compute the bonds each particle in the system.

For each particle in the system determine which other particles are in which bonding sites.

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, t2, t1 coordinate
  • bond_list (numpy.ndarray) – list containing the bond indices to be tracked bond_list[i] = bond_index
bonds

return – particle bonds :rtype: numpy.ndarray

box

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
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 (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • ref_orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • points (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • orientations (numpy.ndarray, shape=(\(N_{particles}\)), dtype= numpy.float32) – orientations as angles to use in computation
  • nlist (freud.locality.NeighborList) – freud.locality.NeighborList object to use to find bonds
getBonds(self)
Returns:particle bonds
Return type:numpy.ndarray
getBox(self)

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
getListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
getRevListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]
list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
rev_list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]

Coordinate System: \(x\), \(y\), \(z\)

class freud.bond.BondingXYZ(x_max, y_max, z_max, bond_map, bond_list)

Compute the bonds each particle in the 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
bonds

return – particle bonds :rtype: numpy.ndarray

box

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
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 (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • ref_orientations (numpy.ndarray, shape=(\(N_{particles}\), 4), dtype= numpy.float32) – orientations as quaternions to use in computation
  • points (numpy.ndarray, shape=(\(N_{particles}\), 3), dtype= numpy.float32) – points to calculate the bonding
  • orientations (numpy.ndarray, shape=(\(N_{particles}\), 4), dtype= numpy.float32) – orientations as quaternions to use in computation
  • nlist (freud.locality.NeighborList) – freud.locality.NeighborList object to use to find bonds
getBonds(self)
Returns:particle bonds
Return type:numpy.ndarray
getBox(self)

Get the box used in the calculation

Returns:freud Box
Return type:freud.box.Box()
getListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
getRevListMap(self)

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]
list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> list_idx = list_map[bond_idx]
rev_list_map

Get the dict used to map list idx to bond idx

Returns:list_map
Return type:dict
>>> bond_idx = list_map[list_idx]