diff --git a/dev/apireference/index.html b/dev/apireference/index.html index 45c9973..01e0455 100644 --- a/dev/apireference/index.html +++ b/dev/apireference/index.html @@ -1,20 +1,20 @@ -API reference · AtomsBase.jl

API reference

Index

System properties

AtomsBase.boundary_conditionsFunction
boundary_conditions(sys::AbstractSystem{D})

Return a vector of length D of BoundaryCondition objects, one for each direction described by bounding_box(sys).

source
AtomsBase.bounding_boxFunction
bounding_box(sys::AbstractSystem{D})

Return a vector of length D of vectors of length D that describe the "box" in which the system sys is defined.

source
AtomsBase.element_symbolFunction
element_symbol(system)
+API reference · AtomsBase.jl

API reference

Index

System properties

AtomsBase.boundary_conditionsFunction
boundary_conditions(sys::AbstractSystem{D})

Return a vector of length D of BoundaryCondition objects, one for each direction described by bounding_box(sys).

source
AtomsBase.bounding_boxFunction
bounding_box(sys::AbstractSystem{D})

Return a vector of length D of vectors of length D that describe the "box" in which the system sys is defined.

source
AtomsBase.element_symbolFunction
element_symbol(system)
 element_symbol(system, index)
-element_symbol(species)

Return the symbols corresponding to the elements of the atoms. Note that this may be different than atomic_symbol for cases where atomic_symbol is chosen to be more specific (i.e. designate a special atom).

source
AtomsBase.atomkeysFunction
atomkeys(sys::AbstractSystem)

Return the atomic properties, which are available in all atoms of the system.

source
AtomsBase.hasatomkeyFunction
hasatomkey(system::AbstractSystem, x::Symbol)

Returns true whether the passed property available in all atoms of the passed system.

source
AtomsBase.visualize_asciiFunction

Build an ASCII representation of the passed atomistic structure. The string may be empty if the passed structure could not be represented (structure not supported or invalid).

source

Species / atom properties

AtomsBase.atomic_massFunction
atomic_mass(sys::AbstractSystem)
+element_symbol(species)

Return the symbols corresponding to the elements of the atoms. Note that this may be different than atomic_symbol for cases where atomic_symbol is chosen to be more specific (i.e. designate a special atom).

source
AtomsBase.atomkeysFunction
atomkeys(sys::AbstractSystem)

Return the atomic properties, which are available in all atoms of the system.

source
AtomsBase.hasatomkeyFunction
hasatomkey(system::AbstractSystem, x::Symbol)

Returns true whether the passed property available in all atoms of the passed system.

source
AtomsBase.visualize_asciiFunction

Build an ASCII representation of the passed atomistic structure. The string may be empty if the passed structure could not be represented (structure not supported or invalid).

source

Species / atom properties

AtomsBase.atomic_massFunction
atomic_mass(sys::AbstractSystem)
 atomic_mass(sys::AbstractSystem, i)
-atomic_mass(species)

Vector of atomic masses in the system sys or the atomic mass of a particular species / the ith species in sys. The elements are <: Unitful.Mass.

source
AtomsBase.atomic_numberFunction
atomic_number(sys::AbstractSystem)
+atomic_mass(species)

Vector of atomic masses in the system sys or the atomic mass of a particular species / the ith species in sys. The elements are <: Unitful.Mass.

source
AtomsBase.atomic_numberFunction
atomic_number(sys::AbstractSystem)
 atomic_number(sys::AbstractSystem, i)
-atomic_number(species)

Vector of atomic numbers in the system sys or the atomic number of a particular species / the ith species in sys.

The intention is that atomic_number carries the meaning of identifying the type of a species (e.g. the element for the case of an atom), whereas atomic_symbol may return a more unique identifier. For example for a deuterium atom this may be :D while atomic_number is still 1.

source
AtomsBase.atomic_symbolFunction
atomic_symbol(sys::AbstractSystem)
+atomic_number(species)

