pub struct MultilinearQuery<P: PackedField, Backend: ComputationBackend> { /* private fields */ }
Expand description
Tensor product expansion of sumcheck round challenges.
Stores the tensor product expansion $\bigotimes_{i = 0}^{n - 1} (1 - r_i, r_i)$
when round()
is n
for the sequence of sumcheck challenges $(r_0, …, r_{n-1})$.
The tensor product can be updated with a new round challenge in linear time.
This is used in the first several rounds of the sumcheck prover for small-field polynomials,
before it becomes more efficient to switch over to the method that store folded multilinears.
Implementations§
source§impl<P: PackedField, Backend: ComputationBackend> MultilinearQuery<P, Backend>
impl<P: PackedField, Backend: ComputationBackend> MultilinearQuery<P, Backend>
pub fn new(max_query_vars: usize) -> Result<Self, PolynomialError>
pub fn with_full_query( query: &[P::Scalar], backend: Backend, ) -> Result<Self, PolynomialError>
pub fn n_vars(&self) -> usize
sourcepub fn expansion(&self) -> &[P]
pub fn expansion(&self) -> &[P]
Returns the tensor product expansion of the query
If the number of query variables is less than the packing width, return a single packed element.
pub fn into_expansion(self) -> Backend::Vec<P>
pub fn update( self, extra_query_coordinates: &[P::Scalar], ) -> Result<Self, PolynomialError>
pub fn to_ref(&self) -> MultilinearQueryRef<'_, P>
Trait Implementations§
source§impl<P: Debug + PackedField, Backend: Debug + ComputationBackend> Debug for MultilinearQuery<P, Backend>
impl<P: Debug + PackedField, Backend: Debug + ComputationBackend> Debug for MultilinearQuery<P, Backend>
source§impl<'a, P: PackedField, Backend: ComputationBackend> From<&'a MultilinearQuery<P, Backend>> for MultilinearQueryRef<'a, P>
impl<'a, P: PackedField, Backend: ComputationBackend> From<&'a MultilinearQuery<P, Backend>> for MultilinearQueryRef<'a, P>
source§fn from(query: &'a MultilinearQuery<P, Backend>) -> Self
fn from(query: &'a MultilinearQuery<P, Backend>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<P, Backend> Freeze for MultilinearQuery<P, Backend>
impl<P, Backend> RefUnwindSafe for MultilinearQuery<P, Backend>
impl<P, Backend> Send for MultilinearQuery<P, Backend>
impl<P, Backend> Sync for MultilinearQuery<P, Backend>
impl<P, Backend> Unpin for MultilinearQuery<P, Backend>
impl<P, Backend> UnwindSafe for MultilinearQuery<P, Backend>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more