Index
AtomsCalculators.EnergyAtomsCalculators.ForcesAtomsCalculators.VirialAtomsCalculators.Testing.test_energy_forcesAtomsCalculators.Testing.test_energy_forces_virialAtomsCalculators.Testing.test_forcesAtomsCalculators.Testing.test_potential_energyAtomsCalculators.Testing.test_virialAtomsCalculators._fltypeAtomsCalculators.calculateAtomsCalculators.energy_forcesAtomsCalculators.energy_forces!AtomsCalculators.energy_forces_virialAtomsCalculators.energy_forces_virial!AtomsCalculators.energy_unitAtomsCalculators.force_unitAtomsCalculators.forcesAtomsCalculators.forces!AtomsCalculators.get_parametersAtomsCalculators.get_stateAtomsCalculators.length_unitAtomsCalculators.potential_energyAtomsCalculators.promote_force_typeAtomsCalculators.set_parameters!AtomsCalculators.set_state!AtomsCalculators.virialAtomsCalculators.zero_energyAtomsCalculators.zero_forcesAtomsCalculators.zero_virialAtomsCalculators.@generate_interface
AtomsCalculators.Energy — TypeEnergy : a calculate property to calculate the potential energy
AtomsCalculators.Forces — TypeForces : a calculate property to calculate the forces
AtomsCalculators.Virial — TypeVirial : a calculate property to calculate the virial
AtomsCalculators._fltype — Method_fltype(system) : floating point type used by the calculator
This is an internal helper function and not considered part of the public API.
AtomsCalculators.calculate — Functioncalculate(properties, sys, calc; kwargs...) -> NamedTuple
AtomsCalculators.energy_forces! — Methodenergy_forces!(f, system, calculator; kwargs...) -> NamedTuple
AtomsCalculators.energy_forces — Methodenergy_forces(system, calculator; kwargs...) -> NamedTuple
AtomsCalculators.energy_forces_virial! — Methodenergy_forces_virial!(f, system, calculator; kwargs...) -> NamedTuple
AtomsCalculators.energy_forces_virial — Methodenergy_forces_virial(system, calculator; kwargs...) -> NamedTuple
AtomsCalculators.energy_unit — Functionenergy_unit(calc) : energy unit used by the calculator
AtomsCalculators.force_unit — Methodforce_unit(calc) : force unit returned by the calculator
AtomsCalculators.forces — Functionforces(sys, calc; kwargs...)::AbstractVector{SVector{D, Unitful.Force}}
AtomsCalculators.forces! — Functionforces(frc, sys, calc; kwargs...) -> frc
AtomsCalculators.get_parameters — Methodget_parameters(calc) -> NamedTuple or ComponentArray
AtomsCalculators.get_state — Methodget_state(calc) -> NamedTuple or ComponentArray
AtomsCalculators.length_unit — Functionlength_unit(calc) : length unit assumed and used by the calculator
AtomsCalculators.potential_energy — Functionpotential_energy(sys, calc; kwargs...)::Unitful.Energy
AtomsCalculators.promote_force_type — Methodpromote_force_type(system, calc) : force type (float type and unit) returned by the calculator
AtomsCalculators.set_parameters! — Methodset_parameters!(calc, parameters) -> calc_new
The returned calc_new may be a mutated calc or a new object. The caller should not assume that calc_new is the same object as calc. This allows for non-mutating implementations of set_parameters!.
AtomsCalculators.set_state! — Methodset_state!(calc, state) -> calc_new
The returned calc_new may be a mutated calc or a new object. The caller should not assume that calc_new is the same object as calc. This allows for non-mutating implementations of set_state!.
AtomsCalculators.virial — Functionvirial(sys, calc; kwargs...)::SMatrix{3,3,<:Unitful.Energy}
AtomsCalculators.zero_energy — Methodzero_energy(system, calc) : initialize a zero energy value
AtomsCalculators.zero_forces — Methodzero_forces(system, calc) : allocate a zero forces array
AtomsCalculators.zero_virial — Methodzero_virial(system, calc) : initialize a zero virial matrix
AtomsCalculators.@generate_interface — Macro@generate_interfaceGenerate complementary function for given function expression. This is mean to help defining the interface, so that you only need to define one of the interface methods for a given type of calculation (energy, forces, virial).
Example
Generate forces! and calculate(AtomsCalculators.Forces(), ...) calls from forces definition
AtomsCalculators.@generate_interface function AtomsCalculators.forces(system, calculator::MyType; kwargs...)
#definition here
endGenerate forces and calculate(AtomsCalculators.Forces(), ...) calls from forces! definition
AtomsCalculators.@generate_interface function AtomsCalculators.forces!(f::AbstractVector, system, calculator::MyOtherType; kwargs...)
#definition here
endGenerate AtomsCalculators.potential_energy call from AtomsCalculators.calculate call.
AtomsCalculators.@generate_interface function AtomsCalculators.calculate(::AtomsCalculators.Energy(), system, calculator::MyType; kwargs...)
#definition here
endAtomsCalculators.Testing.test_energy_forces — Methodtest_energy_forces(sys, calculator; force_eltype=nothing, rtol=1e-8, kwargs...)Test your calculator for AtomsCalculators interface. Passing test means that your calculator implements energy and forces interfaces correctly.
To use this function create a AtomsBase system sys and a calculator for your own calculator. Test function will then call the interface and performs checks for the output and checks that random keywords are accepted in input.
force_eltype can be given to forces! interface testing. Default promote_force_type. rtol can be given to control error in comparisons. kwargs can be passed to the calculator for tuning during testing.
The calculator is expected to work without kwargs.
AtomsCalculators.Testing.test_energy_forces_virial — Methodtest_energy_forces_virial(sys, calculator; force_eltype=nothing, rtol=1e-8, kwargs...)Test your calculator for AtomsCalculators interface. Passing test means that your calculator implements energy, forces and virial interfaces correctly.
To use this function create a AtomsBase system sys and a calculator for your own calculator. Test function will then call the interface and performs checks for the output and checks that random keywords are accepted in input.
force_eltype can be given to forces! interface testing. Default promote_force_type. rtol can be given to control error in comparisons. kwargs can be passed to the calculator for tuning during testing.
The calculator is expected to work without kwargs.
AtomsCalculators.Testing.test_forces — Methodtest_forces(sys, calculator; force_eltype::AbstractVector=default_force_eltype, rtol=1e-8, kwargs...)Test your calculator for AtomsCalculators interface. Passing test means that your forces calculation implementation works correctly.
To use this function create a AtomsBase system sys and a calculator for your own calculator. Test function will then call the interface and performs checks for the output and checks that random keywords are accepted in input.
force_eltype can be given to forces! interface testing. Default promote_force_type. rtol can be given to control error in comparisons. kwargs can be passed to the calculator for tuning during testing.
The calculator is expected to work without kwargs.
AtomsCalculators.Testing.test_potential_energy — Methodtest_potential_energy(sys, calculator; rtol=1e-8, kwargs...)Test your calculator for AtomsCalculators interface. Passing test means that your potential energy calculation implementation works correctly.
To use this function create an AtomsBase system sys and a calculator for your own calculator. Test function will then call the interface and performs checks for the output and checks that random keywords are accepted in input.
rtol can be given to control error in comparisons. kwargs can be passed to the calculator for tuning during testing.
The calculator is expected to work without kwargs.
AtomsCalculators.Testing.test_virial — Methodtest_virial(sys, calculator; kwargs...)Test your calculator for AtomsCalculators interface. Passing test means that your virial calculation implementation works correctly.
To use this function create an AtomsBase system sys and a calculator for your own calculator. Test function will then call the interface and performs checks for the output and checks that random keywords are accepted in input.
kwargs can be passed to the calculator for tuning during testing.
The calculator is expected to work without kwargs.