Sampler

Trait Sampler 

Source
pub trait Sampler {
    // Required methods
    fn run_qubo(
        &self,
        qubo: &(Array<f64, Ix2>, HashMap<String, usize>),
        shots: usize,
    ) -> SamplerResult<Vec<SampleResult>>;
    fn run_hobo(
        &self,
        hobo: &(Array<f64, IxDyn>, HashMap<String, usize>),
        shots: usize,
    ) -> SamplerResult<Vec<SampleResult>>;
}
Expand description

Trait for samplers that can solve QUBO/HOBO problems

Required Methods§

Source

fn run_qubo( &self, qubo: &(Array<f64, Ix2>, HashMap<String, usize>), shots: usize, ) -> SamplerResult<Vec<SampleResult>>

Run the sampler on a QUBO problem

§Arguments
  • qubo - The QUBO problem to solve: (matrix, variable mapping)
  • shots - The number of samples to take
§Returns

A vector of sample results, sorted by energy (best solutions first)

Source

fn run_hobo( &self, hobo: &(Array<f64, IxDyn>, HashMap<String, usize>), shots: usize, ) -> SamplerResult<Vec<SampleResult>>

Run the sampler on a HOBO problem

§Arguments
  • hobo - The HOBO problem to solve: (tensor, variable mapping)
  • shots - The number of samples to take
§Returns

A vector of sample results, sorted by energy (best solutions first)

Implementors§