pub struct QuboMatrix {
pub linear: Vec<f64>,
pub quadratic: Vec<(usize, usize, f64)>,
pub num_vars: usize,
pub coupler_count: usize,
pub couplers: Vec<Coupler>,
pub index_map: Vec<(u64, u64)>,
pub index_count: usize,
}Expand description
QUBO matrix representation for quantum annealing
Fields§
§linear: Vec<f64>Linear terms (diagonal)
quadratic: Vec<(usize, usize, f64)>Quadratic terms (off-diagonal)
num_vars: usizeNumber of variables
coupler_count: usizeNumber of couplers
couplers: Vec<Coupler>Coupler connections
index_map: Vec<(u64, u64)>Index map for variable mapping
index_count: usizeIndex count
Implementations§
Source§impl QuboMatrix
impl QuboMatrix
Sourcepub fn set_linear(&mut self, var: usize, value: f64)
pub fn set_linear(&mut self, var: usize, value: f64)
Set a linear term
Sourcepub fn set_quadratic(&mut self, var1: usize, var2: usize, value: f64)
pub fn set_quadratic(&mut self, var1: usize, var2: usize, value: f64)
Set a quadratic term
Sourcepub fn emit_coupler(&mut self, var_a: usize, var_b: usize, weight: f64)
pub fn emit_coupler(&mut self, var_a: usize, var_b: usize, weight: f64)
Emit a coupler
Trait Implementations§
Source§impl Clone for QuboMatrix
impl Clone for QuboMatrix
Source§fn clone(&self) -> QuboMatrix
fn clone(&self) -> QuboMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuboMatrix
impl Debug for QuboMatrix
Auto Trait Implementations§
impl Freeze for QuboMatrix
impl RefUnwindSafe for QuboMatrix
impl Send for QuboMatrix
impl Sync for QuboMatrix
impl Unpin for QuboMatrix
impl UnsafeUnpin for QuboMatrix
impl UnwindSafe for QuboMatrix
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.