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

Alias_sampling_basic.json not updated after local_variables QREF change #102

Closed
bdg221 opened this issue Aug 7, 2024 · 0 comments · Fixed by #103
Closed

Alias_sampling_basic.json not updated after local_variables QREF change #102

bdg221 opened this issue Aug 7, 2024 · 0 comments · Fixed by #103
Labels
bug Something isn't working

Comments

@bdg221
Copy link
Contributor

bdg221 commented Aug 7, 2024

Describe the bug

In issue #71 (PR #79) local_variables is changed from a list of strings to a dictionary. Similarly, in QREF (PsiQ/qref#106) local_variables is changed to be a dictionary, as well.

However, the alias_sampling_basic.json has not been updated and trying to call qref_to_bartiq after loading the JSON results in:

pydantic_core._pydantic_core.ValidationError: 3 validation errors for SchemaV1
program.children.0.local_variables
  Input should be a valid dictionary [type=dict_type, input_value=['R=ceiling(log_2(L))'], input_type=list]
    For further information visit https://errors.pydantic.dev/2.7/v/dict_type
program.children.2.local_variables
  Input should be a valid dictionary [type=dict_type, input_value=['R=ceiling(log_2(L))'], input_type=list]
    For further information visit https://errors.pydantic.dev/2.7/v/dict_type
program.local_variables
  Input should be a valid dictionary [type=dict_type, input_value=['R=ceiling(log_2(L))'], input_type=list]
    For further information visit https://errors.pydantic.dev/2.7/v/dict_type

How to Reproduce

This can be duplicated with the following 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)

Expected behavior

The provided sample json file should be in the appropriate format so that it can be changed into a routine properly.

Actual behavior

Calling qref_to_bartiq throws an error complaining that local_variables is not a dictionary.

Environment:

  • Bartiq 0.5.0
  • Python version 3.11.9
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