Skip to content

barrier() is not implemented on any backend #3

Description

@corgab

Context

CircuitBuilder::barrier() / Gate::barrier() are exposed and serialize a {"type": "barrier"} gate, but bin/python/circuit.py skips it (pass). Braket has no native barrier gate. The methods are currently marked with a @todo.

Options

  1. Implement as a compiler fence via Circuit.add_verbatim_box() (the real Braket equivalent). Note this changes semantics — verbatim boxes prevent compilation/optimization across the boundary and have device-support constraints.
  2. Document explicitly as a logical/no-op separator (visualization aid only) and keep the no-op.
  3. Remove until a backend supports it.

Acceptance

  • Decide on one of the above.
  • Behaviour matches the docblock and README (README currently notes "not yet executed on any backend").
  • If implemented: tests asserting the verbatim box is emitted; if removed: API + tests + docs cleaned up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions