pub struct HardwareTopology {
pub num_qubits: usize,
pub connectivity: UnGraph<u32, f64>,
pub qubit_properties: Vec<QubitProperties>,
pub gate_properties: HashMap<(u32, u32), GateProperties>,
}Expand description
Represents a quantum hardware topology
Fields§
§num_qubits: usizeNumber of physical qubits
connectivity: UnGraph<u32, f64>Connectivity graph (undirected for most hardware)
qubit_properties: Vec<QubitProperties>Qubit properties (T1, T2, gate errors, etc.)
gate_properties: HashMap<(u32, u32), GateProperties>Two-qubit gate properties (gate errors, gate times)
Implementations§
Source§impl HardwareTopology
impl HardwareTopology
Sourcepub fn add_qubit(&mut self, properties: QubitProperties) -> NodeIndex
pub fn add_qubit(&mut self, properties: QubitProperties) -> NodeIndex
Add a qubit with properties
Sourcepub fn add_connection(&mut self, q1: u32, q2: u32, properties: GateProperties)
pub fn add_connection(&mut self, q1: u32, q2: u32, properties: GateProperties)
Add a connection between two qubits
Sourcepub fn load_standard(topology_type: &str) -> Result<Self, TopologyError>
pub fn load_standard(topology_type: &str) -> Result<Self, TopologyError>
Load standard hardware topologies
Sourcepub fn linear_topology(n: usize) -> Self
pub fn linear_topology(n: usize) -> Self
Create a linear topology (chain of qubits)
Sourcepub fn grid_topology(rows: usize, cols: usize) -> Self
pub fn grid_topology(rows: usize, cols: usize) -> Self
Create a 2D grid topology
Sourcepub fn ibm_topology() -> Self
pub fn ibm_topology() -> Self
Create IBM 5-qubit topology (bow-tie shape)
Sourcepub fn google_topology() -> Self
pub fn google_topology() -> Self
Create Google Sycamore-like topology (subset)
Sourcepub fn from_heavy_hex(num_qubits: usize) -> Self
pub fn from_heavy_hex(num_qubits: usize) -> Self
Create IBM Heavy-Hex topology
Sourcepub fn from_sycamore(num_qubits: usize) -> Self
pub fn from_sycamore(num_qubits: usize) -> Self
Create Google Sycamore-like topology
Sourcepub fn num_qubits(&self) -> usize
pub fn num_qubits(&self) -> usize
Get the number of qubits
Sourcepub fn connectivity(&self) -> Vec<(usize, usize)>
pub fn connectivity(&self) -> Vec<(usize, usize)>
Get all connected pairs of qubits
Sourcepub fn are_connected(&self, q1: usize, q2: usize) -> bool
pub fn are_connected(&self, q1: usize, q2: usize) -> bool
Check if two qubits are connected
Sourcepub fn shortest_path_distance(&self, q1: usize, q2: usize) -> Option<f64>
pub fn shortest_path_distance(&self, q1: usize, q2: usize) -> Option<f64>
Get shortest path distance between two qubits
Sourcepub fn analyze_connectivity(&self) -> ConnectivityAnalysis
pub fn analyze_connectivity(&self) -> ConnectivityAnalysis
Simple connectivity analysis
Sourcepub fn analyze(&self) -> TopologyAnalysis
pub fn analyze(&self) -> TopologyAnalysis
Analyze topology properties
Sourcepub fn find_critical_qubits(&self) -> Vec<u32>
pub fn find_critical_qubits(&self) -> Vec<u32>
Find critical qubits (removal increases distances significantly)
Sourcepub fn find_optimal_subset(
&self,
required_qubits: usize,
) -> Result<Vec<u32>, TopologyError>
pub fn find_optimal_subset( &self, required_qubits: usize, ) -> Result<Vec<u32>, TopologyError>
Find optimal qubit subset for a given circuit size
Trait Implementations§
Source§impl Clone for HardwareTopology
impl Clone for HardwareTopology
Source§fn clone(&self) -> HardwareTopology
fn clone(&self) -> HardwareTopology
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HardwareTopology
impl Debug for HardwareTopology
Auto Trait Implementations§
impl Freeze for HardwareTopology
impl RefUnwindSafe for HardwareTopology
impl Send for HardwareTopology
impl Sync for HardwareTopology
impl Unpin for HardwareTopology
impl UnwindSafe for HardwareTopology
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.