Vector of atomic numbers in the system sys or the atomic number of a particular species / the ith species in sys.

The intention is that atomic_number carries the meaning of identifying the type of a species (e.g. the element for the case of an atom), whereas atomic_symbol may return a more unique identifier. For example for a deuterium atom this may be :D while atomic_number is still 1.

source
AtomsBase.atomic_symbolFunction
atomic_symbol(sys::AbstractSystem)
 atomic_symbol(sys::AbstractSystem, i)
-atomic_symbol(species)

Vector of atomic symbols in the system sys or the atomic symbol of a particular species / the ith species in sys.

The intention is that atomic_number carries the meaning of identifying the type of a species (e.g. the element for the case of an atom), whereas atomic_symbol may return a more unique identifier. For example for a deuterium atom this may be :D while atomic_number is still 1.

source
AtomsBase.velocityFunction
velocity(sys::AbstractSystem{D})
+atomic_symbol(species)

Vector of atomic symbols in the system sys or the atomic symbol of a particular species / the ith species in sys.

The intention is that atomic_number carries the meaning of identifying the type of a species (e.g. the element for the case of an atom), whereas atomic_symbol may return a more unique identifier. For example for a deuterium atom this may be :D while atomic_number is still 1.

source
AtomsBase.velocityFunction
velocity(sys::AbstractSystem{D})
 velocity(sys::AbstractSystem, index)
-velocity(species)

Return a vector of velocities of every particle in the system sys. Return type should be a vector of vectors each containing D elements that are <:Unitful.Velocity. If an index is passed or the action is on a species, return only the velocity of the referenced species. Returned value of the function may be missing.

source
Base.positionFunction
position(sys::AbstractSystem{D})
+velocity(species)

Return a vector of velocities of every particle in the system sys. Return type should be a vector of vectors each containing D elements that are <:Unitful.Velocity. If an index is passed or the action is on a species, return only the velocity of the referenced species. Returned value of the function may be missing.

source
Base.positionFunction
position(sys::AbstractSystem{D})
 position(sys::AbstractSystem, index)
-position(species)

Return a vector of positions of every particle in the system sys. Return type should be a vector of vectors each containing D elements that are <:Unitful.Length. If an index is passed or the action is on a species, return only the position of the referenced species / species on that index.

source

Atom and system constructors

AtomsBase.AtomType
Atom(identifier::AtomId, position::AbstractVector; kwargs...)
+position(species)

Return a vector of positions of every particle in the system sys. Return type should be a vector of vectors each containing D elements that are <:Unitful.Length. If an index is passed or the action is on a species, return only the position of the referenced species / species on that index.

source

Atom and system constructors

AtomsBase.AtomType
Atom(identifier::AtomId, position::AbstractVector; kwargs...)
 Atom(identifier::AtomId, position::AbstractVector, velocity::AbstractVector; kwargs...)
-Atom(; atomic_number, position, velocity=zeros(D)u"bohr/s", kwargs...)

Construct an atomic located at the cartesian coordinates position with (optionally) the given cartesian velocity. Note that AtomId = Union{Symbol,AbstractString,Integer}.

Supported kwargs include atomic_symbol, atomic_number, atomic_mass, charge, multiplicity as well as user-specific custom properties.

source
Atom(atom::Atom; kwargs...)

Update constructor. Construct a new Atom, by amending the data contained in the passed atom object. Supported kwargs include atomic_symbol, atomic_number, atomic_mass, charge, multiplicity as well as user-specific custom properties.

Examples

Construct a standard hydrogen atom located at the origin

julia> hydrogen = Atom(:H, zeros(3)u"Å")

and now amend its charge and atomic mass

julia> Atom(atom; atomic_mass=1.0u"u", charge=-1.0u"e_au")
source
AtomsBase.AtomViewType
AtomView{S<:AbstractSystem}

