Skip to content
New issue

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

Passthrough port sizes don't get compiled correctly #72

Closed
mstechly opened this issue Jun 19, 2024 · 1 comment · Fixed by #115
Closed

Passthrough port sizes don't get compiled correctly #72

mstechly opened this issue Jun 19, 2024 · 1 comment · Fixed by #115
Labels
bug Something isn't working

Comments

@mstechly
Copy link
Contributor

mstechly commented Jun 19, 2024

After running the following piece of code:

import json
from bartiq import Routine, compile_routine, evaluate
from bartiq.integrations import qref_to_bartiq

with open("docs/data/alias_sampling_basic.json", "r") as f:
    routine_dict = json.load(f)

uncompiled_routine = qref_to_bartiq(routine_dict)
compiled_routine = compile_routine(uncompiled_routine)

And inspecting swap:

compiled_routine.children["swap"]

I get the following result:
Screenshot 2024-06-19 at 7 26 01 PM

These P_1 and P_2 are not defined anywhere, they are placeholder variables coming from the passthroughs. At this stage they should have been replaced by real values coming from ports they're connected to, but something went wrong.

This might get resolved while working on #18 , but if not, needs to be fixed after it's resolved.

I was using bartiq==0.2.0.

@mstechly mstechly added the bug Something isn't working label Jun 19, 2024
@mstechly
Copy link
Contributor Author

mstechly commented Jun 25, 2024

A potentially related issue:

When running basic tutorial as part of #76 with new verification, I got the following warning from verifying compiled routine:

/Users/mstechly/Documents/code/2024-06-04-18-validation/bartiq/src/bartiq/compilation/_compile.py:117: UserWarning: Found the following issues with the provided routine after the compilation has finished: ["Symbol n_b found in subroutine: my_algorithm.B, which is not among top level params: {'n', 'z'}."]

Here similarly, the n_b does not get compiled out – it might be the same or related bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant