TurboQuantCodec
End-to-end TurboQuant encode/decode codec.
Wires together the full TurboQuant pipeline:
Random rotation (spread quantization error)
Scalar quantization (map to N-bit codes)
Optional QJL residual (preserve inner-product accuracy)
Bit-packing (compact storage)
Supports two variants:
PolarOnly: Steps 1-2-4 (fast, backend-friendly)
PolarPlusQjl: Steps 1-2-3-4 (higher accuracy)
Usage:
val encoded = TurboQuantCodec.encode(vector, config)
val decoded = TurboQuantCodec.decode(encoded)Content copied to clipboard