pub struct PhotonicSimulator { /* private fields */ }Expand description
Photonic quantum simulator
Implementations§
Source§impl PhotonicSimulator
impl PhotonicSimulator
Sourcepub fn new(config: PhotonicConfig) -> Result<Self>
pub fn new(config: PhotonicConfig) -> Result<Self>
Create new photonic simulator
Sourcepub fn with_backend(self) -> Result<Self>
pub fn with_backend(self) -> Result<Self>
Initialize with SciRS2 backend
Sourcepub fn initialize_vacuum(&mut self) -> Result<()>
pub fn initialize_vacuum(&mut self) -> Result<()>
Initialize vacuum state
Sourcepub fn initialize_coherent_state(
&mut self,
alpha: Complex64,
mode: usize,
) -> Result<()>
pub fn initialize_coherent_state( &mut self, alpha: Complex64, mode: usize, ) -> Result<()>
Initialize coherent state |α⟩
Sourcepub fn initialize_squeezed_state(
&mut self,
xi: Complex64,
mode: usize,
) -> Result<()>
pub fn initialize_squeezed_state( &mut self, xi: Complex64, mode: usize, ) -> Result<()>
Initialize squeezed state
Sourcepub fn apply_operator(&mut self, operator: PhotonicOperator) -> Result<()>
pub fn apply_operator(&mut self, operator: PhotonicOperator) -> Result<()>
Apply photonic operator
Sourcepub fn measure_photon_number(&self, mode: usize) -> Result<f64>
pub fn measure_photon_number(&self, mode: usize) -> Result<f64>
Measure photon number in given mode
Sourcepub fn photon_distribution(&self, mode: usize) -> Result<Vec<f64>>
pub fn photon_distribution(&self, mode: usize) -> Result<Vec<f64>>
Calculate photon number distribution
Sourcepub fn wigner_function(&self) -> Result<Array2<f64>>
pub fn wigner_function(&self) -> Result<Array2<f64>>
Calculate Wigner function
Sourcepub const fn get_state(&self) -> &PhotonicState
pub const fn get_state(&self) -> &PhotonicState
Get current state
Sourcepub const fn get_config(&self) -> &PhotonicConfig
pub const fn get_config(&self) -> &PhotonicConfig
Get configuration
Sourcepub const fn set_config(&mut self, config: PhotonicConfig)
pub const fn set_config(&mut self, config: PhotonicConfig)
Set configuration
Auto Trait Implementations§
impl Freeze for PhotonicSimulator
impl !RefUnwindSafe for PhotonicSimulator
impl Send for PhotonicSimulator
impl Sync for PhotonicSimulator
impl Unpin for PhotonicSimulator
impl !UnwindSafe for PhotonicSimulator
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.