Solving the Advection Equation background cover

Solving the Advection Equation

Classiq Quantum Use-Case for Qinnovision World Challenge 2025 | Solving the Advection Equation Using Hamiltonian Simulation

Classiq

Hosted by

Classiq

yev
yev

2

Posted

classiq synthesize error

Hello, I am getting failed execution of 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.
Code:
from classiq import *

@qfunc
def main(qbit: Output[QBit]):
    allocate(1, qbit)
    X(qbit)

test_qmod = create_model(main)
test_qprog = synthesize(test_qmod)
Error output:
[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
Versions:
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)]
Could you please check?
Thanks a lot!

Order by:

Antoine Chauvin

3

Posted by antoine (edited)

Hello @quantotto !
Thank you for bringing this to our attention! I understand you're experiencing issues with the synthesis function in Aqora notebooks.
I'd like to clarify that Aqora notebooks process cells asynchronously by design, which requires the use of async-compatible functions throughout your code. For your specific case, instead of classiq.synthesis(test_qmod), you'll want to use await classiq.synthesis_async(test_qmod), which is specifically designed for this asynchronous environment.
For a deeper understanding of how Python's asyncio works in this context, I recommend reviewing this tutorial on the subject. This should help you better understand the underlying principles.
Please don't hesitate to reach out if you need any further clarification or run into other questions during the competition. We're here to help ensure your success.
Antoine – Senior Software Engineer @ Aqora

yev

2

Posted by yev (edited)

OK, thanks @antoine! Yes, I saw the conflict, but didn't want to switch to async calls before the confirmation. Thanks again for checking it out! I'll verify it works and will let you know if there is any issue.

yev

1

Posted by yev

Just wanted to update, @antoine
I switched the calls to _async for synthesize and couple others and it works now.
Many thanks!

Antoine Chauvin

2

Posted by antoine

I'm glad I could be of help! Let me know if you need anything else ;-)

Jannes Stubbemann

2

Posted by stubbi

Thanks @quantotto for reporting! We will investigate

PeterYS

2

Posted by PeterYS

Hi @quantotto, thanks for looking at it.
Actually, I am not sure how this could be resolved either. But I can run it locally on my laptop without interruption. I guess it is because the aqora test has specific checking implementation?
Would you be able to help @julian ? Thanks!

yev

2

Posted by yev

sure
probably something related to handling the async code

Want to join this discussion?

Join our community today and start discussing with our members by participating in exciting events, competitions, and challenges. Sign up now to engage with quantum experts!