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

Add wire disjoint check for n-ctrl gate support in LQ #949

Merged
merged 7 commits into from
Oct 18, 2024

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Oct 18, 2024

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

[SC-76347]

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@multiphaseCFD multiphaseCFD changed the title Add_wire_disjoint_check_nctrl Add wire disjoint check for n-ctrl gate support Oct 18, 2024
@multiphaseCFD multiphaseCFD changed the title Add wire disjoint check for n-ctrl gate support Add wire disjoint check for n-ctrl gate support in LQ Oct 18, 2024
@multiphaseCFD multiphaseCFD marked this pull request as ready for review October 18, 2024 17:43
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.82%. Comparing base (c719ac7) to head (e7a604a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #949      +/-   ##
==========================================
- Coverage   96.57%   93.82%   -2.75%     
==========================================
  Files         215      169      -46     
  Lines       30452    22290    -8162     
==========================================
- Hits        29408    20914    -8494     
- Misses       1044     1376     +332     

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

@josephleekl
Copy link
Contributor

Thanks @multiphaseCFD! This looks good to me, just commented on the added comments

Copy link
Contributor

@josephleekl josephleekl left a comment

Choose a reason for hiding this comment

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

LGTM, this is a good check, thanks @multiphaseCFD!

Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a comment

Choose a reason for hiding this comment

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

Thank you @multiphaseCFD
A few comments
Could you explain a bit why this change, please?

@multiphaseCFD
Copy link
Member Author

multiphaseCFD commented Oct 18, 2024

Thank you @multiphaseCFD A few comments Could you explain a bit why this change, please?

Good question @LuisAlfredoNu . Current LQ implement has no safety check for the controlled gates, which allows users to pass wrong wire info without any warning. For example, the control_wires and target wires are the same, which is not physically correct, in a few tests in the unit tested I revised. This PR will fix it

Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a comment

Choose a reason for hiding this comment

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

Thank you @multiphaseCFD
Nice work and good catch on solving this potential bug
🚀 🐛

@multiphaseCFD multiphaseCFD merged commit f36d97c into master Oct 18, 2024
98 of 99 checks passed
@multiphaseCFD multiphaseCFD deleted the add_wire_disjoint_check_nctrl branch October 18, 2024 21:14
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.

4 participants