CrystallographyCore.AbstractLattice
— TypeAbstractLattice{T}
Represent the real lattices and the reciprocal lattices.
CrystallographyCore.Cell
— MethodCell(lattice, positions, atoms)
Create a new cell.
Argument lattice
is a Lattice
type. Fractional atomic positions positions
are given by a vector of $N$ vectors with floating point values, where $N$ is the number of atoms. Argument atoms
is a list of $N$ values, where the same kind of atoms need to be the same type.
CrystallographyCore.Lattice
— TypeLattice(data::AbstractMatrix)
Construct a Lattice
from a matrix.
The basis vectors of the matrix are stored as columns.
Examples
julia> Lattice([
1.2 4.5 7.8
2.3 5.6 8.9
3.4 6.7 9.1
])
Lattice{Float64}
1.2 4.5 7.8
2.3 5.6 8.9
3.4 6.7 9.1
CrystallographyCore.Lattice
— MethodLattice(𝐚::AbstractVector, 𝐛::AbstractVector, 𝐜::AbstractVector)
Construct a Lattice
from three basis vectors.
Examples
julia> 𝐚, 𝐛, 𝐜 = [1.2, 2.3, 3.4], [4.5, 5.6, 6.7], [7.8, 8.9, 9.10];
julia> Lattice(𝐚, 𝐛, 𝐜)
Lattice{Float64}
1.2 4.5 7.8
2.3 5.6 8.9
3.4 6.7 9.1
CrystallographyCore.Lattice
— MethodLattice(cell::Cell)
Get the lattice of a Cell
.
CrystallographyCore.Lattice
— MethodLattice(data)
Construct a Lattice
from, e.g., a vector of three basis vectors.
Examples
julia> Lattice([[1.2, 2.3, 3.4], [4.5, 5.6, 6.7], [7.8, 8.9, 9.10]])
Lattice{Float64}
1.2 4.5 7.8
2.3 5.6 8.9
3.4 6.7 9.1
julia> Lattice(((1.1, 2.2, 3.1), (4.4, 5.5, 6.5), (7.3, 8.8, 9.9)))
Lattice{Float64}
1.1 4.4 7.3
2.2 5.5 8.8
3.1 6.5 9.9
julia> Lattice((1.1, 2.2, 3.1, 4.4, 5.5, 6.5, 7.3, 8.8, 9.9))
Lattice{Float64}
1.1 4.4 7.3
2.2 5.5 8.8
3.1 6.5 9.9
julia> Lattice(i * 1.1 for i in 1:9)
Lattice{Float64}
1.1 4.4 7.700000000000001
2.2 5.5 8.8
3.3000000000000003 6.6000000000000005 9.9
julia> using Unitful, UnitfulAtomic
julia> Lattice(
[4u"nm", 0u"m", 0.0u"cm"],
[0u"cm", 180.0u"bohr", 0u"m"],
[0u"bohr", 0u"nm", (3//1) * u"angstrom"],
)
Lattice{Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}
4.0e-9 m 0.0 m 0.0 m
0.0 m 9.525189796254e-9 m 0.0 m
0.0 m 0.0 m 3.0e-10 m
CrystallographyCore.ReciprocalLattice
— TypeReciprocalLattice(data::AbstractMatrix)
Construct a ReciprocalLattice
from a matrix.
The basis vectors of the matrix are stored as columns.
Avoid using this constructor directly. Use reciprocal
instead.
CrystallographyCore.basisvectors
— Methodbasisvectors(lattice::Lattice)
Get the three basis vectors from a lattice.
CrystallographyCore.basisvectors
— Methodbasisvectors(lattice::ReciprocalLattice)
Get the three basis vectors from a reciprocal lattice.
CrystallographyCore.eachatom
— Methodeachatom(cell::Cell)
Create a generator that iterates over the atoms in a Cell
.
CrystallographyCore.reciprocal
— Methodreciprocal(lattice::Lattice)
reciprocal(lattice::ReciprocalLattice)
Get the reciprocal of a Lattice
or a ReciprocalLattice
.