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
We ran the complete testsuite of qxbackend with qxecelarator 0.6.2 and one testcase caused qxelarator to produce a segmentation fault. A minimal example to reproduce this is the following:
fromqxelaratorimportQXqx=QX()
qx.set_string("""version 1.0qubits 2.test h q[1]""")
result_raw=qx.execute(0)
Running this gives:
Number of runs is 0
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
It would be nice if an actual python error was raised instead of a segmentation fault.
I.e. if one runs:
result_raw=qx.execute(-1)
instead one does get an error that can be caught by python and handled appriopriately
Traceback (most recent call last):
File "/code/qutech/qx-backend/.venv/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3442, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-9078becc5ff9>", line 9, in <module>
result_raw = qx.execute(-1)
File "/code/qutech/qx-backend/.venv/lib/python3.9/site-packages/qxelarator/qxelarator.py", line 77, in execute
return _qxelarator.QX_execute(self, iterations)
OverflowError: in method 'QX_execute', argument 2 of type 'std::size_t'
It would be nice if a similar OverflowError, or an ValueError ccould be raised when the number of iterations is 0.
The text was updated successfully, but these errors were encountered:
Actually I found another way to expose uncaught errors in the underlying c++ that are not nicely wrapped in python code so that they can be dealt with.
Example:
fromqxelaratorimportQXqx.execute(1)
output:
No circuit successfully loaded, call set(...) first
libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
Note that the above code for some reason seems to produce different errors when executed multiple times. I've seen SIGABRT, SIGBUS and SIGSEGV. They are probably being caused by the same underlying issue.
I've not been able to create any such uncaught exceptions using qxelarator.execute_string, so good job on this new interface.
We ran the complete testsuite of qxbackend with qxecelarator 0.6.2 and one testcase caused qxelarator to produce a segmentation fault. A minimal example to reproduce this is the following:
Running this gives:
It would be nice if an actual python error was raised instead of a segmentation fault.
I.e. if one runs:
instead one does get an error that can be caught by python and handled appriopriately
It would be nice if a similar OverflowError, or an ValueError ccould be raised when the number of iterations is 0.
The text was updated successfully, but these errors were encountered: