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

Bugfix/long wait units import #206

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

deanpoulos
Copy link
Contributor

Enforce threshold_for_looping to be an integer so that the final wait time is also an integer.

Copy link

github-actions bot commented Apr 28, 2024

Unit Test Results

382 tests   379 ✔️  40s ⏱️
    1 suites      3 💤
    1 files        0

Results for commit cc43b2f.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@yomach yomach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this, in QUA we automatically convert 1e4 (which is a float) to an int and use it. I don't like it that qualang_tools behaves differently...

With that being said, I'm not completely opposed to it. So what is the reasoning here?

@deanpoulos
Copy link
Contributor Author

I'm not a fan of this, in QUA we automatically convert 1e4 (which is a float) to an int and use it. I don't like it that qualang_tools behaves differently...

With that being said, I'm not completely opposed to it. So what is the reasoning here?

So the scope of this bugfix is limited to the new long_wait macro that I wrote. Despite my testing, when I tried to run it, the QUA compiler complained that my wait_time was not an integer.

This is despite me using unit.(coerce_to_integer=True).to_clock_cycles(1e6), which is unusual, so I decided to go further and write unit.(coerce_to_integer=True).to_clock_cycles(1_000_000), as well as throw an error if the threshold_for_looping parameter is a float.

@yomach
Copy link
Collaborator

yomach commented Apr 30, 2024

I'm not a fan of this, in QUA we automatically convert 1e4 (which is a float) to an int and use it. I don't like it that qualang_tools behaves differently...
With that being said, I'm not completely opposed to it. So what is the reasoning here?

So the scope of this bugfix is limited to the new long_wait macro that I wrote. Despite my testing, when I tried to run it, the QUA compiler complained that my wait_time was not an integer.

This is despite me using unit.(coerce_to_integer=True).to_clock_cycles(1e6), which is unusual, so I decided to go further and write unit.(coerce_to_integer=True).to_clock_cycles(1_000_000), as well as throw an error if the threshold_for_looping parameter is a float.

Please write a test (put it in the test folder) that recreates this issue.
There might be a bug in the unit class, and there might also be a bug in the OPX.

@TheoLaudatQM
Copy link
Contributor

There was indeed a bug with th u.to_clock_cycles function that doesn't cast 1e3//4 to an integer...
I create a separated PR to fix it: https://github.com/qua-platform/py-qua-tools/pull/214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants