CoulombDSF

class CoulombDSF(r_cut=None, alpha=None, bonded_mode=None)

Constructor of the Coulomb solver.

Parameters:
  • r_cut (PhysicalQuantity of type length) – The cutoff radius of this Coulomb solver.
  • alpha (PhysicalQuantity of type length**-1) – Damping parameter in the DSF method. It determines how fast the Coulomb interactions decay with the particle distance.
  • bonded_mode

    Either CoulombDSF.evaluateAll or CoulombDSF.evaluate4.

    If evaluateAll is chosen, interactions between all particles - even those that are connected by bonds - are evaluated, using the sigma and epsilon parameters.

    If evaluate4 is chosen, interactions between particles that are connected by a path of bonds of length less than four are omitted.

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.

getInteractionMode()

Return the currently used interaction mode.

getParameter(parameterName)

Get the current value of the parameter parameterName.

setBondedMode(bonded_mode)

Set the way how particles that are connected by bonds are treated.

Parameters:bonded_mode

Either self.evaluateAll or self.evaluate4.

If evaluateAll is chosen, interactions between all particles - even those that are connected by bonds - are evaluated, using the sigma and epsilon parameters.

If evaluate4 is chosen, interactions between particles that are connected by a path of bonds of length less than four are omitted.

setCutoff(r_cut)

Set the cutoff radius of the Coulomb solver.

Parameters:r_cut (PhysicalQuantity of type length) – The cutoff radius of this Coulomb solver.
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.

Usage Examples

Define a potential for Quartz by adding particle types and interaction functions to the TremoloXPotentialSet.

# -------------------------------------------------------------
# Set up a SiO2 Quartz crystal
# -------------------------------------------------------------

# Set up lattice
lattice = Hexagonal(4.916*Angstrom, 5.4054*Angstrom)

# Define elements
elements = [Silicon, Silicon, Silicon, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen,
            Oxygen]

# Define coordinates
fractional_coordinates = [[ 0.4697,  0.0000,  0.0000    ],
                          [ 0.0000,  0.4697,  0.66666667],
                          [ 0.5303,  0.5303,  0.33333333],
                          [ 0.4135,  0.2669,  0.1191    ],
                          [ 0.2669,  0.4135,  0.547567  ],
                          [ 0.7331,  0.1466,  0.785767  ],
                          [ 0.5865,  0.8534,  0.214233  ],
                          [ 0.8534,  0.5865,  0.452433  ],
                          [ 0.1466,  0.7331,  0.8809    ]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )

# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------

# Create the Pedone_2006Fe2 potential by hand, by adding the individual components

potentialSet = TremoloXPotentialSet(name='Pedone_2006Fe2')

# Add the particle types to the potential set
potentialSet.addParticleType(ParticleType(symbol='Si',
                                          mass=28.0855*atomic_mass_unit,
                                          charge=2.4))
potentialSet.addParticleType(ParticleType(symbol='O',
                                          mass=15.9994*atomic_mass_unit,
                                          charge=-1.2))

# Add the pair potentials to the potential set
potentialSet.addPotential(MorsePotential('Si', 'O',
                                         r_0=2.1*Angstrom,
                                         k=2.0067*1/Ang,
                                         E_0=0.340554*eV,
                                         r_i=6.0*Angstrom,
                                         r_cut=7.5*Angstrom))
potentialSet.addPotential(Repulsive12Potential('Si', 'O',
                                               r_cut=7.5*Angstrom,
                                               c=1.0*Ang**12*eV))
potentialSet.addPotential(MorsePotential('O', 'O',
                                         r_0=3.618701*Angstrom,
                                         k=1.379316*1/Ang,
                                         E_0=0.042395*eV,
                                         r_i=6.0*Angstrom,
                                         r_cut=7.5*Angstrom))
potentialSet.addPotential(Repulsive12Potential('O', 'O',
                                               r_cut=7.5*Angstrom,
                                               c=22.0*Ang**12*eV))

# Add the coulomb solver to the potential set
potentialSet.setCoulombSolver(CoulombDSF(r_cut=9.0*Angstrom, alpha=0.2))

# Create the calculator from the potential set
calculator = TremoloXCalculator(parameters=potentialSet)

bulk_configuration.setCalculator(calculator)
bulk_configuration.update()

Notes

The damped shifted force (DSF) solver [FG06] represents an efficient method to calculate the electrostatic interactions between particles with partial charges, as defined in ParticleType.

The Coulomb interactions between two particles \(i\) and \(j\) are approximated by the following expression for the potential energy:

\[V_{ij}(r) = q_i q_j \left[ \frac{\mathrm{erfc}(\alpha r)}{r} - \frac{\mathrm{erfc}(\alpha R_c)}{R_c} + \left (\frac{\mathrm{erfc}(\alpha R_c)}{R_c^2} + \frac{2\alpha}{\pi^{1/2}} \frac{\exp(-\alpha^2 R_c^2)}{R_c} \right ) ( r - R_c ) \right ] \, .\]

When using bonded force fields the bonded_mode parameter can be used to modify how this potential acts between atoms that are connected by less than 4 bonds. If CoulombSolver.evaluateAll (or “mode_bondless”) is chosen, the potential acts between all selected atoms independent of the bonds between them. If CoulombSolver.evaluate4 (or “mode_14”) is chosen, the potential is switched off for all atoms that are connected via one, two, or three consecutive bonds.

[FG06]C. J. Fennell and J. D. Gezelter. Is the Ewald summation still necessary? Pairwise alternatives to the accepted standard for long-range electrostatics. J. Chem. Phys., 2006. doi:http://dx.doi.org/10.1063/1.2206581.