Skip to main content

QuantRSDistribution

Trait QuantRSDistribution 

Source
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§

Source

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.

Source

fn from_quantrs_distribution(dist: &DistributionExport) -> Result<Self>
where Self: Sized,

Create a factor from a QuantRS distribution.

§Arguments
  • dist - The QuantRS distribution to convert
§Returns

A Factor representation suitable for PGM inference.

Source

fn is_normalized(&self) -> bool

Check if the distribution is normalized.

Source

fn support(&self) -> Vec<Vec<usize>>

Get the support (valid values) of the distribution.

Implementors§