encodeΒΆ

Abstractions for constructing QEC architectures.

Classes

EncodeSpec(*[, compile, logical_passes, ...])

A QEC-code-specific collection of passes that together fully encode a computation.

EncoderParams(*args, **kwargs)

ImplementOps(_runner)

ImplementOpsSpec(*, ops, tys, build_wrapper, ...)

A specification for the implement ops pass, supplying implementations to a set of HUGR extension ops.

LogicalCompiler(*args, **kwargs)

OpReplacements()

ReplacementCompiler(op_replacements, str], ...)

A composable pass that replaces extension ops in a Hugr according to the given mappings.

TyReplacements()

Functions

annotate_encoding(hugr, params)

encode(hugr, spec, *[, passes])

Encodes the given package (or Guppy function, directly compiled to a package for convenience) by applying four stages:

implement_ops()

Enriches the given package using the given spec by replacing all operations in the program with function calls to the functions in spec.ops.

Exceptions