TremoloXCalculator

class TremoloXCalculator(parameters, dynamical_matrix_parameters=None)

The constructor for the calculator.

Parameters:
  • parameters (TremoloXPotentialSet) – A TremoloXPotentialSet object/list/tuple that contains potential and particle information.

  • dynamical_matrix_parameters – Deprecated. This parameter is not used anymore.

clearPartialCharges()

Clear all stored partial charges.

dynamicalMatrixParameters()

This method is deprecated.

Returns:

None always.

Return type:

None

static getGPUDevices()

Return all available GPU devices on this node as a list of (device id, device description) tuples.

metatext()
Returns:

The metatext of the object or None if no metatext is present.

Return type:

str | None

setDoInitialLoadBalancing(do_initial_load_balancing)

Method that sets to do initial load balancing

Parameters:

do_initial_load_balancing (bool) – Flag to set to do initial load balancing

setGPUAcceleration(pairPotentials=False, fft=False, mtp=False)

Enable GPU acceleration for certain operations.

Parameters:
  • pairPotentials – Enable GPU acceleration for some selected pair potentials.

  • fft – Enable GPU acceleration for fast fourier transforms (which are mainly used in SPME).

  • mtp – Enable GPU acceleration for MTP potential

setGPUDevice(device)

Set the GPU that should be used by this process.

Parameters:

device (int) – The device index that should be used.

setGPUDevices(indices)

Set the GPUs that should be used by the processes on this computer/node. This call must be performed by all processes simultaneously!

Parameters:

indices (sequence of int or None.) – List of device indices that should be used. If empty or None, all available devices are used.

setInternalOrdering(ordering)

Method that sets the internal ordering of the particles

Parameters:

ordering (TremoloXCalculator.DefaultOrdering | TremoloXCalculator.HilbertCurveOrdering | TremoloXCalculator.CellOrdering) – The ordering that will be used for all future calculations. Valid choices are “default”, “hilbertcurve” and “cellorder”

setMetatext(metatext)

Set a given metatext string on the object.

Parameters:

metatext (str | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.

setPartialCharges(charges)

Stores a number of <particle ID / charge> pairs that will override the charges in the potential set for these particles.

Please note that these stored charges will be applied to all configurations that are passed to this calculator. To clear the fixed charges, please call the _clearPartialCharges function.

Parameters:

charges – A dictionary that holds the <index / charge> pairs. The index is represented by an integer and is 0-based. The charge is expected to be a PhysicalQuantity of type charge.

setTabulationDelta(delta)

Method that sets the delta used to tabulate all tabulatable potentials (ATTENTION: it’s on experimental status!)

Parameters:

delta (PhysicalQuantity of type length) – The delta used during tabulation. If delta <= 0, no tabulation is done.

setVerletListsDelta(delta)

Method that sets the delta used to create Verlet-Lists

Parameters:

delta (PhysicalQuantity of type length) – The delta used for the creation. It has to be >= 0.

uniqueString()

Return a unique string representing the state of the object.

upgrade(configuration)

Method to upgrade the current calculator based on the given configuration.

Parameters:

configuration (AtomicConfiguration sub-class) – The configuration the calculator will be used for.

Usage Examples

Set up a TremoloXCalculator and add a Tersoff potential for a silicon crystal.

# Set up lattice
lattice = FaceCenteredCubic(5.4306*Angstrom)

# Define elements
elements = [Silicon, Silicon]

# Define coordinates
fractional_coordinates = [[0.0,  0.0,  0.0 ],
                          [0.25, 0.25, 0.25]]

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

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

potentialSet = Tersoff_Si_1988()
calculator = TremoloXCalculator(parameters=potentialSet)
calculator.setVerletListsDelta(0.25*Angstrom)

bulk_configuration.setCalculator(calculator)
bulk_configuration.update()

Notes

The TremoloXCalculator is the main calculation engine in the ATK-ForceField module. It is being developed by the Fraunhofer Institute for Algorithms and Scientific Computing (SCAI). For more details see the TremoloX homepage.

The TremoloXCalculator provides a broad range of different classical potentials. It requires a TremoloXPotentialSet object, which defines the parameters and settings of the potential. This object can either be a pre- defined potential from the list of available potentials, or a user-defined combination of different potential functions, collected in a TremoloXPotentialSet.