use std::time::Duration;
#[derive(Debug, Clone)]
pub struct HardwareRequirements {
pub connectivity: ConnectivityRequirements,
pub embedding: EmbeddingRequirements,
pub coherence: CoherenceRequirements,
pub error_rates: ErrorRateRequirements,
}
impl Default for HardwareRequirements {
fn default() -> Self {
Self {
connectivity: ConnectivityRequirements::default(),
embedding: EmbeddingRequirements::default(),
coherence: CoherenceRequirements::default(),
error_rates: ErrorRateRequirements::default(),
}
}
}
#[derive(Debug, Clone)]
pub struct ConnectivityRequirements {
pub min_average_degree: f64,
pub required_topology: Option<TopologyType>,
pub max_embedding_overhead: f64,
}
impl Default for ConnectivityRequirements {
fn default() -> Self {
Self {
min_average_degree: 2.0,
required_topology: None,
max_embedding_overhead: 3.0,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TopologyType {
Pegasus,
Chimera,
Zephyr,
HeavyHex,
AllToAll,
Linear,
Grid,
Custom(String),
}
#[derive(Debug, Clone)]
pub struct EmbeddingRequirements {
pub max_chain_length: usize,
pub embedding_strategy: EmbeddingStrategy,
pub allow_failures: bool,
}
impl Default for EmbeddingRequirements {
fn default() -> Self {
Self {
max_chain_length: 10,
embedding_strategy: EmbeddingStrategy::MinorMinimization,
allow_failures: false,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum EmbeddingStrategy {
MinorMinimization,
ChainLengthMinimization,
LoadBalanced,
ErrorAware,
Fast,
}
#[derive(Debug, Clone)]
pub struct CoherenceRequirements {
pub min_t1_time: Option<Duration>,
pub min_t2_time: Option<Duration>,
pub min_coherence_fidelity: f64,
}
impl Default for CoherenceRequirements {
fn default() -> Self {
Self {
min_t1_time: Some(Duration::from_micros(100)),
min_t2_time: Some(Duration::from_micros(50)),
min_coherence_fidelity: 0.95,
}
}
}
#[derive(Debug, Clone)]
pub struct ErrorRateRequirements {
pub max_single_qubit_error_rate: f64,
pub max_two_qubit_error_rate: f64,
pub max_readout_error_rate: f64,
}
impl Default for ErrorRateRequirements {
fn default() -> Self {
Self {
max_single_qubit_error_rate: 0.001,
max_two_qubit_error_rate: 0.01,
max_readout_error_rate: 0.01,
}
}
}
#[derive(Debug, Clone)]
pub struct HardwareSpecification {
pub device_name: String,
pub num_qubits: usize,
pub connectivity: ConnectivityGraph,
pub error_characteristics: ErrorCharacteristics,
pub operating_conditions: OperatingConditions,
}
#[derive(Debug, Clone)]
pub struct ConnectivityGraph {
pub adjacency_matrix: Vec<Vec<bool>>,
pub topology_type: TopologyType,
pub properties: GraphProperties,
}
#[derive(Debug, Clone)]
pub struct GraphProperties {
pub average_degree: f64,
pub diameter: usize,
pub clustering_coefficient: f64,
pub spectral_gap: f64,
}
#[derive(Debug, Clone)]
pub struct ErrorCharacteristics {
pub single_qubit_errors: Vec<f64>,
pub two_qubit_errors: Vec<Vec<f64>>,
pub readout_errors: Vec<f64>,
pub coherence_times: CoherenceTimes,
}
#[derive(Debug, Clone)]
pub struct CoherenceTimes {
pub t1_times: Vec<Duration>,
pub t2_times: Vec<Duration>,
pub t2_star_times: Vec<Duration>,
}
#[derive(Debug, Clone)]
pub struct OperatingConditions {
pub temperature: f64,
pub magnetic_field: f64,
pub pressure: f64,
pub environmental_noise: f64,
}
#[derive(Debug, Clone)]
pub struct PlatformPerformanceCharacteristics {
pub typical_execution_time: Duration,
pub typical_queue_time: Duration,
pub success_rate: f64,
pub fidelity: f64,
pub throughput: f64,
}