Quantics grid structures for efficient conversion between quantics, grid indices, and original coordinates