You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
Make sure you've read the documentation. Your issue may be addressed there.
Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
Creating a new backend which uses OpenQASM 2.0 as the IR breaks several of the targettests/execution tests, including:
custom_operation_basic.cpp - custom ops aren't supported in OQ2
custom_operation_adj.cpp
custom_operation_ctrl.cpp
These 3 fail with:
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/custom_operation_adj.cpp
loc("-":30:1): error: 'cc.global' op unable to translate op to OpenQASM 2.0
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
FileCheck command line: /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/custom_operation_adj.cpp
Also failing are:
graph_coloring-1.cpp
graph_coloring.cpp
with:
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/graph_coloring-1.cpp
loc(callsite("graph_coloring-1.cpp":42:3 at "graph_coloring-1.cpp":86:3)): error: cannot convert operation to OpenQASM 2.0.
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
FileCheck command line: /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/graph_coloring-1.cpp
and
loc(callsite(callsite("graph_coloring.cpp":41:3 at "graph_coloring.cpp":59:3) at "graph_coloring.cpp":105:3)): error: cannot create adjoint for this operation.
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
int8_t.cpp
int8_t_free_func.cpp
load_value.cpp
swap_gate.cpp
variable_size_qreg.cpp
with
+ /workspaces/cuda-quantum/build/targettests/execution/Output/int8_t.cpp.tmp
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/int8_t.cpp
loc("int8_t.cpp":26:5): error: 'cc.alloca' op unable to translate op to OpenQASM 2.0
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
qspan_slices.cpp
with
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/qspan_slices.cpp
loc(callsite("qspan_slices.cpp":27:19 at "qspan_slices.cpp":35:3)): error: 'quake.subveq' op unable to translate op to OpenQASM 2.0
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
sudoku_2x2.cpp
sudoku_2x2-1.cpp
sudoku_2x2-reg_name.cpp
sudoku_2x2-bit_names.cpp
with
loc(callsite("sudoku_2x2-1.cpp":27:3 at "sudoku_2x2-1.cpp":49:5)): error: cannot convert operation to OpenQASM 2.0.
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
Create a new REST backend with the above lowering config in its backend.yml and use that as the target in the targettests/execution tests.
Expected behavior
Tests should ideally pass or offer a more descriptive error message in some cases.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
CUDA Quantum version: 0.8, CUDA 11.8
Python version: N/A
C++ compiler: gcc 11.4.0
Operating system: Linux 01c0ebb026db 6.6.12-linuxkit #1 SMP Thu Feb 8 06:36:34 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux (the CUDA-Quantum dev container on a Mac M2)
Suggestions
No response
The text was updated successfully, but these errors were encountered:
Some more testing reveals that exp_pauli.cpp also fails with:
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/exp_pauli.cpp
loc("exp_pauli.cpp":30:30): error: 'cc.string_literal' op unable to translate op to OpenQASM 2.0
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
and test-6.cpp with:
+ /usr/local/llvm/bin/FileCheck /workspaces/cuda-quantum/targettests/execution/test-6.cpp
loc("test-6.cpp":42:17): error: 'quake.mx' op unable to translate op to OpenQASM 2.0
terminate called after throwing an instance of 'std::runtime_error'what(): Could not successfully translate to qasm2.
FileCheck error: '<stdin>' is empty.
The error: 'cc.alloca' op unable to translate op to OpenQASM 2.0 has been resolved by adding func.func(const-prop-complex,canonicalize,cse,lift-array-alloc),globalize-array-values to the pipeline lowering config, thank you to @khalatepradnya for the suggestion. The sudoku examples are still failing at this gate:
Because gate modfiiers aren't supported in OQ2. However, I'm wondering if another compiler pass could lower this to gates which are supported (e.g. SWAP, CX, and friends)?
Required prerequisites
Describe the bug
Creating a new backend which uses OpenQASM 2.0 as the IR breaks several of the
targettests/execution
tests, including:custom_operation_basic.cpp
- custom ops aren't supported in OQ2custom_operation_adj.cpp
custom_operation_ctrl.cpp
These 3 fail with:
Also failing are:
graph_coloring-1.cpp
graph_coloring.cpp
with:
and
int8_t.cpp
int8_t_free_func.cpp
load_value.cpp
swap_gate.cpp
variable_size_qreg.cpp
with
qspan_slices.cpp
with
sudoku_2x2.cpp
sudoku_2x2-1.cpp
sudoku_2x2-reg_name.cpp
sudoku_2x2-bit_names.cpp
with
and
phase_estimation.cpp
with
(didn't get much info from this about what the failure cause was).
My lowering pass is:
Steps to reproduce the bug
Create a new REST backend with the above lowering config in its
backend.yml
and use that as the target in thetargettests/execution
tests.Expected behavior
Tests should ideally pass or offer a more descriptive error message in some cases.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
gcc 11.4.0
Linux 01c0ebb026db 6.6.12-linuxkit #1 SMP Thu Feb 8 06:36:34 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
(the CUDA-Quantum dev container on a Mac M2)Suggestions
No response
The text was updated successfully, but these errors were encountered: