pub struct FTCore { /* private fields */ }Expand description
Convenience wrapper for forward/backward Fourier transform.
Caches the forward MPO so that repeated calls to FTCore::forward()
and FTCore::backward() avoid redundant MPO construction.
§Examples
use tensor4all_quanticstransform::{FTCore, FourierOptions};
let ft = FTCore::new(4, FourierOptions::default()).unwrap();
assert_eq!(ft.r(), 4);
let fwd_op = ft.forward().unwrap();
assert_eq!(fwd_op.mpo.node_count(), 4);
let bwd_op = ft.backward().unwrap();
assert_eq!(bwd_op.mpo.node_count(), 4);Implementations§
Source§impl FTCore
impl FTCore
Sourcepub fn new(r: usize, options: FourierOptions) -> Result<Self>
pub fn new(r: usize, options: FourierOptions) -> Result<Self>
Create a new FTCore for r bits.
Sourcepub fn forward(&self) -> Result<LinearOperator<TensorDynLen, usize>>
pub fn forward(&self) -> Result<LinearOperator<TensorDynLen, usize>>
Get the forward Fourier transform operator.
Sourcepub fn backward(&self) -> Result<LinearOperator<TensorDynLen, usize>>
pub fn backward(&self) -> Result<LinearOperator<TensorDynLen, usize>>
Get the backward (inverse) Fourier transform operator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FTCore
impl RefUnwindSafe for FTCore
impl Send for FTCore
impl Sync for FTCore
impl Unpin for FTCore
impl UnsafeUnpin for FTCore
impl UnwindSafe for FTCore
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.