Skip to main content

EquivalenceCheckResult

Struct EquivalenceCheckResult 

pub struct EquivalenceCheckResult {
Show 20 fields pub qubit_num: usize, pub gate_num1: usize, pub gate_num2: usize, pub method: VerificationMethod, pub strategy: VerificationStrategy, pub status: EquivalenceStatus, pub verification_time: f64, pub pathsum_time: f64, pub to_dimacs_time: Option<f64>, pub tool_time: Option<f64>, pub wmc_time: Option<f64>, pub tool_name: String, pub wmc_printed_verdict: Option<&'static str>, pub wmc_precision_reason: Option<&'static str>, pub wmc_print_resolution_distance: Option<f64>, pub approximate_distance_tolerance: Option<f64>, pub rr_approximate: bool, pub solver_invoked: bool, pub final_ps: PathSum, pub stage_ledger: Option<ExclusiveLedger>,
}
Expand description

Native Rust result with a typed EquivalenceStatus verdict.

This structure exposes the same concepts as Python’s EquivalenceCheckResult, not an identical Python dataclass layout. Rust stores status: EquivalenceStatus; Self::equivalent returns the Python-compatible string spelling. Rust’s Self::final_pathsum returns a borrowed symbolic residual and Self::gate_num is a read-only accessor for the first circuit count, whereas Python uses attributes equivalent, final_pathsum, and gate_num. Self::wmc_solver_invoked distinguishes a real external WMC process from an analytic shortcut; numerical solver output is not an exact equality certificate. Error or inconclusive outcomes must not be interpreted as circuit non-equivalence.

Fields§

§qubit_num: usize§gate_num1: usize§gate_num2: usize§method: VerificationMethod§strategy: VerificationStrategy§status: EquivalenceStatus§verification_time: f64§pathsum_time: f64§to_dimacs_time: Option<f64>§tool_time: Option<f64>§wmc_time: Option<f64>§tool_name: String§wmc_printed_verdict: Option<&'static str>

Distinguish printed solver evidence from end-to-end certified bounds.

§wmc_precision_reason: Option<&'static str>§wmc_print_resolution_distance: Option<f64>

Estimated projective-distance print granularity at this Ganak count; Some only when the requested distance is below the observed granularity. This is not an upper bound on the solver’s arithmetic error.

§approximate_distance_tolerance: Option<f64>

Requested projective-distance threshold for WMC verification.

§rr_approximate: bool

RR-only/HYBRID used an analytic upper bound for a nonzero residual phase. This is a tolerance-bounded approximate result, NOT exact source identity.

§solver_invoked: bool

True only when an external weighted counter was invoked.

§final_ps: PathSum§stage_ledger: Option<ExclusiveLedger>

Present only when QUPRS_STAGE_LEDGER=1, never populated in ordinary runs.

Implementations§

§

impl EquivalenceCheckResult

pub fn equivalent(&self) -> &'static str

Python-compatible verdict name; the typed status stays authoritative.

pub fn wmc_solver_invoked(&self) -> bool

Actual external WMC solver process invocation, not analytic shortcuts.

pub fn final_pathsum(&self) -> &PathSum

Borrow the final symbolic PathSum without cloning it.

pub fn gate_num(&self) -> usize

Gate count for the first circuit, matching the Python result name.

Trait Implementations§

§

impl Debug for EquivalenceCheckResult

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.