CrystallographyCore.CellMethod
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.LatticeType
Lattice(data::AbstractMatrix)

Construct a Lattice from a matrix.

Note

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.LatticeMethod
Lattice(𝐚::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.LatticeMethod
Lattice(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.ReciprocalLatticeType
ReciprocalLattice(data::AbstractMatrix)

Construct a ReciprocalLattice from a matrix.

Note

The basis vectors of the matrix are stored as columns.

Warning

Avoid using this constructor directly. Use reciprocal instead.

CrystallographyCore.reciprocalMethod
reciprocal(lattice::Lattice)
reciprocal(lattice::ReciprocalLattice)

Get the reciprocal of a Lattice or a ReciprocalLattice.