pub trait QuantRSDistribution {
// Required methods
fn to_quantrs_distribution(&self) -> Result<DistributionExport>;
fn from_quantrs_distribution(dist: &DistributionExport) -> Result<Self>
where Self: Sized;
fn is_normalized(&self) -> bool;
fn support(&self) -> Vec<Vec<usize>>;
}Expand description
Trait for converting between PGM factors and QuantRS distributions.
This enables seamless integration with QuantRS2’s probabilistic modeling framework.
Required Methods§
Sourcefn to_quantrs_distribution(&self) -> Result<DistributionExport>
fn to_quantrs_distribution(&self) -> Result<DistributionExport>
Convert a factor to a QuantRS-compatible distribution.
§Returns
A normalized probability distribution that can be used with QuantRS2 samplers and inference algorithms.
Sourcefn from_quantrs_distribution(dist: &DistributionExport) -> Result<Self>where
Self: Sized,
fn from_quantrs_distribution(dist: &DistributionExport) -> Result<Self>where
Self: Sized,
Sourcefn is_normalized(&self) -> bool
fn is_normalized(&self) -> bool
Check if the distribution is normalized.