#[repr(usize)]pub enum GalleryItem {
Show 30 variants
CNOT = 0,
CZSpatialH = 1,
CZTemporalH = 2,
S = 3,
T = 4,
TWithPreparedY = 5,
TComparison = 6,
PhaseGradientK4 = 7,
And4T = 8,
CCZInjectedAnd = 9,
CCZInjectedMaj = 10,
UMA = 11,
ThreeBitAdder = 12,
TenBitAdder = 13,
ToffoliFromAndDelayedCZ = 14,
CCZGateTeleport = 15,
CCZFactoryWithTels = 16,
CCZ4x3_6 = 17,
BellState = 18,
GHZ = 19,
GHZSlideThenGlide = 20,
GHZPatchRotations = 21,
OneDYoked = 22,
THTH = 23,
ThreeCNOTs = 24,
SteaneEncoding = 25,
XMemory = 26,
YMemory = 27,
MoveRotation = 28,
Stability = 29,
}Expand description
A built-in example block graph, identified by a stable string id.
Each entry retains its description, categories, and embedded BLOG source.
Variants§
CNOT = 0
CNOT gate
CZSpatialH = 1
CZ gate with a spatial Hadamard.
CZTemporalH = 2
CZ gate with a temporal Hadamard.
S = 3
S gate teleportation.
T = 4
T gate teleportation.
TWithPreparedY = 5
T gate teleportation with a prepared Y for Clifford fix.
TComparison = 6
Naive T-state comparison with a feed-forward X/Y parity check.
PhaseGradientK4 = 7
Fixed single-qubit sequence of 22 signed pi/4 X/Z rotations and a final H, composed from T-injection modules.
And4T = 8
AND gate (x, y -> x, y, x AND y) using four T injections, multiplex controls, and a spatial output.
CCZInjectedAnd = 9
Compact CCZ-injected temporary AND with multiplex controls and one temporal Hadamard; based on Low et al., Fig. 43(b), arXiv:2605.30455v1. Three open ports accept |CCZ>.
CCZInjectedMaj = 10
SAT-synthesized CCZ-injected MAJ carry slice from Low et al., Figs. 42(b), 43(c), arXiv:2605.30455v1; three open ports accept |CCZ>.
UMA = 11
SAT-synthesized UMA carry-uncompute and sum-extraction slice from Low et al., Figs. 42(c), 43(c), and 62, arXiv:2605.30455v1.
ThreeBitAdder = 12
Three-bit controlled-adder layout with compact routing, five external CCZ states, and adaptive final CZ corrections.
TenBitAdder = 13
Ten-bit controlled-adder layout with compact routing, nineteen external CCZ states, and adaptive final CZ corrections.
ToffoliFromAndDelayedCZ = 14
Toffoli gate (x, y, z -> x, y, z XOR xy) from the four-T AND gadget with a delayed CZ.
CCZGateTeleport = 15
CCZ gate teleportation with three explicit correction branches.
CCZFactoryWithTels = 16
CCZ state factory constructed in arXiv:2409.17595.
CCZ4x3_6 = 17
CCZ state factory, 4x3 layout, without the TELS check.
BellState = 18
Bell state preparation.
GHZ = 19
GHZ state preparation.
GHZSlideThenGlide = 20
GHZ state preparation with sliding then gliding blocks.
GHZPatchRotations = 21
GHZ state preparation with per-qubit patch rotations.
OneDYoked = 22
1D yoked lattice-surgery layout.
THTH = 23
‘-T-H-T-H-’ gate sequence
ThreeCNOTs = 24
Compressed three CNOTs.
SteaneEncoding = 25
Compressed Steane encoding circuit.
XMemory = 26
X-basis memory experiment.
YMemory = 27
Y-basis memory experiment.
MoveRotation = 28
Rotate boundary types by moving in spacetime.
Stability = 29
Stability experiment
Implementations§
Source§impl GalleryItem
impl GalleryItem
Sourcepub fn entry(self) -> &'static GalleryEntry
pub fn entry(self) -> &'static GalleryEntry
Returns the metadata entry for this example.
Source§impl GalleryItem
impl GalleryItem
Sourcepub fn build(self) -> BlockGraph
pub fn build(self) -> BlockGraph
Loads the embedded BLOG graph, retaining its module hierarchy.
Every gallery entry is self-contained.
§Panics
Panics if an embedded source fails to load, which would indicate a corrupt build asset rather than a caller error.
Sourcepub fn build_with_limits(
self,
limits: ModuleCertificationLimits,
) -> Result<BlockGraph, ModuleError>
pub fn build_with_limits( self, limits: ModuleCertificationLimits, ) -> Result<BlockGraph, ModuleError>
Loads the embedded graph with explicit source-analysis and expansion limits.
§Errors
Returns an error when the source cannot be loaded within limits.
Sourcepub fn iter() -> impl Iterator<Item = GalleryItem>
pub fn iter() -> impl Iterator<Item = GalleryItem>
Iterates over all examples.
Sourcepub fn iter_by_category(
category: GalleryCategory,
) -> impl Iterator<Item = GalleryItem>
pub fn iter_by_category( category: GalleryCategory, ) -> impl Iterator<Item = GalleryItem>
Iterates over the examples tagged with category.
Sourcepub fn description(self) -> &'static str
pub fn description(self) -> &'static str
Returns the human-readable description.
Sourcepub fn categories(self) -> &'static [GalleryCategory]
pub fn categories(self) -> &'static [GalleryCategory]
Returns the categories this example belongs to.
Sourcepub fn in_category(self, category: GalleryCategory) -> bool
pub fn in_category(self, category: GalleryCategory) -> bool
Returns whether this example is tagged with category.
Trait Implementations§
Source§impl Clone for GalleryItem
impl Clone for GalleryItem
Source§fn clone(&self) -> GalleryItem
fn clone(&self) -> GalleryItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GalleryItem
Source§impl Debug for GalleryItem
impl Debug for GalleryItem
Source§impl Display for GalleryItem
impl Display for GalleryItem
impl Eq for GalleryItem
Source§impl<'_derivative_strum> From<&'_derivative_strum GalleryItem> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum GalleryItem> for &'static str
Source§fn from(x: &'_derivative_strum GalleryItem) -> &'static str
fn from(x: &'_derivative_strum GalleryItem) -> &'static str
Source§impl From<GalleryItem> for &'static str
impl From<GalleryItem> for &'static str
Source§fn from(x: GalleryItem) -> &'static str
fn from(x: GalleryItem) -> &'static str
Source§impl FromStr for GalleryItem
impl FromStr for GalleryItem
Source§impl Hash for GalleryItem
impl Hash for GalleryItem
Source§impl IntoEnumIterator for GalleryItem
impl IntoEnumIterator for GalleryItem
Source§impl PartialEq for GalleryItem
impl PartialEq for GalleryItem
impl StructuralPartialEq for GalleryItem
Auto Trait Implementations§
impl Freeze for GalleryItem
impl RefUnwindSafe for GalleryItem
impl Send for GalleryItem
impl Sync for GalleryItem
impl Unpin for GalleryItem
impl UnsafeUnpin for GalleryItem
impl UnwindSafe for GalleryItem
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].