Bond Module — freud 0.9.0 documentation (2024)

Overview

freud.bond.BondingAnalysisAnalyze the bond lifetimes and flux present in the system.
freud.bond.BondingR12Compute bonds in a 2D system using a (\(r\), \(\theta_1\), \(\theta_2\)) coordinate system.
freud.bond.BondingXY2DCompute bonds in a 2D system using a (\(x\), \(y\)) coordinate system.
freud.bond.BondingXYTCompute bonds in a 2D system using a (\(x\), \(y\), \(\theta\)) coordinate system.
freud.bond.BondingXYZCompute 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 dimensionalarray is supplied, with each element containing the bond index mapped to thepair geometry of that element. The user provides a list of indices to track, sothat not all bond indices contained in the bond map need to be tracked incomputation.

The bond module is designed to take in arrays using the same coordinate systemsas the PMFT Module in freud.

Note

The coordinate system in which the calculation is performed is not the sameas the coordinate system in which particle positions and orientationsshould be supplied. Only certain coordinate systems are available forcertain 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).
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 from BondingR12modules).
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).
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
getListMap(self)

Get the dict used to map bond idx to list idx.

Returns:The mapping from bond to particle index.
Return type:dict
getRevListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from particle to bond index.
Return type:dict
class freud.bond.BondingXY2D(x_max, y_max, bond_map, bond_list)

Compute bonds in a 2D system using a (\(x\), \(y\)) coordinatesystem.

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 currenthistogram.

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).
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
getListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from bond to particle index.
Return type:dict
getRevListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from particle to bond index.
Return type:dict
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 inwhich 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).
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
getListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from bond to particle index.
Return type:dict
getRevListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from particle to bond index.
Return type:dict
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 inwhich 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).
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
getListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from bond to particle index.
Return type:dict
getRevListMap(self)

Get the dict used to map list idx to bond idx.

Returns:The mapping from particle to bond index.
Return type:dict
Bond Module — freud 0.9.0 documentation (2024)
Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated:

Views: 5610

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.