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

Transpiler refactor #1500

Merged
merged 37 commits into from
Nov 27, 2024
Merged

Transpiler refactor #1500

merged 37 commits into from
Nov 27, 2024

Conversation

csookim
Copy link
Member

@csookim csookim commented Oct 22, 2024

This covers issue #1493.

This PR updates the qubit representation in qibo to support hardware execution after transpilation. Circuit.wire_names and Gate.qubits will be used on the hardware side.

Terms

  • physical qubit = qubit name = Circuit.wire_names: list[str | int]
  • logical qubit = qubit index = Gate.qubits: Tuple[int, ...]
  • connectivity = nx.Graph
  • mapping = qubit layout

Updates

  • Removed initial_layout, which was used to represent the mapping between {physical qubit: logical qubit}.
  • wire_names itself serves as the mapping. Qubit i corresponds to the physical qubit named wire_names[i].

Transpiler

  • To transpile a circuit, the user must provide connectivity representing the hardware.
  • Node names in connectivity must match the wire_names in the circuit.
  • Placer calculates the placement based on connectivity and circuit. It updates the wire_names directly with no return value.
  • Router does routing based on connectivity and circuit, returning a new_circuit and final_mapping.

Checklist:

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

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.71%. Comparing base (faa5a7c) to head (049ff01).
Report is 40 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1500      +/-   ##
==========================================
- Coverage   99.72%   99.71%   -0.01%     
==========================================
  Files          80       81       +1     
  Lines       11783    11737      -46     
==========================================
- Hits        11751    11704      -47     
- Misses         32       33       +1     
Flag Coverage Δ
unittests 99.71% <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.

Base automatically changed from qibo_global to master October 23, 2024 13:00
@csookim csookim marked this pull request as ready for review October 24, 2024 11:15
@alecandido alecandido self-requested a review October 24, 2024 13:13
@alecandido

This comment was marked as resolved.

@alecandido

This comment was marked as resolved.

@alecandido

This comment was marked as resolved.

@alecandido

This comment was marked as resolved.

alecandido

This comment was marked as resolved.

@csookim

This comment was marked as resolved.

@stavros11

This comment was marked as resolved.

@alecandido

This comment was marked as resolved.

@csookim

This comment was marked as resolved.

@csookim csookim mentioned this pull request Nov 4, 2024
4 tasks
@MatteoRobbiati MatteoRobbiati added this to the Qibo 0.2.14 milestone Nov 19, 2024
@csookim

This comment was marked as resolved.

@csookim

This comment was marked as resolved.

@alecandido

This comment was marked as resolved.

alecandido

This comment was marked as resolved.

@csookim csookim requested a review from alecandido November 25, 2024 10:58
@csookim csookim added this pull request to the merge queue Nov 27, 2024
Merged via the queue into master with commit 7898f00 Nov 27, 2024
27 checks passed
@csookim csookim deleted the transpiler_refactor branch November 27, 2024 12:12
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