use crate::HostTypes;
pub trait ComputationTrace<H: HostTypes> {
type Datum: crate::kernel::schema::Datum<H>;
fn input(&self) -> &Self::Datum;
fn output(&self) -> &Self::Datum;
type ComputationStep: ComputationStep<H>;
fn step(&self) -> &[Self::ComputationStep];
type DihedralElement: crate::bridge::observable::DihedralElement<H>;
fn monodromy(&self) -> &Self::DihedralElement;
type Certificate: crate::bridge::cert::Certificate<H>;
fn certified_by(&self) -> &Self::Certificate;
type ResidualEntropy: crate::bridge::observable::ResidualEntropy<H>;
fn residual_entropy(&self) -> &Self::ResidualEntropy;
fn is_geodesic(&self) -> bool;
type GeodesicViolation: GeodesicViolation<H>;
fn geodesic_violation(&self) -> &[Self::GeodesicViolation];
fn cumulative_entropy_cost(&self) -> H::Decimal;
fn adiabatically_ordered(&self) -> bool;
type MeasurementEvent: MeasurementEvent<H>;
fn measurement_event(&self) -> &[Self::MeasurementEvent];
fn is_ar1_ordered(&self) -> bool;
fn is_dc10_selected(&self) -> bool;
}
pub trait ComputationStep<H: HostTypes> {
type Datum: crate::kernel::schema::Datum<H>;
fn from(&self) -> &Self::Datum;
fn to(&self) -> &Self::Datum;
type Operation: crate::kernel::op::Operation<H>;
fn operation(&self) -> &Self::Operation;
fn index(&self) -> u64;
fn step_entropy_cost(&self) -> H::Decimal;
fn jacobian_at_step(&self) -> H::Decimal;
}
pub trait TraceMetrics<H: HostTypes> {
fn step_count(&self) -> u64;
fn total_ring_distance(&self) -> u64;
fn total_hamming_distance(&self) -> u64;
}
pub trait GeodesicTrace<H: HostTypes>: ComputationTrace<H> {}
pub trait GeodesicViolation<H: HostTypes> {
fn violation_reason(&self) -> &H::HostString;
}
pub trait MeasurementEvent<H: HostTypes>: ComputationStep<H> {
fn pre_collapse_entropy(&self) -> H::Decimal;
fn post_collapse_landauer_cost(&self) -> H::Decimal;
fn collapse_step(&self) -> u64;
fn amplitude_vector(&self) -> H::Decimal;
}
pub trait MeasurementOutcome<H: HostTypes> {
fn outcome_value(&self) -> u64;
fn outcome_probability(&self) -> H::Decimal;
}
pub trait InhabitanceSearchTrace<H: HostTypes>: ComputationTrace<H> {
type InhabitanceCheckpoint: crate::bridge::derivation::InhabitanceCheckpoint<H>;
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;
}