Hybrid QNN and VQE samples do not work with an external QPU provider #2373
Labels
needs triage
Marks items that require a follow up for proper processing
python-lang
Anything related to the Python CUDA Quantum language implementation
Required prerequisites
Describe the bug
After applied this PR, I tried to run Hybrid QNN sample with OQC's QPU. However, I got the following error;
`TypeError: init(): incompatible constructor arguments. The following argument types are supported:
1. cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.ObserveResult(arg0: float, arg1: cudaq::spin_op, arg2: cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SampleResult)
Invoked with: None, <cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator object at 0x7ffb61af9270>, <cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SampleResult object at 0x7ffb5e346cf0>`
Another example is https://nvidia.github.io/cuda-quantum/0.8.0/examples/python/tutorials/vqe.html;
This gives;
python3: /home/.llvm-project/mlir/lib/IR/PatternMatch.cpp:276: virtual void mlir::RewriterBase::eraseOp(mlir::Operation*): Assertion
op->use_empty() && "expected 'op' to have no uses"' failed.Aborted (core dumped)
`
However, Max Cut example (https://nvidia.github.io/cuda-quantum/latest/applications/python/qaoa.html) seems to be working.
One of CPP test codes also works;
https://github.com/NVIDIA/cuda-quantum/blob/7b4222430542fe87b103ba58bf94dde5c875e739/targettests/execution/cudaq_observe.cpp
Steps to reproduce the bug
qnn.py.txt
QNN code is the above.
vqe.py.txt
VQE code is the above
Expected behavior
Reproduce the same result with the samples with local simulators.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
It seems to be that an internal transpiler/compiler could not generate QIR for some reasons.
The text was updated successfully, but these errors were encountered: