Support backends using OpenQasm2
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 456
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
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
-
CCZandr?<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
-
quake.concatandquake.subveqneed expansion- custom_operation_ctrl.cpp
- qspan_slices.cpp
-
quake.subveqused inmz(veq)- phase-estimation.cpp
-
in Python,
mz(veq)generates allocations and stores are not optimized away- Note that using
cudaq.translateAPI instead ofcudaq.sampleworks.
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.
- Note that using
-
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];
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the failing C++ cases listed in the issue and review PR 2379, then compare the cudaq.translate and cudaq.sample paths for Python measurement handling. Inspect the expand-measurements pass and the generated OpenQASM 2.0 example. Done means the listed optimizations and decompositions work, Python tests exist, and affected backends accept the generated code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100