Species type for atoms of systems implemented as struct-of-arrays. Can be queried with the same API than for other species, like Atom.

See FastSystem for an example of system using AtomView as its species type.

Example

julia> system = FastSystem(atoms, box, boundary_conditions);
+Atom(; atomic_number, position, velocity=zeros(D)u"bohr/s", kwargs...)

Construct an atomic located at the cartesian coordinates position with (optionally) the given cartesian velocity. Note that AtomId = Union{Symbol,AbstractString,Integer}.

Supported kwargs include atomic_symbol, atomic_number, atomic_mass, charge, multiplicity as well as user-specific custom properties.

source
Atom(atom::Atom; kwargs...)

Update constructor. Construct a new Atom, by amending the data contained in the passed atom object. Supported kwargs include atomic_symbol, atomic_number, atomic_mass, charge, multiplicity as well as user-specific custom properties.

Examples

Construct a standard hydrogen atom located at the origin

julia> hydrogen = Atom(:H, zeros(3)u"Å")

and now amend its charge and atomic mass

julia> Atom(atom; atomic_mass=1.0u"u", charge=-1.0u"e_au")
source
AtomsBase.AtomViewType
AtomView{S<:AbstractSystem}

Species type for atoms of systems implemented as struct-of-arrays. Can be queried with the same API than for other species, like Atom.

See FastSystem for an example of system using AtomView as its species type.

Example

julia> system = FastSystem(atoms, box, boundary_conditions);
 
 julia> atom = system[2]
 AtomView(C, atomic_number = 6, atomic_mass = 12.011 u):
@@ -24,15 +24,15 @@
 true
 
 julia> atomic_symbol(atom)
-:C
source
AtomsBase.FlexibleSystemType
FlexibleSystem(particles, bounding_box, boundary_conditions; kwargs...)
-FlexibleSystem(particles; bounding_box, boundary_conditions, kwargs...)

Construct a flexible system, a versatile data structure for atomistic systems, which puts an emphasis on flexibility rather than speed.

source
FlexibleSystem(system; kwargs...)

Update constructor. See AbstractSystem for details.

source
AtomsBase.atomic_systemFunction
atomic_system(atoms::AbstractVector, bounding_box, boundary_conditions; kwargs...)

Construct a FlexibleSystem using the passed atoms and boundary box and conditions. Extra kwargs are stored as custom system properties.

Examples

Construct a hydrogen molecule in a box, which is periodic only in the first two dimensions

julia> bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å"
+:C
source
AtomsBase.FlexibleSystemType
FlexibleSystem(particles, bounding_box, boundary_conditions; kwargs...)
+FlexibleSystem(particles; bounding_box, boundary_conditions, kwargs...)

Construct a flexible system, a versatile data structure for atomistic systems, which puts an emphasis on flexibility rather than speed.

source
FlexibleSystem(system; kwargs...)

Update constructor. See AbstractSystem for details.

source
AtomsBase.atomic_systemFunction
atomic_system(atoms::AbstractVector, bounding_box, boundary_conditions; kwargs...)

Construct a FlexibleSystem using the passed atoms and boundary box and conditions. Extra kwargs are stored as custom system properties.

Examples

Construct a hydrogen molecule in a box, which is periodic only in the first two dimensions

julia> bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å"
 julia> boundary_conditions = [Periodic(), Periodic(), DirichletZero()]
 julia> hydrogen = atomic_system([:H => [0, 0, 1.]u"bohr",
                                  :H => [0, 0, 3.]u"bohr"],
-                                  bounding_box, boundary_conditions)
source
AtomsBase.isolated_systemFunction
isolated_system(atoms::AbstractVector; kwargs...)

Construct a FlexibleSystem by placing the passed atoms into an infinite vacuum (standard setup for modelling molecular systems). Extra kwargs are stored as custom system properties.

Examples

Construct a hydrogen molecule

julia> hydrogen = isolated_system([:H => [0, 0, 1.]u"bohr", :H => [0, 0, 3.]u"bohr"])
source
AtomsBase.periodic_systemFunction
periodic_system(atoms::AbstractVector, bounding_box; fractional=false, kwargs...)

Construct a FlexibleSystem with all boundaries of the bounding_box periodic (standard setup for modelling solid-state systems). If fractional is true, atom coordinates are given in fractional (and not in Cartesian) coordinates. Extra kwargs are stored as custom system properties.

Examples

Setup a hydrogen molecule inside periodic BCs:

julia> bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å"
+                                  bounding_box, boundary_conditions)
source
AtomsBase.isolated_systemFunction
isolated_system(atoms::AbstractVector; kwargs...)

Construct a FlexibleSystem by placing the passed atoms into an infinite vacuum (standard setup for modelling molecular systems). Extra kwargs are stored as custom system properties.

Examples

Construct a hydrogen molecule

julia> hydrogen = isolated_system([:H => [0, 0, 1.]u"bohr", :H => [0, 0, 3.]u"bohr"])
source
AtomsBase.periodic_systemFunction
periodic_system(atoms::AbstractVector, bounding_box; fractional=false, kwargs...)

Construct a FlexibleSystem with all boundaries of the bounding_box periodic (standard setup for modelling solid-state systems). If fractional is true, atom coordinates are given in fractional (and not in Cartesian) coordinates. Extra kwargs are stored as custom system properties.

Examples

Setup a hydrogen molecule inside periodic BCs:

julia> bounding_box = [[10.0, 0.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 10.0]]u"Å"
 julia> hydrogen = periodic_system([:H => [0, 0, 1.]u"bohr",
                                    :H => [0, 0, 3.]u"bohr"],
                                   bounding_box)

Setup a silicon unit cell using fractional positions

julia> bounding_box = 10.26 / 2 * [[0, 0, 1], [1, 0, 1], [1, 1, 0]]u"bohr"
 julia> silicon = periodic_system([:Si =>  ones(3)/8,
                                   :Si => -ones(3)/8],
-                                 bounding_box, fractional=true)
source
+ bounding_box, fractional=true)
source
diff --git a/dev/index.html b/dev/index.html index a1a188b..2d4ff06 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · AtomsBase.jl

AtomsBase

A Julian abstract interface for atomic structures.

Stable Dev Build Status Coverage

AtomsBase is an abstract interface for representation of atomic geometries in Julia. It aims to be a lightweight means of facilitating interoperability between various tools including ...

  • Chemical simulation engines:
  • Integration with third party-libraries:
    • ASEconvert.jl (integration with the Atomistic Simulation Environment)
  • I/O with standard file formats (.cif, .xyz, ...)
  • automatic differentiation and machine learning systems
  • numerical tools: sampling, integration schemes, etc.
  • visualization (e.g. plot recipes)

Currently, the design philosophy is to be as lightweight as possible with a small set of required function dispatches to make adopting the interface easy. We also provide a couple of standard flexible implementations of the interface that we envision to be broadly applicable. If features beyond these are required we encourage developers to open PRs or provide their own implementations. For more on how to use the package, see the documentation.

Packages using AtomsBase

The following (not all yet-registered) packages currently make use of AtomsBase:

+Home · AtomsBase.jl

AtomsBase

A Julian abstract interface for atomic structures.

Stable Dev Build Status Coverage

AtomsBase is an abstract interface for representation of atomic geometries in Julia. It aims to be a lightweight means of facilitating interoperability between various tools including ...

  • Chemical simulation engines:
  • Integration with third party-libraries:
    • ASEconvert.jl (integration with the Atomistic Simulation Environment)
  • I/O with standard file formats (.cif, .xyz, ...)
  • automatic differentiation and machine learning systems
  • numerical tools: sampling, integration schemes, etc.
  • visualization (e.g. plot recipes)

Currently, the design philosophy is to be as lightweight as possible with a small set of required function dispatches to make adopting the interface easy. We also provide a couple of standard flexible implementations of the interface that we envision to be broadly applicable. If features beyond these are required we encourage developers to open PRs or provide their own implementations. For more on how to use the package, see the documentation.

Packages using AtomsBase

The following (not all yet-registered) packages currently make use of AtomsBase:

diff --git a/dev/overview/index.html b/dev/overview/index.html index b86236b..cd2a29c 100644 --- a/dev/overview/index.html +++ b/dev/overview/index.html @@ -1,2 +1,2 @@ -Overview · AtomsBase.jl

Overview

The main abstract type introduced in AtomsBase is AbstractSystem{D}. The D parameter indicates the number of spatial dimensions in the system. Contained inside the system are species, which may have an arbitrary type, accessible via the species_type(system) function. While AtomsBase provides some default species types (e.g. Atom and AtomView for standard atoms) in principle no constraints are made on this species type.

The main power of the interface comes from predictable behavior of several core functions to access information about a system and the species. Various categories of such functions are described below.

System geometry

Functions that need to be dispatched:

  • bounding_box(::AbstractSystem{D})::SVector{D,SVector{D,<:Unitful.Length}}: returns D vectors of length D that describe the "box" in which the system lives
  • boundary_conditions(::AbstractSystem{D})::SVector{D,BoundaryCondition}): returns a vector of length D of BoundaryCondition objects to describe what happens at the edges of the box

Functions that will work automatically:

  • periodicity: returns a vector of length D of Bools for whether each dimension of the system has periodic boundary conditions
  • n_dimensions: returns D, the number of spatial dimensions of the system

Iteration and Indexing over systems

There is a presumption of the ability to somehow extract an individual component (e.g. a single atom or molecule) of this system, though there are no constraints on the type of this component. To achieve this, an AbstractSystem object is expected to implement the Julia interfaces for iteration and indexing in order to access representations of individual components of the system. Some default dispatches of parts of these interfaces are already included, so the minimal set of functions to dispatch in a concrete implementation is Base.getindex and Base.length, though it may be desirable to customize additional behavior depending on context.

System state and properties

The only required properties to be specified of the system is the species and implementations of standard functions accessing the properties of the species, currently

Based on these methods respective equivalent methods acting on an AbstractSystem will be automatically available, e.g. using the iteration interface of the AbstractSystem (see above). Most of the property accessors on the AbstractSystem also have indexed signatures to extract data from a particular species directly, for example:

position(sys, i) # position of `i`th particle in `sys`

Currently, this syntax only supports linear indexing.

To simplify working with AtomsBase, default implementations for systems composed of atoms are provided (see Tutorial).

Struct-of-Arrays vs. Array-of-Structs

The "struct-of-arrays" (SoA) vs. "array-of-structs" (AoS) is a common design dilemma in representations of systems such as these. We have deliberately designed this interface to be agnostic to how a concrete implementation chooses to structure its data. Some specific notes regarding how implementations might differ for these two paradigms are included below.

A way to think about this broadly is that the difference amounts to the ordering of function calls. For example, to get the position of a single particle in an AoS implementation, the explicit function chaining would be position(getindex(sys)) (i.e. extract the single struct representing the particle of interest and query its position), while for SoA, one should prefer an implementation like getindex(position(sys)) (extract the array of positions, then index into it for a single particle). The beauty of an abstract interface in Julia is that these details can be, in large part, abstracted away through method dispatch such that the end user sees the same expected behavior irrespective of how things are implemented "under the hood".

Boundary Conditions

Finally, we include support for defining boundary conditions. Currently included are Periodic and DirichletZero. There should be one boundary condition specified for each spatial dimension represented.

Atomic system

