API reference
Index
AtomsBase.AbstractSystem
AtomsBase.Atom
AtomsBase.AtomView
AtomsBase.FlexibleSystem
AtomsBase.atomic_mass
AtomsBase.atomic_number
AtomsBase.atomic_symbol
AtomsBase.atomic_system
AtomsBase.atomkeys
AtomsBase.boundary_conditions
AtomsBase.bounding_box
AtomsBase.chemical_formula
AtomsBase.element
AtomsBase.element_symbol
AtomsBase.hasatomkey
AtomsBase.isinfinite
AtomsBase.isolated_system
AtomsBase.n_dimensions
AtomsBase.periodic_system
AtomsBase.periodicity
AtomsBase.species_type
AtomsBase.velocity
AtomsBase.visualize_ascii
Base.position
System properties
AtomsBase.boundary_conditions
— Functionboundary_conditions(sys::AbstractSystem{D})
Return a vector of length D
of BoundaryCondition
objects, one for each direction described by bounding_box(sys)
.
AtomsBase.bounding_box
— Functionbounding_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.
AtomsBase.chemical_formula
— FunctionReturns the chemical formula of an AbstractSystem as a string.
AtomsBase.element_symbol
— Functionelement_symbol(system)
+API reference · AtomsBase.jl API reference
Index
AtomsBase.AbstractSystem
AtomsBase.Atom
AtomsBase.AtomView
AtomsBase.FlexibleSystem
AtomsBase.atomic_mass
AtomsBase.atomic_number
AtomsBase.atomic_symbol
AtomsBase.atomic_system
AtomsBase.atomkeys
AtomsBase.boundary_conditions
AtomsBase.bounding_box
AtomsBase.chemical_formula
AtomsBase.element
AtomsBase.element_symbol
AtomsBase.hasatomkey
AtomsBase.isinfinite
AtomsBase.isolated_system
AtomsBase.n_dimensions
AtomsBase.periodic_system
AtomsBase.periodicity
AtomsBase.species_type
AtomsBase.velocity
AtomsBase.visualize_ascii
Base.position
System properties
AtomsBase.boundary_conditions
— Functionboundary_conditions(sys::AbstractSystem{D})
Return a vector of length D
of BoundaryCondition
objects, one for each direction described by bounding_box(sys)
.
sourceAtomsBase.bounding_box
— Functionbounding_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.
sourceAtomsBase.chemical_formula
— FunctionReturns the chemical formula of an AbstractSystem as a string.
sourceAtomsBase.element_symbol
— Functionelement_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).
sourceAtomsBase.isinfinite
— FunctionReturns true if the given system is infinite
sourceAtomsBase.n_dimensions
— Functionn_dimensions(::AbstractSystem)
-n_dimensions(atom)
Return number of dimensions.
sourceAtomsBase.periodicity
— FunctionReturn vector indicating whether the system is periodic along a dimension.
sourceAtomsBase.species_type
— Functionspecies_type(::AbstractSystem)
Return the type used to represent a species or atom.
sourceAtomsBase.atomkeys
— Functionatomkeys(sys::AbstractSystem)
Return the atomic properties, which are available in all atoms of the system.
sourceAtomsBase.hasatomkey
— Functionhasatomkey(system::AbstractSystem, x::Symbol)
Returns true whether the passed property available in all atoms of the passed system.
sourceAtomsBase.visualize_ascii
— FunctionBuild 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).
sourceSpecies / atom properties
AtomsBase.atomic_mass
— Functionatomic_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).
sourceAtomsBase.isinfinite
— FunctionReturns true if the given system is infinite
sourceAtomsBase.n_dimensions
— Functionn_dimensions(::AbstractSystem)
+n_dimensions(atom)
Return number of dimensions.
sourceAtomsBase.periodicity
— FunctionReturn vector indicating whether the system is periodic along a dimension.
sourceAtomsBase.species_type
— Functionspecies_type(::AbstractSystem)
Return the type used to represent a species or atom.
sourceAtomsBase.atomkeys
— Functionatomkeys(sys::AbstractSystem)
Return the atomic properties, which are available in all atoms of the system.
sourceAtomsBase.hasatomkey
— Functionhasatomkey(system::AbstractSystem, x::Symbol)
Returns true whether the passed property available in all atoms of the passed system.
sourceAtomsBase.visualize_ascii
— FunctionBuild 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).
sourceSpecies / atom properties
AtomsBase.atomic_mass
— Functionatomic_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 i
th species in sys
. The elements are <: Unitful.Mass
.
sourceAtomsBase.atomic_number
— Functionatomic_number(sys::AbstractSystem)
+atomic_mass(species)
Vector of atomic masses in the system sys
or the atomic mass of a particular species
/ the i
th species in sys
. The elements are <: Unitful.Mass
.
sourceAtomsBase.atomic_number
— Functionatomic_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 i
th 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
.
sourceAtomsBase.atomic_symbol
— Functionatomic_symbol(sys::AbstractSystem)
+atomic_number(species)
Vector of atomic numbers in the system sys
or the atomic number of a particular species
/ the i
th 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
.
sourceAtomsBase.atomic_symbol
— Functionatomic_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 i
th 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
.
sourceAtomsBase.velocity
— Functionvelocity(sys::AbstractSystem{D})
+atomic_symbol(species)
Vector of atomic symbols in the system sys
or the atomic symbol of a particular species
/ the i
th 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
.
sourceAtomsBase.velocity
— Functionvelocity(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
.
sourceBase.position
— Functionposition(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
.
sourceBase.position
— Functionposition(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.
sourceAtomsBase.element
— FunctionThe element corresponding to a species/atom (or missing).
sourceAtom and system constructors
AtomsBase.Atom
— TypeAtom(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.
sourceAtomsBase.element
— FunctionThe element corresponding to a species/atom (or missing).
sourceAtom and system constructors
AtomsBase.Atom
— TypeAtom(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.
sourceAtom(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")
sourceAtomsBase.AtomView
— TypeAtomView{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.
sourceAtom(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")
sourceAtomsBase.AtomView
— TypeAtomView{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
sourceAtomsBase.FlexibleSystem
— TypeFlexibleSystem(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.
sourceFlexibleSystem(system; kwargs...)
Update constructor. See AbstractSystem
for details.
sourceAtomsBase.AbstractSystem
— TypeAbstractSystem{D}
A D
-dimensional system.
sourceAtomsBase.atomic_system
— Functionatomic_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
sourceAtomsBase.FlexibleSystem
— TypeFlexibleSystem(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.
sourceFlexibleSystem(system; kwargs...)
Update constructor. See AbstractSystem
for details.
sourceAtomsBase.AbstractSystem
— TypeAbstractSystem{D}
A D
-dimensional system.
sourceAtomsBase.atomic_system
— Functionatomic_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)
sourceAtomsBase.isolated_system
— Functionisolated_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"])
sourceAtomsBase.periodic_system
— Functionperiodic_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)
sourceAtomsBase.isolated_system
— Functionisolated_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"])
sourceAtomsBase.periodic_system
— Functionperiodic_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)
sourceSettings
This document was generated with Documenter.jl version 0.27.25 on Monday 21 August 2023. Using Julia version 1.9.2.
+ bounding_box, fractional=true)