use crate::ising::IsingError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum QuantumErrorCorrectionError {
#[error("Ising error: {0}")]
IsingError(#[from] IsingError),
#[error("Error correction code error: {0}")]
CodeError(String),
#[error("Syndrome detection error: {0}")]
SyndromeError(String),
#[error("Logical operation error: {0}")]
LogicalOperationError(String),
#[error("Decoding error: {0}")]
DecodingError(String),
#[error("Threshold error: {0}")]
ThresholdError(String),
#[error("Resource estimation error: {0}")]
ResourceEstimationError(String),
}
pub type QECResult<T> = Result<T, QuantumErrorCorrectionError>;
#[derive(Debug, Clone)]
pub struct QECConfig {
pub code_type: ErrorCorrectionCode,
pub code_parameters: CodeParameters,
pub error_threshold: f64,
pub correction_frequency: f64,
pub logical_operations: Vec<LogicalOperation>,
pub fault_tolerance_level: usize,
pub resource_constraints: ResourceConstraints,
pub annealing_integration: AnnealingIntegration,
}
use super::{
annealing_integration::AnnealingIntegration, codes::CodeParameters, codes::ErrorCorrectionCode,
logical_operations::LogicalOperation, resource_constraints::ResourceConstraints,
};
impl Default for QECConfig {
fn default() -> Self {
Self {
code_type: ErrorCorrectionCode::RepetitionCode,
code_parameters: CodeParameters::default(),
error_threshold: 0.01,
correction_frequency: 1000.0,
logical_operations: Vec::new(),
fault_tolerance_level: 1,
resource_constraints: ResourceConstraints::default(),
annealing_integration: AnnealingIntegration::default(),
}
}
}