Since we anticipate atomic systems to be a commonly needed representation, AtomsBase provides two flexible implementations for this setting. One implementation follows the struct-of-arrays approach introducing the AtomView type to conveniently expose atomic data. The more flexible implementation is based on an array-of-structs approach and can be easily customised, e.g. by adding custom properties or by swapping the underlying Atom struct by a custom one. In both cases the respective datastructures can be used either fully or in parts in downstream packages and we hope these to develop into universally useful types within the Julia ecosystem over time.

Struct of Arrays / FastSystem

The file src/fast_system.jl contains an implementation of AtomsBase based on the struct-of-arrays approach. All species data is stored as plain arrays, but for convenience indexing of individual atoms is supported by a light-weight AtomView. See the implementation files as well as the tests for how these can be used.

Atoms and FlexibleSystem

A flexible implementation of the interface is provided by the FlexibleSystem and the Atom structs for representing atomic systems. These are discussed in detail in Tutorial.

+Overview · AtomsBase.jl

Overview

The main abstract type introduced in AtomsBase is AbstractSystem{D}. The D parameter indicates the number of spatial dimensions in the system. Contained inside the system are species, which may have an arbitrary type, accessible via the species_type(system) function. While AtomsBase provides some default species types (e.g. Atom and AtomView for standard atoms) in principle no constraints are made on this species type.

The main power of the interface comes from predictable behavior of several core functions to access information about a system and the species. Various categories of such functions are described below.

System geometry

Functions that need to be dispatched:

  • bounding_box(::AbstractSystem{D})::SVector{D,SVector{D,<:Unitful.Length}}: returns D vectors of length D that describe the "box" in which the system lives
  • boundary_conditions(::AbstractSystem{D})::SVector{D,BoundaryCondition}): returns a vector of length D of BoundaryCondition objects to describe what happens at the edges of the box

Functions that will work automatically:

  • periodicity: returns a vector of length D of Bools for whether each dimension of the system has periodic boundary conditions
  • n_dimensions: returns D, the number of spatial dimensions of the system

Iteration and Indexing over systems

There is a presumption of the ability to somehow extract an individual component (e.g. a single atom or molecule) of this system, though there are no constraints on the type of this component. To achieve this, an AbstractSystem object is expected to implement the Julia interfaces for iteration and indexing in order to access representations of individual components of the system. Some default dispatches of parts of these interfaces are already included, so the minimal set of functions to dispatch in a concrete implementation is Base.getindex and Base.length, though it may be desirable to customize additional behavior depending on context.

System state and properties

The only required properties to be specified of the system is the species and implementations of standard functions accessing the properties of the species, currently

Based on these methods respective equivalent methods acting on an AbstractSystem will be automatically available, e.g. using the iteration interface of the AbstractSystem (see above). Most of the property accessors on the AbstractSystem also have indexed signatures to extract data from a particular species directly, for example:

position(sys, i) # position of `i`th particle in `sys`

Currently, this syntax only supports linear indexing.

To simplify working with AtomsBase, default implementations for systems composed of atoms are provided (see Tutorial).

Struct-of-Arrays vs. Array-of-Structs

The "struct-of-arrays" (SoA) vs. "array-of-structs" (AoS) is a common design dilemma in representations of systems such as these. We have deliberately designed this interface to be agnostic to how a concrete implementation chooses to structure its data. Some specific notes regarding how implementations might differ for these two paradigms are included below.

A way to think about this broadly is that the difference amounts to the ordering of function calls. For example, to get the position of a single particle in an AoS implementation, the explicit function chaining would be position(getindex(sys)) (i.e. extract the single struct representing the particle of interest and query its position), while for SoA, one should prefer an implementation like getindex(position(sys)) (extract the array of positions, then index into it for a single particle). The beauty of an abstract interface in Julia is that these details can be, in large part, abstracted away through method dispatch such that the end user sees the same expected behavior irrespective of how things are implemented "under the hood".

Boundary Conditions

Finally, we include support for defining boundary conditions. Currently included are Periodic and DirichletZero. There should be one boundary condition specified for each spatial dimension represented.

Atomic system

