NVIDIA / cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows
https://nvidia.github.io/cuda-quantum/
Other
468 stars 170 forks source link

Runtime failures result in a non-descriptive "Abort" error when using Anaconda shell #454

Open bettinaheim opened 1 year ago

bettinaheim commented 1 year ago

Required prerequisites

Describe the bug

There is no comprehensive error message based on which one can take action when something goes wrong with the job submission to a hardware backend.

TODO: I haven't checked if the compiler error gets printed correctly when we fail to compile - would be to confirm that!

Steps to reproduce the bug

Copy the example for submitting to Quantinuum, don't create a file with the credentials, and run it using Python. This result simply in an "Abort" being displayed without any further information.

Expected behavior

It should print a message that tells me no credentials were found, similar for other submission issues, like e.g. specifying a machine that doesn't exist.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

Suggestions

No response

amccaskey commented 1 year ago

Maybe something else happened for you, when I run

import cudaq

cudaq.set_target('quantinuum')
kernel = cudaq.make_kernel()
qubits = kernel.qalloc(2)
kernel.h(qubits[0])
kernel.cx(qubits[0], qubits[1])
kernel.mz(qubits)
counts = cudaq.sample(kernel)

I get

Traceback (most recent call last):
  File "/workspaces/cuda-quantum/builds/gcc-12-debug/../scratch/testQtum.py", line 13, in <module>
    counts = cudaq.sample(kernel)
RuntimeError: Cannot find Quantinuum Config file with credentials (~/.quantinuum_config).
bettinaheim commented 1 year ago

I do not get that :( I am running from the Anaconda shell - not sure if that makes a difference?