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

Fix the default value of qubits_len for the qinst primitive #496

Merged
merged 5 commits into from
Feb 7, 2024
Merged

Conversation

dime10
Copy link
Contributor

@dime10 dime10 commented Feb 5, 2024

Two issues are being fixed:

  • The default value of -1, intended to represent all arguments are
    qubits, does not actually work. Instead, it introduces a off by one
    error, cutting off one of the qubit values.
  • The abstract evaluation did not work with the default value, and
    instead assumed the value was always set manually.

Credit to @positr0nium for unearthing this :)

Two issues are being fixed:
- The default value of `-1`, intended to represent all arguments are
  qubits, does not actually work. Instead, it introduces a off by one
  error, cutting off one of the qubit values.
- The abstract evaluation did not work with the default value, and
  instead assumed the value was always set manually.
@dime10 dime10 added bug Something isn't working frontend Pull requests that update the frontend labels Feb 5, 2024
@dime10 dime10 requested a review from erick-xanadu February 5, 2024 18:49
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5ae8a7) 99.57% compared to head (88d6413) 99.57%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #496   +/-   ##
=======================================
  Coverage   99.57%   99.57%           
=======================================
  Files          43       43           
  Lines        7740     7740           
  Branches      533      533           
=======================================
  Hits         7707     7707           
  Misses         17       17           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@erick-xanadu erick-xanadu left a comment

Choose a reason for hiding this comment

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

🥳

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

🪂

frontend/test/pytest/test_jax_primitives.py Outdated Show resolved Hide resolved
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@dime10 dime10 merged commit caf24e7 into main Feb 7, 2024
32 checks passed
@dime10 dime10 deleted the qinst-fix branch February 7, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Pull requests that update the frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants