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

[QHC-833] Improving digital Transpilation #862

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

Conversation

GuillermoAbadLopez
Copy link
Contributor

@GuillermoAbadLopez GuillermoAbadLopez commented Dec 23, 2024

TODOs for this PR:

(each of the next points is pretty big deal, so check them all please 🙌🙃)

  • Move optimize flag, for actual optional optimizations (& Improve optimize word use in methods names)
  • Make Transpilation/execute/compile only for single circuits (unify code standard across qililab)
  • Make Transpilation efficient, by not constructing the Circuit class so many times, between methods
  • Pass a transpilation kwargs instead of so many args in platform/qililab's execute(...)
  • Improve documentation on transpilation, simplifying it in execute()'s, and moving it to a new section.
  • Cover/change test for all of this.

You will see two empty methods, in this next PR I will fill them:

bunch_drag_gates(...), delete_gates_with_no_amplitude(...)



The documentation after this PR looks like:

For the platform.execute():

Screenshot 2024-12-30 at 12 46 37 Screenshot 2024-12-30 at 12 47 43

For the module about Transpilation:

Screenshot 2024-12-30 at 13 39 06 Screenshot 2024-12-30 at 13 39 19

For the Transpiler.transpile_circuit():

Screenshot 2024-12-30 at 13 36 45 Screenshot 2024-12-30 at 13 37 02

@GuillermoAbadLopez GuillermoAbadLopez self-assigned this Dec 23, 2024
Copy link

🔗Pullpo.io Slack channel

Copy link

pullpo-for-slack bot commented Dec 23, 2024

AI Analysis

Review:

The changes in circuit_transpiler.py to add phases from RZs and CZs gates to Drag gates, optimize transpilation by combining consecutive Drags, and adding explanatory comments seem well-structured and clear. It's great to see the addition of optimization methods for the transpilation process. In circuit_optimizer.py, the addition of the method to add phases to Drag gates and optimize transpilation by combining consecutive Drags aligns well with the changes made in circuit_transpiler.py. It's good to maintain consistency across the codebase.

Detailed file changes

(dropdown):

In circuit_transpiler.py:

  • Added a method to add phases from RZs and CZs gates to Drag gates in the circuit.
  • Modified the transpile_circuits method to use the new method to add phases to Drags.
  • Added comments explaining the process of adding phases from RZs and CZs gates to Drags.
  • Added a method to optimize transpilation by bunching consecutive Drag gates together into a single one.

In circuit_optimizer.py:

  • Added a method to add phases from RZs and CZs gates to Drag gates in the circuit.
  • Modified the cancel_pairs_of_hermitian_gates method signature to return a Circuit.
  • Added a method to optimize transpilation by bunching consecutive Drag gates together into a single one.

@GuillermoAbadLopez GuillermoAbadLopez changed the title Improving optimization word use in the transpilation [QHC-833] Improving optimization word use in the transpilation Dec 28, 2024
Copy link

linear bot commented Dec 28, 2024

@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-833] Improving optimization word use in the transpilation [QHC-833] Improving Transpilation Dec 28, 2024
@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-833] Improving Transpilation [QHC-833] Improving/Feedback Transpilation Dec 28, 2024
@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-833] Improving/Feedback Transpilation [QHC-833] Improving/Feedback in Transpilation Dec 28, 2024
@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-833] Improving/Feedback in Transpilation [QHC-833] Improving/Feedback for Transpilation Dec 28, 2024
Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.78%. Comparing base (7226edf) to head (7fb7339).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #862   +/-   ##
=======================================
  Coverage   96.77%   96.78%           
=======================================
  Files         221      221           
  Lines        7756     7765    +9     
=======================================
+ Hits         7506     7515    +9     
  Misses        250      250           
Flag Coverage Δ
unittests 96.78% <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.

@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-833] Improving/Feedback for Transpilation [QHC-833] Improving digital Transpilation Dec 30, 2024
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.

1 participant