Skip to main content

Crate qrab

Crate qrab 

Source
Expand description

Compiler library for the human-readable .qrab quantum-circuit language.

Use compile for in-memory source, from_quirk_url to import a Quirk link, or load_source before compile when the source may contain relative imports. parse and render expose the two compiler stages separately.

Structs§

BackendEscapes
Raw snippets isolated by output backend.
Circuit
A parsed and semantically checked quantum circuit.
Control
One ordinary or parity gate control.
Diagnostic
A source-located lexer, parser, or semantic diagnostic.
EscapeBlock
Raw snippets inserted at defined points in one backend document.
Group
A labeled region spanning a half-open operation range.
Layout
Global circuit geometry and page appearance.
LoadError
An I/O, syntax, or cycle error encountered while expanding imports.
LoadedSource
Expanded source text plus original file/line mappings.
Operation
One scheduled visual operation before backend rendering.
QuirkImportError
An invalid or unsupported Quirk circuit URL.
Span
A byte range and derived one-based location in expanded .qrab source.
Style
Portable visual properties shared by circuit elements.
Wire
One declared circuit wire.

Enums§

BraceSide
Side on which a brace is drawn.
MeasurementShape
Shape used for a labeled measurement result.
NoteSide
Vertical placement of a note.
OperationKind
Semantic operation rendered into one circuit column.
Orientation
Direction in which operation columns advance.
ParityBasis
Basis used by a parity control.
Shape
Geometric shape requested for a supported visual element.
Target
Output format produced by render.
WireKind
Visual and semantic state of a wire segment.

Constants§

VERSION
Version of this crate, as reported by qrab --version.

Functions§

compile
Parses .qrab source and renders a standalone document for target.
from_quirk_url
Converts an escaped or unescaped Quirk circuit URL into checked qrab source.
load_source
Loads a .qrab file and recursively expands file-scope relative imports.
parse
Parses one expanded .qrab source string into a checked circuit.
render
Renders a parsed circuit as a standalone document for target.