HarmonicCosineAnglePotential

class HarmonicCosineAnglePotential(particleType1, particleType2, particleType3, k, cosTheta0)

Constructor of the potential.

Parameters:
  • particleType1 (ParticleType or ParticleIdentifier) – Identifier of the first particle type.
  • particleType2 (ParticleType or ParticleIdentifier) – Identifier of the second particle type. This is the central particle (the vertex) when calculating the angle.
  • particleType3 (ParticleType or ParticleIdentifier) – Identifier of the third particle type.
  • k (PhysicalQuantity of type energy) – Potential parameter.
  • cosTheta0 (float) – Potential parameter (cosine of the equilibrium angle)
getAllParameterNames()

Return the names of all used parameters as a list.

getAllParameters()

Return all parameters of this potential and their current values as a <parameterName / parameterValue> dictionary.

static getDefaults()

Get the default parameters of this potential and return them in form of a dictionary of <parameter name, default value> key-value pairs.

getParameter(parameterName)

Get the current value of the parameter parameterName.

setCosTheta0(cosTheta0)

Set the parameter cosTheta0.

Parameters:cosTheta0 (float) – Potential parameter (cosine of the equilibrium angle)
setCutoff(r_cut)

Sets the cutoff radius for the given potential

setParameter(parameterName, value)

Set the parameter parameterName to the given value.

Parameters:
  • parameterName (str) – The name of the parameter that will be modified.
  • value – The new value that will be assigned to the parameter parameterName.
setk(k)

Set the parameter k.

Parameters:k (PhysicalQuantity of type energy) – Potential parameter.

Usage Examples

Set up a bonded potential with a HarmonicCosineAnglePotential for an ethane molecule.

# Set up a new TremoloXPotentialSet
potential_set = TremoloXPotentialSet(name='Ethane_bonded')

# Add particle types for Carbon and Hydrogen.
potential_set.addParticleType(
    ParticleType.fromElement(Carbon, charge=-0.3*elementary_charge)
)
potential_set.addParticleType(
    ParticleType.fromElement(Hydrogen, charge=0.1*elementary_charge)
)

# Set up a new cosine angle potential for H-C-C angles and add it to the potential set.
angle_potential = HarmonicCosineAnglePotential(
    particleType1='H',
    particleType2='C',
    particleType3='C',
    k=2.1682*eV,
    cosTheta0=-0.3338,
)
potential_set.addPotential(angle_potential)

# Set up a new cosine angle potential for H-C-H angles and add it to the potential set.
angle_potential = HarmonicCosineAnglePotential(
    particleType1='H',
    particleType2='C',
    particleType3='H',
    k=1.51774*eV,
    cosTheta0=-0.3338,
)
potential_set.addPotential(angle_potential)

# Create a new TremoloXCalculator with this potential.
calculator = TremoloXCalculator(parameters=potential_set)

Here, only the HarmonicCosineAnglePotential block of the script is shown. The full script can be found found in the file ethane_bonded_potential_cosine_angle.py.

Notes

  • This potential class is a bonded potential. This means it requires a bond topology to be specified on the configuration which the potential should be used for. Bonds can be set using the findBonds() method on configurations (MoleculeConfiguration, BulkConfiguration, DeviceConfiguration, or SurfaceConfiguration), which automatically adds bonds for atoms which are closer than their combined covalent radii (multiplied by a fuzz_factor of 1.1 by default). Alternatively bonds can be set manually by passing a list of the atom index pairs that form the bonds to the setBonds() method on the configuration. If no bonds are specified on the configuration bonded potentials have no effect.

  • An angle potential is calculated for a triple (a,b,c) of atoms, which are connected by two adjacent bonds (a,b) and (b,c). The potential acts on the angle \(\theta\) formed by these two bonds:

    \[\theta(\mathbf{r}_{a,b}, \mathbf{r}_{b,c}) = \arccos\left( \frac{\mathbf{r}_{a,b} \cdot \mathbf{r}_{c,b} } {r_{a,b} r_{c,b}} \right)\]

    where \(\mathbf{r}_{i,j}, \, \{i, j\} \subset \{a,b,c\}\) is the distance vector from atom i to atom j, and \(r_{i,j}\) the corresponding bond distance.

    The potential is calculated as

    \[V(\theta) = \frac{k}{2} \left(\cos(\theta) - \cos(\theta_0) \right)^2\]

    where \(\theta_0\) is the equilibrium angle.