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-846] Solve Layout problems & Update qibo version transpiler #869

Open
wants to merge 13 commits into
base: adding_optimize_transpiled_gates
Choose a base branch
from

Conversation

GuillermoAbadLopez
Copy link
Contributor

@GuillermoAbadLopez GuillermoAbadLopez commented Jan 14, 2025

TODOs in this and next PRs:

Solve more buggs about final layout/compute it yourself? 🔥🔥🔥

  • Check if Update qibo version solves it?
  • Mirar reported layout para el caso que no cambia
  • Make that reported layout works always

Improve readability of layout 🔥🔥🔥:

  • Make more clear what are keys/values in the dict
  • State clearly the final ordering of qubits (@Ameer)
  • Maybe log both init_layout (placement) & final_layout (placement+routing)

Copy link

linear bot commented Jan 14, 2025

Copy link

🔗Pullpo.io Slack channel

Copy link

pullpo-for-slack bot commented Jan 14, 2025

AI Analysis

Review:

The changes in the test files seem to focus on improving fixture organization and ensuring input validation for the QDAC-II class, which enhances the test coverage and reliability. The modifications in circuit_transpiler.py and qdevil_qdac2.py to use integer keys and define ramping rate ranges respectively show a clear effort to enhance code clarity and maintainability. Overall, these changes appear to improve the codebase by enforcing stricter validation and consistency.

Detailed file changes

(dropdown):

In tests/instruments/qdevil/test_qdevil_qdac2.py:

  • Added a new fixture qdac_out_range for a dummy QDAC-II instance with specific parameters.
  • Updated the get_square_waveform fixture to fix spacing in the return statement.
  • Added test methods to check input ranges for runcard and set_parameter methods for the QDAC.

In circuit_transpiler.py:

  • Updated the return type hint from dict[str, int] to dict[int, int].
  • Changed the final_layout dictionary keys from strings to integers.

In qdevil_qdac2.py:

  • Added class attributes _MIN_RAMPING_RATE and _MAX_RAMPING_RATE to define the ramping rate range.
  • Added input validation to check if the ramp rate is within the defined range (0.01 V/s to 2e7 V/s) before setting it.

In tests/digital/test_circuit_router.py:

  • Changed the test_layout and test_bad_layout dictionaries to use integer keys instead of strings.
  • Updated the final_layout assertions in test_route_doesnt_affect_already_routed_circuit and test_route_affects_non_routed_circuit functions to use integer keys instead of strings.

@GuillermoAbadLopez GuillermoAbadLopez changed the title [QHC-846] Update qibo version transpiler [QHC-846] Solve Layout problems & Update qibo version transpiler Jan 14, 2025
@GuillermoAbadLopez GuillermoAbadLopez marked this pull request as draft January 14, 2025 11:05
@GuillermoAbadLopez GuillermoAbadLopez self-assigned this Jan 14, 2025
@GuillermoAbadLopez GuillermoAbadLopez marked this pull request as ready for review January 21, 2025 10:34
@GuillermoAbadLopez GuillermoAbadLopez marked this pull request as draft January 21, 2025 11:03
@GuillermoAbadLopez GuillermoAbadLopez marked this pull request as ready for review January 21, 2025 12:07
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.29%. Comparing base (4573d20) to head (2073614).

Additional details and impacted files
@@                         Coverage Diff                          @@
##           adding_optimize_transpiled_gates     #869      +/-   ##
====================================================================
- Coverage                             97.30%   97.29%   -0.02%     
====================================================================
  Files                                   231      231              
  Lines                                  8274     8266       -8     
====================================================================
- Hits                                   8051     8042       -9     
- Misses                                  223      224       +1     
Flag Coverage Δ
unittests 97.29% <100.00%> (-0.02%) ⬇️

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.

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