Hosted by
Classiq
aqora test
, when the classiq's synthesize
function is called. Below is the minimal code that reproduces the issue, the error output and versions info.from classiq import *
@qfunc
def main(qbit: Output[QBit]):
allocate(1, qbit)
X(qbit)
test_qmod = create_model(main)
test_qprog = synthesize(test_qmod)
[1 FAIL] Evaluation error
Traceback (most recent call last):
File "D:\Dev\quantotto\quantum\classiq\classiq_qinnovision\submission\__aqora__\__init__.py", line 16, in generated_onxwy5lunfxw4
return await module_onxwy5lunfxw4.__aqora__(*__aqora__args, **__aqora__kwargs)
File "D:\Dev\quantotto\quantum\classiq\classiq_qinnovision\submission\__aqora__\generated\onxwy5lunfxw4.py", line 10, in __aqora__
coroutine = eval(__aqora__script, globals())
File "D:\Dev\quantotto\quantum\classiq\classiq_qinnovision\submission\__aqora__\generated\onxwy5lunfxw4.converted.py", line 51, in <module>
test_qprog = synthesize(test_qmod)
File "D:\Dev\quantotto\quantum\classiq\classiq_qinnovision\.venv\lib\site-packages\classiq\synthesis.py", line 85, in synthesize
result = async_utils.run(synthesize_async(serialized_model))
File "D:\Dev\quantotto\quantum\classiq\classiq_qinnovision\.venv\lib\site-packages\classiq\_internals\async_utils.py", line 37, in run
return loop.run_until_complete(coro)
File "C:\Python310\lib\asyncio\base_events.py", line 625, in run_until_complete
self._check_running()
File "C:\Python310\lib\asyncio\base_events.py", line 584, in _check_running
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
Failed to run pipeline
ERROR Oh no! Failed to run pipeline
To try and fix this, you can:
- Check the above error and try again
sys:1: RuntimeWarning: coroutine 'synthesize_async' was never awaited
classiq 0.58.1
>aqora -V
aqora 0.8.0
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
3
Posted by antoine • (edited)
classiq.synthesis(test_qmod)
, you'll want to use await classiq.synthesis_async(test_qmod)
, which is specifically designed for this asynchronous environment.asyncio
works in this context, I recommend reviewing this tutorial on the subject. This should help you better understand the underlying principles.2
2
Posted by stubbi •
2
Posted by PeterYS •
2
Posted by yev •