pub struct SurfaceCodeLayout {
pub data_qubits: Vec<QubitIndex>,
pub x_ancillas: Vec<QubitIndex>,
pub z_ancillas: Vec<QubitIndex>,
pub x_stabilizers: Vec<Vec<QubitIndex>>,
pub z_stabilizers: Vec<Vec<QubitIndex>>,
}Expand description
Physical layout of a surface code: which data qubits participate in each stabilizer, and the ancilla qubit assigned to each stabilizer.
Fields§
§data_qubits: Vec<QubitIndex>Indices of data qubits.
x_ancillas: Vec<QubitIndex>Indices of X-type (plaquette) ancilla qubits.
z_ancillas: Vec<QubitIndex>Indices of Z-type (vertex) ancilla qubits.
x_stabilizers: Vec<Vec<QubitIndex>>For each X stabilizer, the data qubits it acts on.
z_stabilizers: Vec<Vec<QubitIndex>>For each Z stabilizer, the data qubits it acts on.
Implementations§
Source§impl SurfaceCodeLayout
impl SurfaceCodeLayout
Sourcepub fn distance_3() -> Self
pub fn distance_3() -> Self
Create the layout for a distance-3 rotated surface code.
Total qubits: 9 data (indices 0..8) + 4 X-ancillas (9..12) + 4 Z-ancillas (13..16) = 17.
Sourcepub fn total_qubits(&self) -> u32
pub fn total_qubits(&self) -> u32
Total number of physical qubits (data + ancilla).
Sourcepub fn num_stabilizers(&self) -> usize
pub fn num_stabilizers(&self) -> usize
Total number of stabilizers (X + Z).
Auto Trait Implementations§
impl Freeze for SurfaceCodeLayout
impl RefUnwindSafe for SurfaceCodeLayout
impl Send for SurfaceCodeLayout
impl Sync for SurfaceCodeLayout
impl Unpin for SurfaceCodeLayout
impl UnwindSafe for SurfaceCodeLayout
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
Mutably borrows from an owned value. Read more