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

Fix drag pulse helper method #835

Merged
merged 5 commits into from
Mar 20, 2024
Merged

Fix drag pulse helper method #835

merged 5 commits into from
Mar 20, 2024

Conversation

andrea-pasquale
Copy link
Contributor

@andrea-pasquale andrea-pasquale commented Mar 15, 2024

While testing qiboteam/qibocal#689 I noticed that the platform's helper methods for creating drag pulses were broken (I was the one who implemented them...). This PR fixes the issue.

Checklist:

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

@andrea-pasquale andrea-pasquale added the bug Something isn't working label Mar 15, 2024
@andrea-pasquale andrea-pasquale self-assigned this Mar 15, 2024
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.51%. Comparing base (aa1d165) to head (80907cf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #835      +/-   ##
==========================================
+ Coverage   66.35%   66.51%   +0.16%     
==========================================
  Files          50       50              
  Lines        6063     6063              
==========================================
+ Hits         4023     4033      +10     
+ Misses       2040     2030      -10     
Flag Coverage Δ
unittests 66.51% <100.00%> (+0.16%) ⬆️

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.

Copy link
Member

@alecandido alecandido left a comment

Choose a reason for hiding this comment

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

The create methods won't survive forever. So, as a temporary patch, it is definitely more than fine.

However, the complications here partially arise from the support to beta=None, which falls back on a non-drag pulse (despite the name of the method).

qubit = self.get_qubit(qubit)
pulse = self.qubits[qubit].native_gates.RX90.pulse(start, relative_phase)
if beta is not None:
pulse.shape = "Drag(5," + str(beta) + ")"
pulse.shape = Drag(rel_sigma=pulse.shape.rel_sigma, beta=beta)
return pulse

def create_RX_drag_pulse(self, qubit, start, relative_phase=0, beta=None):
Copy link
Member

Choose a reason for hiding this comment

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

Is this method truly useful with beta=None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can drop the default and make beta a required argument, which should make sense given that if the user asks for a drag pulse should provide also beta.

@stavros11 stavros11 merged commit c19ca70 into main Mar 20, 2024
24 checks passed
@stavros11 stavros11 deleted the fix_drag branch March 20, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants