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§
- Backend
Escapes - 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.
- Escape
Block - 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.
- Load
Error - An I/O, syntax, or cycle error encountered while expanding imports.
- Loaded
Source - Expanded source text plus original file/line mappings.
- Operation
- One scheduled visual operation before backend rendering.
- Quirk
Import Error - An invalid or unsupported Quirk circuit URL.
- Span
- A byte range and derived one-based location in expanded
.qrabsource. - Style
- Portable visual properties shared by circuit elements.
- Wire
- One declared circuit wire.
Enums§
- Brace
Side - Side on which a brace is drawn.
- Measurement
Shape - Shape used for a labeled measurement result.
- Note
Side - Vertical placement of a note.
- Operation
Kind - Semantic operation rendered into one circuit column.
- Orientation
- Direction in which operation columns advance.
- Parity
Basis - Basis used by a parity control.
- Shape
- Geometric shape requested for a supported visual element.
- Target
- Output format produced by
render. - Wire
Kind - Visual and semantic state of a wire segment.
Constants§
- VERSION
- Version of this crate, as reported by
qrab --version.
Functions§
- compile
- Parses
.qrabsource and renders a standalone document fortarget. - from_
quirk_ url - Converts an escaped or unescaped Quirk circuit URL into checked qrab source.
- load_
source - Loads a
.qrabfile and recursively expands file-scope relative imports. - parse
- Parses one expanded
.qrabsource string into a checked circuit. - render
- Renders a parsed circuit as a standalone document for
target.