We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code yields:
Exception: Tried to invoke IterationEnvironment with code creating/deleting QuantumVariables
from qrisp import * def test(qarg, t, steps): rx(np.pi*t/steps,qarg) def U(qarg, t=1, steps=1, iter=1): print(qarg.qs.qv_list) with IterationEnvironment(qarg.qs, iteration_amount=iter*steps): test(qarg, t, steps) qv = QuantumVariable(3) res = QPE(qv,U,precision=3,kwargs={"t":3,"steps":2},iter_spec=True)
It does work for "steps":1. But why does it work in that case anyway? In the first QPE step, qv.qs does not contain the qpe_res in any case.
The text was updated successfully, but these errors were encountered:
This IterationEnvironment behavior is still super clunky. I'll look into it how it can be handled better.
As a hotfix you can call merge([qarg]) as the first command of U. This will merge the qarg qs into the environment qs.
merge([qarg])
Sorry, something went wrong.
positr0nium
No branches or pull requests
The following code yields:
It does work for "steps":1. But why does it work in that case anyway?
In the first QPE step, qv.qs does not contain the qpe_res in any case.
The text was updated successfully, but these errors were encountered: