first_brillouin

Function first_brillouin 

Source
pub fn first_brillouin(
    k: [f64; 3],
    b: [[f64; 3]; 3],
    dim: usize,
    iterations: usize,
) -> Result<[f64; 3]>
Expand description

Iterative nearest-cell reduction of a 2D or 3D wavevector.

Each of up to iterations + 1 passes rounds k against every row and then takes the shortest of k and its translates to the 3^dim - 1 neighbouring cells, as upstream does. A pass that leaves k unchanged ends the reduction.

Upstream: treams.misc.firstbrillouin2d and treams.misc.firstbrillouin3d.

§Errors

Fails with “lattice vectors are not of minimal length” for a 2D basis whose rows the sum or difference of the two shortens beyond rounding, and for an invalid basis, dimension or wavevector.