Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support backends using OpenQasm2 #2396

Open
3 of 8 tasks
annagrin opened this issue Nov 19, 2024 · 0 comments
Open
3 of 8 tasks

Support backends using OpenQasm2 #2396

annagrin opened this issue Nov 19, 2024 · 0 comments
Labels
enhancement New feature or request OpenQASM codegen issue with generating OpenQASM 2 output

Comments

@annagrin
Copy link
Collaborator

annagrin commented Nov 19, 2024

Required prerequisites

  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.

Describe the feature

We have a pipeline support for backends using OpenQasm2 but bunch of tests fail due to missing optimizations.

  • Some unused globals are not removed:

    • custom_operation_basic.cpp
    • custom_operation_adj.cpp
    • int8_t.cpp
    • int8_t_free_func.cpp
    • load_value.cpp
    • swap_gate.cpp
    • variable_size_qreg.cpp
  • Fix failing tests that use TranslateToOpenQASM pipeline #2379

  • CCZ and r?<adj> operations need to be decomposed

    • graph_coloring-1.cpp
    • graph-coloring.cpp
    • sudoku_2x2.cpp
    • sudoku_2x2-1.cpp
    • sudoku_2x2-bit_names.cpp
    • sudoku_2x2-reg_name.cpp
  • Fix failing tests that use TranslateToOpenQASM pipeline #2379

  • quake.concat and quake.subveq need expansion

    • custom_operation_ctrl.cpp
    • qspan_slices.cpp
  • quake.subveq used in mz(veq)

    • phase-estimation.cpp
  • in Python, mz(veq) generates allocations and stores are not optimized away

    • Note that using cudaq.translate API instead of cudaq.sample works.
      Looks like the loop might be created by expand-measurements pass in one case but not in the other.
      Consider optimizing away unused array allocations.
  • Add tests for python

  • The following generated code is not accepted on some backends, it errors out with
    RuntimeError: [line 10] cannot declare bit register. Only 1 bit register(s) is/are supported:

OPENQASM 2.0;

qreg var0[2];
h var0[0]; cnot var0[0], var0[1];
creg var3[1];
measure var0[0] -> var3[0];
creg var4[1];
measure var0[1] -> var4[0];

Related: #2325

@annagrin annagrin added the enhancement New feature or request label Nov 19, 2024
@schweitzpgi schweitzpgi added the OpenQASM codegen issue with generating OpenQASM 2 output label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OpenQASM codegen issue with generating OpenQASM 2 output
Projects
None yet
Development

No branches or pull requests

2 participants