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

Temporary fix for q{i} mapping #1514

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Temporary fix for q{i} mapping #1514

merged 1 commit into from
Nov 8, 2024

Conversation

csookim
Copy link
Member

@csookim csookim commented Nov 4, 2024

The name of the ith hardware qubit is stored at index i in QibolabBackend.qubits. When passed to current qibo implementation, this is then converted to q{i} and stored in initial_layout.

This PR ensures that the keys in initial_layout (the hardware qubit names) are sorted during default transpilation, so i in gate.qubits in transpiled circuit consistently refers to the ith hardware qubit.

Will be deprecated after #1500.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.72%. Comparing base (05b57e9) to head (607e773).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1514   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          80       80           
  Lines       11781    11783    +2     
=======================================
+ Hits        11749    11751    +2     
  Misses         32       32           
Flag Coverage Δ
unittests 99.72% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@csookim
Copy link
Member Author

csookim commented Nov 4, 2024

For completeness, there are other places where sorting initial_layout is needed. However, initial_layout will be deprecated and these changes might conflict with #1500.

For now, this fix is enough for circuit execution using the default transpiler.

@csookim csookim marked this pull request as ready for review November 4, 2024 13:40
@csookim csookim requested a review from alecandido November 6, 2024 09:17
@MatteoRobbiati MatteoRobbiati added this to the Qibo 0.2.14 milestone Nov 6, 2024
@csookim csookim requested a review from stavros11 November 8, 2024 11:38
@csookim csookim added this pull request to the merge queue Nov 8, 2024
@csookim csookim removed this pull request from the merge queue due to a manual request Nov 8, 2024
@csookim csookim added this pull request to the merge queue Nov 8, 2024
Merged via the queue into master with commit fb5311e Nov 8, 2024
28 checks passed
@csookim csookim deleted the fix/transpiler_temp branch November 8, 2024 13:01
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