Public API
Contents
Index
CrystallographyCore.CellCrystallographyCore.LatticeCrystallographyCore.PrimitiveFromStandardizedCrystallographyCore.ReciprocalLatticeCrystallographyCore.StandardizedFromPrimitiveBase.:*Base.:*CrystallographyCore.atomcountsCrystallographyCore.atomtypesCrystallographyCore.basisvectorsCrystallographyCore.basisvectorsCrystallographyCore.eachatomCrystallographyCore.natomsCrystallographyCore.reciprocal
Public interface
Lattices
CrystallographyCore.Lattice — Type
Lattice(data::AbstractMatrix)Construct a Lattice from a matrix.
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.1CrystallographyCore.basisvectors — Method
basisvectors(lattice::Lattice)Get the three basis vectors from a lattice.
Base.:* — Method
*(R::AbstractMatrix, lattice::Lattice)Left-multiply a lattice by a matrix and return a Lattice.
If the lattice matrix is $\mathrm{A} = [\mathbf{a}\ \mathbf{b}\ \mathbf{c}]$ (basis vectors as columns), this computes $\mathrm{R}\mathrm{A}$. This corresponds to an active (reverse/alibi) transformation, such as a rigid Cartesian rotation applied to the crystal basis vectors.
Only $3×3$ matrices are supported.
See also "Left and right matrix actions on a lattice".
Base.:* — Method
*(lattice::Lattice, P::AbstractMatrix)Right-multiply a lattice by a matrix and return a Lattice.
If the lattice matrix is $\mathrm{A} = [\mathbf{a}\ \mathbf{b}\ \mathbf{c}]$ (basis vectors as columns), this computes $\mathrm{A}\mathrm{P}$. This corresponds to a passive (forward/alias) change of basis.
Only $3×3$ matrices are supported.
See also "Left and right matrix actions on a lattice".
Reciprocal lattices
CrystallographyCore.ReciprocalLattice — Type
ReciprocalLattice(data::AbstractMatrix)Construct a ReciprocalLattice from a matrix.
CrystallographyCore.basisvectors — Method
basisvectors(lattice::ReciprocalLattice)Get the three basis vectors from a reciprocal lattice.
CrystallographyCore.reciprocal — Function
reciprocal(lattice::Lattice)
reciprocal(lattice::ReciprocalLattice)Get the reciprocal of a Lattice or a ReciprocalLattice.
Cells
CrystallographyCore.Cell — Type
Cell(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.eachatom — Function
eachatom(cell::Cell)Create a generator that iterates over the atoms in a Cell.
CrystallographyCore.natoms — Function
natoms(cell::Cell)Return the number of atoms contained in cell.
CrystallographyCore.atomtypes — Function
atomtypes(cell::Cell)Return the distinct atom values present in cell.
CrystallographyCore.atomcounts — Function
atomcounts(cell::Cell)Return a dictionary mapping each distinct atom value in cell.atoms to the number of occurrences in the cell.
Examples
julia> cell = Cell(rand(3, 3), [rand(3) for _ in 1:4], [:C, :O, :C, :H])
julia> atomcounts(cell)
Dict{Symbol, Int64} with 3 entries:
:H => 1
:O => 1
:C => 2Transformations
CrystallographyCore.PrimitiveFromStandardized — Type
PrimitiveFromStandardized(tf::AbstractMatrix)Construct the transformation from a standardized cell to a primitive cell.
CrystallographyCore.StandardizedFromPrimitive — Type
StandardizedFromPrimitive(tf::AbstractMatrix)Construct the transformation from a primitive cell to a standardized cell.