# HarmonicAnglePotential¶

class HarmonicAnglePotential(particleType1, particleType2, particleType3, k, theta0)

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 / angle**2) – Potential parameter. theta0 (PhysicalQuantity of type angle) – Potential parameter (the equilibrium angle in radian).
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.

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.
setTheta0(theta0)

Set the parameter theta0.

Parameters: theta0 (PhysicalQuantity of type angle) – Potential parameter (the equilibrium angle in radian).
setk(k)

Set the parameter k.

Parameters: k (PhysicalQuantity of type energy / angle**2) – Potential parameter.

## Usage Examples¶

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

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

# Add particle types for Carbon and Hydrogen.
ParticleType.fromElement(Carbon, charge=-0.3*elementary_charge)
)
ParticleType.fromElement(Hydrogen, charge=0.1*elementary_charge)
)
# Set up a new angle potential for H-C-C angles and add it to the potential set.
angle_potential = HarmonicAnglePotential(
particleType1='H',
particleType2='C',
particleType3='C',
k=2.1682*eV,
theta0=1.9111355,
)

# Set up a new angle potential for H-C-H angles and add it to the potential set.
angle_potential = HarmonicAnglePotential(
particleType1='H',
particleType2='C',
particleType3='H',
k=1.51774*eV,
theta0=1.9111355,
)
# Create a new TremoloXCalculator with this potential.
calculator = TremoloXCalculator(parameters=potential_set)


Here, only the HarmonicAnglePotential block of the script is shown. The full script can be found found in the file ethane_bonded_potential.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) = k \left(\theta - \theta_0 \right)^2$