NQCModels

NQCModels.NQCModels — Module

NQCModels define the potentials and derivatives that govern the dynamics of the particles. These can exist as analytic models or as interfaces to other codes.

source
NQCModels.CompositeModel — Type

CompositeModel(Subsystems...)

A CompositeModel is composed of multiple Subsystems, creating an effective model which evaluates each Subsystem for its respective indices.

source
NQCModels.CompositeModel — Method
CompositeModel(subsystems::Subsystem...)

Combine multiple Subsystems into a single model to be handled by NQCDynamics.jl in simulations. Any calls made to potential, derivative and friction will apply each subsystem's model to the respective atoms while ignoring any other atoms.

Some checks are made to ensure each atom is affected by a model and that each model is applied over the same degrees of freedom, but no other sanity checks are made.

source
NQCModels.Model — Type

Top-level type for models.

Implementation

When adding new models, this should not be directly subtyped. Instead, depending on the intended functionality of the model, one of the child abstract types should be subtyped. If an appropriate type is not already available, a new abstract subtype should be created.

source
NQCModels.Subsystem — Type

Subsystem(M, indices)

A subsystem is a Model which only applies to a subset of the degrees of freedom of the original model.

When combined in a CompositeModel, potential(), derivative!() and friction!() will be sourced from the respective Subsystems.

Calling potential(), derivative!(), or friction!() on a subsystem directly will output the respective values for the entire system.

The Model specified will be supplied with the positions of the entire system for evaluation.

source
NQCModels.check_models — Method

Subsystem combination logic - We only want to allow combination of subsystems:

? 1. with the same number of degrees of freedom

  1. without overlapping indices (Build a different type of CompositeModel) to handle these cases separately.
source
NQCModels.derivative! — Method
derivative!(model::Model, D, R::AbstractMatrix)

Fill D with the derivative of the electronic potential as a function of the positions R.

This must be implemented for all models.

source
NQCModels.derivative! — Method
derivative!(model::Model, D, R::Number)

Convenience method for models where ndofs(model) == 1, allowing the position of a single 1D atom to be passed directly as a number rather than a 1×1 matrix. Wraps R in a 1×1 matrix and redirects to derivative!(model::Model, D, R::AbstractMatrix).

Typed as Number, rather than Real, to stay unambiguous should a model ever dispatch on a Number-typed argument itself.

source
NQCModels.derivative — Method
derivative(model::Model, R)

Allocating version of derivative!, this definition should be suitable for almost all models.

Implement zero_derivative to allocate an appropriate array then implement derivative! to fill the array.

GPU Support

GPU array support is provided via package extensions:

  • NQCModelsCUDAExt: CUDA.jl support (activated by using CUDA)
  • NQCModelsMetalExt: Metal.jl support (activated by using Metal)

When GPU arrays are passed, the return type matches the input array type.

source
NQCModels.derivative — Method
derivative(model::Model, R::Number)

Convenience method for models where ndofs(model) == 1, allowing the position of a single 1D atom to be passed directly as a number rather than a 1×1 matrix. Wraps R in a 1×1 matrix and redirects to derivative(model::Model, R::AbstractMatrix).

Typed as Number, rather than Real, to stay unambiguous should a model ever dispatch on a Number-typed argument itself.

source
NQCModels.ndofs — Method
ndofs(::Model)

Get the number of degrees of freedom for every atom in the model. Usually 1 or 3.

source
NQCModels.potential! — Method
potential!(model::Model, V, R::AbstractMatrix)

In-place version of potential, used to implement more efficient dynamics.

source
NQCModels.potential! — Method
potential!(model::Model, V, R::Number)

Convenience method for models where ndofs(model) == 1, allowing the position of a single 1D atom to be passed directly as a number rather than a 1×1 matrix. Wraps R in a 1×1 matrix and redirects to potential!(model::Model, V, R::AbstractMatrix).

Typed as Number, rather than Real, to stay unambiguous should a model ever dispatch on a Number-typed argument itself.

source
NQCModels.potential — Method
potential(model::Model, R::AbstractMatrix)

Evaluate the potential at position R for the given model.

GPU Support

GPU array support is provided via package extensions:

  • NQCModelsCUDAExt: CUDA.jl support (activated by using CUDA)
  • NQCModelsMetalExt: Metal.jl support (activated by using Metal)

When GPU arrays are passed, the return type matches the input array type.

source
NQCModels.potential — Method
potential(model::Model, R::Number)

Convenience method for models where ndofs(model) == 1, allowing the position of a single 1D atom to be passed directly as a number rather than a 1×1 matrix. Wraps R in a 1×1 matrix and redirects to potential(model::Model, R::AbstractMatrix).

Typed as Number, rather than Real, to stay unambiguous should a model ever dispatch on a Number-typed argument itself.

source