Construct a parent lattice

Build a ParentLattice from a primitive basis matrix (Bravais) or a basis + dset (multilattice).

Setup

julia> using Enumlib

Bravais lattice (single-site)

Pass the basis matrix alone. Enumlib uses column-major basis matrices: column j of A is the j-th lattice vector in Cartesian coordinates.

julia> A_fcc = [0.0 0.5 0.5;
                0.5 0.0 0.5;
                0.5 0.5 0.0];

julia> p = ParentLattice(A_fcc); # If not specified, one atomic site in the dset, at (0,0,0) 

julia> ndset(p)                  # one dset position, at the origin
1

julia> length(space_group(p))    # 48 ops (Pm-3m point group of FCC)
48

Multilattice (HCP, zincblende, perovskite, …)

Pass the basis plus a dset of basis-site fractional positions:

julia> A_hcp = [1.0 -0.5 0.0;
                0.0 sqrt(3)/2 0.0;
                0.0 0.0 sqrt(8/3)];

julia> dset_hcp = [[0.0, 0.0, 0.0], [1/3, 2/3, 1/2]];

julia> p_hcp = ParentLattice(A_hcp, dset_hcp);

julia> ndset(p_hcp) # The dset has two atomic sites
2

julia> n_nonzero_translations(p_hcp)   # P6_3/mmc has 12 screw ops of 24
12

Counterexample: fcc entered as a four-site cube

The basis A must be a primitive cell. Every translation that carries the multilattice onto itself has to be a lattice vector of A. The conventional fcc cube fails this test. It holds four sites, and a shift by half a face diagonal, such as (0, ½, ½) in fractional coordinates of the cube, carries the multilattice onto itself but is not a lattice vector of the cube.

The constructor accepts the cube, because whether a cell is primitive depends on the labels each site allows, and the constructor doesn't know them yet. Once the Sites are given, enumerate_structures, count_inequivalent and estimate_cost all reject this cell.

julia> A_cube = [1.0 0.0 0.0;
                 0.0 1.0 0.0;
                 0.0 0.0 1.0];

julia> dset_cube = [[0.0, 0.0, 0.0], [0.0, 0.5, 0.5], [0.5, 0.0, 0.5], [0.5, 0.5, 0.0]];

julia> p_cube = ParentLattice(A_cube, dset_cube);

julia> sites_cube = Sites([Site(d, [0, 1]) for d in dset_cube]);

julia> enumerate_structures(p_cube, sites_cube; supercells = VolumeRange(1:1))
ERROR: ArgumentError: the parent cell is not primitive: the multilattice is unchanged by the translation [0.0, 0.5, 0.5] (fractional coordinates), which is not a lattice vector of the basis. Enumerating on this cell would count structures of the smaller cell again. Enter the primitive cell instead (for fcc, A = [0 0.5 0.5; 0.5 0 0.5; 0.5 0.5 0] with one site).

Why this matters. Enumlib takes the cell you enter as the smallest repeating unit of the crystal, and at each size it lists only the structures that don't fit in a smaller cell. With the cube as the parent, that rule fails in two ways.

  • Structures with smaller cells come back as new ones. If Enumlib accepted the cube, it would list five binary structures at four sites: all 0, all 1, L1₀, and L1₂ with either label in the majority. Only the two L1₂ structures actually need all four sites. The other structures only need one or two sites. The primitive cell lists the pure elements at one site and L1₀ at two.
  • Every structure built on the cube has a multiple of four sites in its cell. A structure whose smallest cell has three sites would first appear at twelve sites.

To enumerate fcc, enter the one-site primitive cell from the top of this page.

What gets canonicalized silently

  1. Each dset position is adjusted to be in between 0 and 1: wrapped into [0,1)^D via mod(·, 1).
  2. For lattices with only one atomic site ("Bravais" lattices), the lone dset entry is automatically shifted to the origin so the space group doesn't carry "artificial" translations from the user's choice of origin.
  3. Bases with Hadamard ratio |det(A)| / prod(‖aⱼ‖) ≤ 1e-12 are rejected as flat, not defining a lattice in 3D. The Hadamard ratio is a scale-free singularity check that works whether you express positions in Ångströms, nm, Bohr, or anything else.

See also