Since we anticipate atomic systems to be a commonly needed representation, AtomsBase provides two flexible implementations for this setting. One implementation follows the struct-of-arrays approach introducing the AtomView type to conveniently expose atomic data. The more flexible implementation is based on an array-of-structs approach and can be easily customised, e.g. by adding custom properties or by swapping the underlying Atom struct by a custom one. In both cases the respective datastructures can be used either fully or in parts in downstream packages and we hope these to develop into universally useful types within the Julia ecosystem over time.

Struct of Arrays / FastSystem

The file src/fast_system.jl contains an implementation of AtomsBase based on the struct-of-arrays approach. All species data is stored as plain arrays, but for convenience indexing of individual atoms is supported by a light-weight AtomView. See the implementation files as well as the tests for how these can be used.

Atoms and FlexibleSystem

A flexible implementation of the interface is provided by the FlexibleSystem and the Atom structs for representing atomic systems. These are discussed in detail in Tutorial.

diff --git a/dev/search/index.html b/dev/search/index.html index 3940481..c751a28 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · AtomsBase.jl

Loading search...

    +Search · AtomsBase.jl

    Loading search...

      diff --git a/dev/testing/index.html b/dev/testing/index.html index 256a118..214bd98 100644 --- a/dev/testing/index.html +++ b/dev/testing/index.html @@ -1,2 +1,2 @@ -Testing against the AtomsBase interface · AtomsBase.jl

      Testing against the AtomsBase interface

      The AtomsBaseTesting package provides a few utility functions to test downstream packages for having properly implemented the AtomsBase interface. The tests are probably not complete, but they should be a good start ... and as always PRs are welcome.

      Two functions are provided, namely make_test_system to generate standard FlexibleSystem test systems and test_approx_eq for testing approximate equality between AtomsBase systems (of not necessarily the same type). The basic idea of the functions is to use make_test_system to obtain a test system, construct an identical system in a downstream library and then use test_approx_eq to check they are actually equal.

      For usage examples see the tests of ExtXYZ, AtomsIO and ASEconnect.

      +Testing against the AtomsBase interface · AtomsBase.jl

      Testing against the AtomsBase interface

      The AtomsBaseTesting package provides a few utility functions to test downstream packages for having properly implemented the AtomsBase interface. The tests are probably not complete, but they should be a good start ... and as always PRs are welcome.

      Two functions are provided, namely make_test_system to generate standard FlexibleSystem test systems and test_approx_eq for testing approximate equality between AtomsBase systems (of not necessarily the same type). The basic idea of the functions is to use make_test_system to obtain a test system, construct an identical system in a downstream library and then use test_approx_eq to check they are actually equal.

      For usage examples see the tests of ExtXYZ, AtomsIO and ASEconnect.

      diff --git a/dev/tutorial/index.html b/dev/tutorial/index.html index bacac68..7fb5a12 100644 --- a/dev/tutorial/index.html +++ b/dev/tutorial/index.html @@ -149,4 +149,4 @@ Atom(H, [ 0, 0, 1]u"a₀") Atom(H, [ 0, 0, 3]u"a₀") -

      Again these custom properties are fully integrated with keys, haskey, pairs and get.

      @show keys(system)
      (:bounding_box, :boundary_conditions, :extra_data)

      Some property names are reserved and should be considered by all libraries supporting AtomsBase if possible:

      Property nameUnit / TypeDescription
      :chargeChargeTotal net system charge
      :multiplicityInt (unitless)Multiplicity of the ground state targeted in the calculation
      +

      Again these custom properties are fully integrated with keys, haskey, pairs and get.

      @show keys(system)
      (:bounding_box, :boundary_conditions, :extra_data)

      Some property names are reserved and should be considered by all libraries supporting AtomsBase if possible:

      Property nameUnit / TypeDescription
      :chargeChargeTotal net system charge
      :multiplicityInt (unitless)Multiplicity of the ground state targeted in the calculation