TremoloXPotentialSet

class TremoloXPotentialSet(name='DefaultPotential')

Create an empty TremoloXPotentialSet object.

Parameters:name (str) – The name of the potential set.
actOnlyBetweenTaggedRegions(tag1, tag2)

If this potential set consists only of twobody interactions, calling this function makes all twobody interactions act between particles of the two given, different tags. If this potential contains other interactions than twobody interactions, calling this function will raise a RuntimeError. Particle types and potentials that are added to this potential set after this function call are not affected. The Coulomb interactions are also not affected.

Parameters:
  • tag1 (str) – The first tag.
  • tag2 (str) – The second tag.
actOnlyOnTaggedRegion(tag)

Calling this function makes this potential set act only on particles that have the given tag. Particle types and potentials that are added to this potential set after this function call are not affected. The Coulomb interactions are also not affected.

Parameters:tag (str) – The tag on which this potential set should act.
addAnalyzer(analyzer)

Adds an analyzer to this potential set.

Parameters:analyzer (TremoloBaseAnalyzer) – The analyzer to should be added.
addOption(option)

Add an option to the potential.

Parameters:option (TremoloOption) – The option that will be added.
addParticleType(particle)

Add a particle type definition to the potential set.

Parameters:particle (ParticleType) – Instance of ParticleType.
addPotential(potential)

Add a potential to this potential set.

Parameters:potential (TremoloBasePotential) – The potential that will be added.
asTremoloPotential()

Convert the potential set as a TremoloX .potential file.

Returns:String that contains the .potential file representation.
Return type:str
findPotentials(potentialType=None, particleTypes=None)

Return a list of potentials in this potential set, that fullfil certain conditions.

Parameters:
  • potentialType (TremoloBasePotential) – A potential class (e.g. LennardJonesPotential).
  • particleTypes (str | ParticleType | ParticleIdentifier | sequence of type str/ParticleType/ParticleIdentifier) – A string or a sequence of strings that determine the particle types which the potential should act on.
Returns:

The list of potentials that are of type potentialType and act on the particle types that are given by particleTypes.

Return type:

list of type TremoloBasePotential

getCoulombSolver()
Returns:The current Coulomb potential or None.
Return type:CoulombSolver
getOptions()

Return a list of all options that are stored in this potential set.

getParticleType(symbol)

Return the particle definition with the given symbol

Parameters:symbol (ParticleType, ParticleIdentifier or str (deprecated)) – The identifier of the particle type.
Returns:The ParticleType that belongs to the given identifier or None if no such particle was found.
Return type:ParticleType | None
getParticleTypes()

Return a list of all particle types that are stored in this potential set.

getPotentials()

Return a list of all potentials that are stored in this potential set.

getUsedTags()
Returns:The tags this potential set acts on.
Return type:set of type str
merge(otherPotentialSet)

Merges the current potential set with another potential set.

Parameters:otherPotentialSet (TremoloXPotentialSet) – The potential set, the current potential should be merged with.
static mergePotentials(potentials)

Merges a list of potential sets and returns the merged potential set.

Parameters:potentials (list of type TremoloXPotentialSet) – List of potential sets to be merged.
Returns:The potential set that was created by merging all potentials in the list.
Return type:TremoloXPotentialSet
removeParticleType(symbol)

Remove a given particle type from the potential set.

Parameters:symbol (ParticleType, ParticleIdentifier or str (deprecated)) – The identifier of the particle type.
removePotential(potential)

Remove a potential from this potential set.

Parameters:potential (TremoloBasePotential) – The potential to be removed, this potential must have been retrieved by the findPotentials method.
setCoulombSolver(coulomb)

Sets the coulomb potential. Previously set Coulomb solvers will be overwritten.

Parameters:coulomb (CoulombSolver | None) – The new Coulomb solver. Must either be None or an object that was derived from the CoulombSolver class.
setPreferredUnitSystem(unitSystem)

Set the preferred unit system for this potential set. The choice here may be overridden if some potentials require a specific unit system.

Parameters:unitSystem (TremoloUnitSystem) – The unit system, e.g. (eVolt, kCalPerMole, SI).
setTags(tags)

Makes this potential set act only on particles with a given tag Note: This operation can not be reverted easily and will change the names of your particles.

Use it only when you are finished building the potential set!
Parameters:tags (str | list of type str) – If tags is a string, the potential set acts only on particles with the given tag, if tag is list of strings of length 2, the potential acts only on particles with different tags.
supportedElements()

Return the chemical elements that are supported by this potential set. The elements are returned as a list that contains the element symbols.

Returns:The list of the symbols of the supported elements.
Return type:list of type str

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

This class is used to combine a set of particles and interaction functions into a new potential. It can be used to define a new potential, based on the implemented potential classes, such as LennardJonesPotential, MorsePotential, or TersoffSingleTypePotential.

To display the composition of a predefined parameter set, which has been selected in the Script Generator, select Show default in the Global IO settings of the Script Generator, and send the script to the Editor. This allows you to edit individual parameter values.