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
Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
Make sure you've read the documentation. Your issue may be addressed there.
Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
The following test produces different results on Ionq emulation and Ionq simulation in CI due to mz instructions and extra mz-related registers we create in QIR.
Questions:
Is this code valid?
should we emit an error on get_state on a kernel that contains a measurement?
If the code is valid, what results do we expect for various platforms?
Steps to reproduce the bug
# ============================================================================ ## Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. ## All rights reserved. ## ## This source code and the accompanying materials are made available under ## the terms of the Apache License 2.0 which accompanies this distribution. ## ============================================================================ #deftest_state_synthesis():
@cudaq.kerneldefinit(n: int):
q=cudaq.qvector(n)
h(q[0]
x(q[1])
mz(q)
@cudaq.kerneldefkernel(s: cudaq.State):
q=cudaq.qvector(s)
x(q[1])
mz(q)
s=cudaq.get_state(init, 2)
s=cudaq.get_state(kernel, s)
print(counts)
counts=cudaq.sample(kernel, s)
cudaq.set_target("ionq", emulate=True)
test_state_synthesis()
cudaq.set_target("ionq", emulate=False)
test_state_synthesis()
Tests with emulation enabled on a local simulator give following results:
{ 01:521 11:479 }
Tests against IonQ simulator in CI give different results:
Required prerequisites
Describe the bug
The following test produces different results on Ionq emulation and Ionq simulation in CI due to mz instructions and extra mz-related registers we create in QIR.
Questions:
Steps to reproduce the bug
Tests with emulation enabled on a local simulator give following results:
Tests against IonQ simulator in CI give different results:
QIR for ionq (note that we create 6 registers)
Expected behavior
Same results in both executions (or an error if this code is invalid)
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
No response
The text was updated successfully, but these errors were encountered: