//! strata-compute โ tier 3: computation traits.
//!
//! traits needed by nox (VM execution) and jali (ring arithmetic).
//! these represent computational capabilities beyond basic arithmetic.
//!
//! ## Spectral
//!
//! a field with roots of unity โ the spectral domain exists.
//! polynomial evaluation at all N-th roots of unity simultaneously
//! (the NTT / number theoretic transform) runs in O(N log N) instead of O(Nยฒ).
//!
//! the name "spectral" comes from spectral methods in numerical analysis:
//! transform between coefficient domain and evaluation domain, compute in
//! whichever domain is cheaper, transform back.
//!
//! ## Packed
//!
//! N field elements in one SIMD-width value. arithmetic operates on all N
//! elements simultaneously. this is the single biggest performance lever
//! for NTT, polynomial evaluation, and constraint checking.
//!
//! plonky3's entire speed advantage comes from packed field operations.
//! the key insight: NTT butterflies, polynomial evaluations, and constraint
//! checks are all element-wise โ they parallelize perfectly across SIMD lanes.
//!
//! ## Bits
//!
//! decompose field elements into bits and reconstruct from bits.
//! nox uses this for binary operations (comparison, shifts, masks).
use Field;
/// a field with spectral structure: roots of unity and NTT.
///
/// the multiplicative group F* has a subgroup of order 2^S
/// generated by the 2^S-th root of unity. this enables the
/// number theoretic transform (NTT) for O(N log N) polynomial
/// evaluation and interpolation.
///
/// not all fields are spectral:
/// - Goldilocks: yes (S = 32, 2^32-th root of unity exists)
/// - Fโยนยฒโธ: no (multiplicative group has order 2^128 - 1, not smooth)
/// - F_q (CSIDH): no (q-1 chosen for isogeny structure, not NTT)
/// - Tropical: not a field
/// N field elements packed into one SIMD-width value.
///
/// all arithmetic (add, sub, mul, neg) operates lane-wise on WIDTH elements
/// simultaneously. this is the primary performance abstraction โ NTT butterflies,
/// polynomial evaluations, and constraint checks parallelize across lanes.
///
/// implementations:
/// - Goldilocks: WIDTH=4 (AVX2, 4ร64-bit) or WIDTH=1 (scalar fallback)
/// - Fโ: kuro's Packed128 already packs 128 elements per u128
/// - Fq: WIDTH=1 (512-bit elements don't benefit from SIMD packing)
///
/// the trait extends Field so packed values support all field operations.
/// the Scalar associated type is the unpacked element type.
/// decompose field elements into bits and reconstruct.
///
/// nox uses bit decomposition for comparison (lt), shifts, masks.
/// Binius uses it for binary constraint encoding (1 constraint per bit).
extern crate alloc;