pub fn xy_to_hilbert(x: u32, y: u32, order: usize) -> u64
Converts 2D grid coordinates $(x, y)$ to a 1D Hilbert index $d$.
order: Bits per dimension (e.g. order 6 for $64 \times 64$ grid, order 16 for $65536 \times 65536$).
order