pub struct HypercubeIsomorphism<R>where
R: RingStore,
R::Type: CyclotomicRing,
BaseRing<R>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,{ /* private fields */ }Expand description
Represents the isomorphism
Fp[X]/(Phi_n(X)) -> F_(p^d)^((Z/nZ)*/<p>)where d is the order of p in (Z/nZ)*.
The group (Z/nZ)*/<p> is represented by a HypercubeStructure.
In fact, the more general case of (Z/p^eZ)[X]/(Phi_n(X)) is supported.
§Serialization
There are two ways of serializing/deserializing a HypercubeIsomorphism
- you can serialize the isomorphism including the implementation of
Fp[X]/(Phi_n(X))(if the latter is serializable) using the implementation ofserde::Serializeandserde::Deserialize - alternatively, you can serialize the isomorphism without the ring implementation
using
SerializableHypercubeIsomorphismWithoutRingandDeserializeSeedHypercubeIsomorphismWithoutRing; this of course requires that the ring is provided at deserialization time
Implementations§
Source§impl<R> HypercubeIsomorphism<R>where
R: RingStore,
R::Type: CyclotomicRing,
<<R::Type as RingExtension>::BaseRing as RingStore>::Type: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
impl<R> HypercubeIsomorphism<R>where
R: RingStore,
R::Type: CyclotomicRing,
<<R::Type as RingExtension>::BaseRing as RingStore>::Type: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
pub fn new_cache_file<const LOG: bool>(
ring: R,
hypercube_structure: HypercubeStructure,
dir: &str,
) -> Selfwhere
BaseRing<R>: SerializableElementRing,
pub fn new<const LOG: bool>( ring: R, hypercube_structure: HypercubeStructure, ) -> Self
pub fn create<const LOG: bool>( ring: R, hypercube_structure: HypercubeStructure, ZpeX: DensePolyRing<AsLocalPIR<RingValue<BaseRing<R>>>>, slot_ring_moduli: Vec<El<DensePolyRing<AsLocalPIR<RingValue<BaseRing<R>>>>>>, ) -> Self
pub fn change_modulus<RNew>(&self, new_ring: RNew) -> HypercubeIsomorphism<RNew>where
RNew: RingStore,
RNew::Type: CyclotomicRing,
BaseRing<RNew>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing,
AsFieldBase<DecoratedBaseRing<RNew>>: CanIsoFromTo<<DecoratedBaseRing<RNew> as RingStore>::Type> + SelfIso,
pub fn hypercube(&self) -> &HypercubeStructure
pub fn ring(&self) -> &R
pub fn slot_ring_at<'a>(&'a self, i: usize) -> &'a SlotRingOf<R>where
R: 'a,
pub fn slot_ring<'a>(&'a self) -> &'a SlotRingOf<R>where
R: 'a,
pub fn p(&self) -> i64
pub fn e(&self) -> usize
pub fn d(&self) -> usize
pub fn galois_group(&self) -> &CyclotomicGaloisGroup
pub fn slot_count(&self) -> usize
pub fn get_slot_value( &self, el: &El<R>, slot_index: CyclotomicGaloisGroupEl, ) -> El<SlotRingOf<R>>
pub fn get_slot_values<'a>( &'a self, el: &'a El<R>, ) -> impl ExactSizeIterator<Item = El<SlotRingOf<R>>> + use<'a, R>
pub fn from_slot_values<'a, I>(&self, values: I) -> El<R>
Trait Implementations§
Source§impl<'de, R> Deserialize<'de> for HypercubeIsomorphism<R>where
R: RingStore + Deserialize<'de>,
R::Type: CyclotomicRing,
BaseRing<R>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing + SerializableElementRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
impl<'de, R> Deserialize<'de> for HypercubeIsomorphism<R>where
R: RingStore + Deserialize<'de>,
R::Type: CyclotomicRing,
BaseRing<R>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing + SerializableElementRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<R> Serialize for HypercubeIsomorphism<R>where
R: RingStore + Serialize,
R::Type: CyclotomicRing,
BaseRing<R>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing + SerializableElementRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
impl<R> Serialize for HypercubeIsomorphism<R>where
R: RingStore + Serialize,
R::Type: CyclotomicRing,
BaseRing<R>: Clone + ZnRing + CanHomFrom<StaticRingBase<i64>> + CanHomFrom<BigIntRingBase> + LinSolveRing + FromModulusCreateableZnRing + SerializableElementRing,
AsFieldBase<DecoratedBaseRing<R>>: CanIsoFromTo<<DecoratedBaseRing<R> as RingStore>::Type> + SelfIso,
Auto Trait Implementations§
impl<R> Freeze for HypercubeIsomorphism<R>
impl<R> !RefUnwindSafe for HypercubeIsomorphism<R>
impl<R> Send for HypercubeIsomorphism<R>
impl<R> Sync for HypercubeIsomorphism<R>
impl<R> Unpin for HypercubeIsomorphism<R>
impl<R> !UnwindSafe for HypercubeIsomorphism<R>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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