Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support verbatim boxes infrom_ir #972

Closed
Labels
@speller26

Description

@speller26

Describe the feature you'd like
Right now,verbatim boxes are ignored altogether when translating OpenQASM toCircuit objects via theCircuit.from_ir method:

frombraket.circuitsimportCircuitoq="""OPENQASM 3.0;#pragma braket verbatimbox {  h $0;  cnot $0, $1;}"""Circuit.from_ir(oq)
T  : │  0  │  1  │      ┌───┐       q0 : ─┤ H ├───●───      └───┘   │               ┌─┴─┐ q1 : ───────┤ X ├─            └───┘ T  : │  0  │  1  │

Verbatim boxes need to be supported for faithful translation of OpenQASM, particularly for programs with both verbatim and non-verbatim components.

Note: Implementing this feature will require also expanding theOpenQASM parsing functionality in the default simulator package by adding methods for verbatim box handling to theinterpreter andprogram context.

How would this feature be used? Please describe.
As mentioned above, this would allow OpenQASM programs with verbatim boxes to be translated correctly.

Describe alternatives you've considered
Entirely verbatim circuits, can be wrapped manually

verbatim_circuit=Circuit().add_verbatim_box(Circuit.from_ir(openqasm))

but this fails for programs with verbatim boxes in between non-verbatim instructions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp