pub struct GaussianState {
pub num_modes: usize,
pub mean_vector: Vec<f64>,
pub covariancematrix: Vec<Vec<f64>>,
/* private fields */
}Expand description
Gaussian state representation using covariance matrix formalism
Fields§
§num_modes: usizeNumber of modes
mean_vector: Vec<f64>Mean vector (displacement amplitudes) - [x1, p1, x2, p2, …]
covariancematrix: Vec<Vec<f64>>Covariance matrix (2N x 2N where N is number of modes)
Implementations§
Source§impl GaussianState
impl GaussianState
Sourcepub fn vacuum_state(num_modes: usize) -> Self
pub fn vacuum_state(num_modes: usize) -> Self
Create vacuum state for N modes
Sourcepub fn coherent_state(
num_modes: usize,
displacements: Vec<Complex>,
) -> DeviceResult<Self>
pub fn coherent_state( num_modes: usize, displacements: Vec<Complex>, ) -> DeviceResult<Self>
Create coherent state with given displacement
Sourcepub fn squeezed_vacuum_state(
num_modes: usize,
squeezing_params: Vec<f64>,
squeezing_phases: Vec<f64>,
) -> DeviceResult<Self>
pub fn squeezed_vacuum_state( num_modes: usize, squeezing_params: Vec<f64>, squeezing_phases: Vec<f64>, ) -> DeviceResult<Self>
Create squeezed vacuum state
Sourcepub fn apply_displacement(
&mut self,
mode: usize,
displacement: Complex,
) -> DeviceResult<()>
pub fn apply_displacement( &mut self, mode: usize, displacement: Complex, ) -> DeviceResult<()>
Apply displacement operation to a mode
Sourcepub fn apply_squeezing(
&mut self,
mode: usize,
r: f64,
phi: f64,
) -> DeviceResult<()>
pub fn apply_squeezing( &mut self, mode: usize, r: f64, phi: f64, ) -> DeviceResult<()>
Apply squeezing operation to a mode
Sourcepub fn apply_two_mode_squeezing(
&mut self,
mode1: usize,
mode2: usize,
r: f64,
phi: f64,
) -> DeviceResult<()>
pub fn apply_two_mode_squeezing( &mut self, mode1: usize, mode2: usize, r: f64, phi: f64, ) -> DeviceResult<()>
Apply two-mode squeezing operation
Sourcepub fn apply_beamsplitter(
&mut self,
mode1: usize,
mode2: usize,
transmittance: f64,
phase: f64,
) -> DeviceResult<()>
pub fn apply_beamsplitter( &mut self, mode1: usize, mode2: usize, transmittance: f64, phase: f64, ) -> DeviceResult<()>
Apply beamsplitter operation
Sourcepub fn apply_phase_rotation(
&mut self,
mode: usize,
phi: f64,
) -> DeviceResult<()>
pub fn apply_phase_rotation( &mut self, mode: usize, phi: f64, ) -> DeviceResult<()>
Apply phase rotation
Sourcepub fn homodyne_measurement(
&mut self,
mode: usize,
phase: f64,
config: &CVDeviceConfig,
) -> DeviceResult<f64>
pub fn homodyne_measurement( &mut self, mode: usize, phase: f64, config: &CVDeviceConfig, ) -> DeviceResult<f64>
Perform homodyne measurement
Sourcepub fn heterodyne_measurement(
&mut self,
mode: usize,
config: &CVDeviceConfig,
) -> DeviceResult<Complex>
pub fn heterodyne_measurement( &mut self, mode: usize, config: &CVDeviceConfig, ) -> DeviceResult<Complex>
Perform heterodyne measurement
Sourcepub fn condition_on_homodyne_measurement(
&mut self,
mode: usize,
phase: f64,
result: f64,
) -> DeviceResult<()>
pub fn condition_on_homodyne_measurement( &mut self, mode: usize, phase: f64, result: f64, ) -> DeviceResult<()>
Condition state on homodyne measurement result
Sourcepub fn condition_on_heterodyne_measurement(
&mut self,
mode: usize,
_result: Complex,
) -> DeviceResult<()>
pub fn condition_on_heterodyne_measurement( &mut self, mode: usize, _result: Complex, ) -> DeviceResult<()>
Condition state on heterodyne measurement result
Sourcepub fn reset_mode_to_vacuum(&mut self, mode: usize) -> DeviceResult<()>
pub fn reset_mode_to_vacuum(&mut self, mode: usize) -> DeviceResult<()>
Reset a mode to vacuum state
Sourcepub fn get_mode_state(&self, mode: usize) -> DeviceResult<CVModeState>
pub fn get_mode_state(&self, mode: usize) -> DeviceResult<CVModeState>
Get mode state information
Sourcepub fn calculate_average_squeezing(&self) -> f64
pub fn calculate_average_squeezing(&self) -> f64
Calculate average squeezing across all modes
Sourcepub fn calculate_purity(&self) -> f64
pub fn calculate_purity(&self) -> f64
Calculate system purity
Sourcepub fn calculate_entanglement_entropy(&self) -> f64
pub fn calculate_entanglement_entropy(&self) -> f64
Calculate entanglement entropy
Sourcepub fn calculate_entanglement_measures(&self) -> CVEntanglementMeasures
pub fn calculate_entanglement_measures(&self) -> CVEntanglementMeasures
Calculate entanglement measures
Trait Implementations§
Source§impl Clone for GaussianState
impl Clone for GaussianState
Source§fn clone(&self) -> GaussianState
fn clone(&self) -> GaussianState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GaussianState
impl Debug for GaussianState
Source§impl<'de> Deserialize<'de> for GaussianState
impl<'de> Deserialize<'de> for GaussianState
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>,
Auto Trait Implementations§
impl Freeze for GaussianState
impl RefUnwindSafe for GaussianState
impl Send for GaussianState
impl Sync for GaussianState
impl Unpin for GaussianState
impl UnwindSafe for GaussianState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.