use crate::Primitives;
pub trait ComputationTrace<P: Primitives> {
type Datum: crate::kernel::schema::Datum<P>;
fn input(&self) -> &Self::Datum;
fn output(&self) -> &Self::Datum;
type ComputationStep: ComputationStep<P>;
fn step(&self) -> &[Self::ComputationStep];
type DihedralElement: crate::bridge::observable::DihedralElement<P>;
fn monodromy(&self) -> &Self::DihedralElement;
type Certificate: crate::bridge::cert::Certificate<P>;
fn certified_by(&self) -> &Self::Certificate;
type ResidualEntropy: crate::bridge::observable::ResidualEntropy<P>;
fn residual_entropy(&self) -> &Self::ResidualEntropy;
fn is_geodesic(&self) -> P::Boolean;
type GeodesicViolation: GeodesicViolation<P>;
fn geodesic_violation(&self) -> &[Self::GeodesicViolation];
fn cumulative_entropy_cost(&self) -> P::Decimal;
fn adiabatically_ordered(&self) -> P::Boolean;
type MeasurementEvent: MeasurementEvent<P>;
fn measurement_event(&self) -> &[Self::MeasurementEvent];
fn is_ar1_ordered(&self) -> P::Boolean;
fn is_dc10_selected(&self) -> P::Boolean;
}
pub trait ComputationStep<P: Primitives> {
type Datum: crate::kernel::schema::Datum<P>;
fn from(&self) -> &Self::Datum;
fn to(&self) -> &Self::Datum;
type Operation: crate::kernel::op::Operation<P>;
fn operation(&self) -> &Self::Operation;
fn index(&self) -> P::NonNegativeInteger;
fn step_entropy_cost(&self) -> P::Decimal;
fn jacobian_at_step(&self) -> P::Decimal;
}
pub trait TraceMetrics<P: Primitives> {
fn step_count(&self) -> P::NonNegativeInteger;
fn total_ring_distance(&self) -> P::NonNegativeInteger;
fn total_hamming_distance(&self) -> P::NonNegativeInteger;
}
pub trait GeodesicTrace<P: Primitives>: ComputationTrace<P> {}
pub trait GeodesicViolation<P: Primitives> {
fn violation_reason(&self) -> &P::String;
}
pub trait MeasurementEvent<P: Primitives>: ComputationStep<P> {
fn pre_collapse_entropy(&self) -> P::Decimal;
fn post_collapse_landauer_cost(&self) -> P::Decimal;
fn collapse_step(&self) -> P::NonNegativeInteger;
fn amplitude_vector(&self) -> P::Decimal;
}
pub trait MeasurementOutcome<P: Primitives> {
fn outcome_value(&self) -> P::NonNegativeInteger;
fn outcome_probability(&self) -> P::Decimal;
}
pub trait InhabitanceSearchTrace<P: Primitives>: ComputationTrace<P> {
type InhabitanceCheckpoint: crate::bridge::derivation::InhabitanceCheckpoint<P>;
fn checkpoint(&self) -> &[Self::InhabitanceCheckpoint];
}
pub mod geodesic_q0 {
pub const ADIABATICALLY_ORDERED: bool = true;
pub const IS_GEODESIC: bool = true;
}
pub mod geodesic_q1 {
pub const ADIABATICALLY_ORDERED: bool = true;
pub const IS_GEODESIC: bool = true;
}
pub mod geodesic_q2 {
pub const ADIABATICALLY_ORDERED: bool = true;
pub const IS_GEODESIC: bool = true;
}
pub mod geodesic_q3 {
pub const ADIABATICALLY_ORDERED: bool = true;
pub const IS_GEODESIC: bool = true;
}
pub mod collapse_equal_superposition {
#[allow(clippy::approx_constant)]
pub const POST_COLLAPSE_LANDAUER_COST: f64 = 0.6931471805599453;
#[allow(clippy::approx_constant)]
pub const PRE_COLLAPSE_ENTROPY: f64 = 0.6931471805599453;
}
pub mod collapse_biased {
#[allow(clippy::approx_constant)]
pub const POST_COLLAPSE_LANDAUER_COST: f64 = 0.325083;
#[allow(clippy::approx_constant)]
pub const PRE_COLLAPSE_ENTROPY: f64 = 0.325083;
}
pub mod collapse_classical {
#[allow(clippy::approx_constant)]
pub const POST_COLLAPSE_LANDAUER_COST: f64 = 0.0;
#[allow(clippy::approx_constant)]
pub const PRE_COLLAPSE_ENTROPY: f64 = 0.0;
}