-
Notifications
You must be signed in to change notification settings - Fork 2.9k
User API: support pulse gate calibrations #4859
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d547ab2
First commit adding _calibrations dict
SooluThomas 2a2000b
Remove unwanted imports
SooluThomas 850a158
more additions
SooluThomas f7cb3e4
add unit test and fix some variable names
SooluThomas b32f249
replace _get_calibrations() to calibrations
SooluThomas 4afe081
review comments
SooluThomas 675af9c
Review comments
SooluThomas 54fe95d
remove unwanted lines
SooluThomas 0e719eb
few more fixes quantum circuit
SooluThomas eb3606b
Merge branch 'master' into pulse-gates-user-API
lcapelluto b6f6d58
add more tests and user warning during transpilation
SooluThomas f910ea9
Merge branch 'master' into pulse-gates-user-API
SooluThomas 19fc221
Merge branch 'master' into pulse-gates-user-API
SooluThomas 77dc384
review comments
SooluThomas 7b08031
review comments
SooluThomas d91444e
review comment
SooluThomas 755c5e2
add reno
SooluThomas b003d8d
Merge branch 'master' into pulse-gates-user-API
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
releasenotes/notes/pulse-gate-calibrations-78fd3fa5a5328761.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| features: | ||
| - | | ||
| Circuits now support a new feature: Pulse gates. This feature enables users who are working | ||
| primarily with ``QuantumCircuits`` to override (for basis gates) or specify (for standard | ||
| and custom gates) a definition of a ``Gate`` operation in terms of time-ordered signals | ||
| across hardware channels. In other words, it allow users to provide a pulse-level "custom | ||
| gate calibration." | ||
|
|
||
| The circuits are built exactly as before. For example:: | ||
|
|
||
| from qiskit import pulse | ||
| from qiskit.circuit import QuantumCircuit, Gate | ||
|
|
||
| class RxGate(Gate): | ||
| def __init__(self, theta): | ||
| super().__init__('rxtheta', 1, [theta]) | ||
|
|
||
| circ = QuantumCircuit(1) | ||
| circ.h(0) | ||
| circ.append(RxGate(3.14), [1]) | ||
|
|
||
| Then, the user must register the calibration with the gate via the circuit method | ||
| ``add_calibration``, which takes a schedule definition as well as the specific qubits | ||
| and parameters that it is defined for:: | ||
|
|
||
| # Define the gate implementation as a schedule | ||
| with pulse.build() as custom_h_schedule: | ||
| pulse.play(pulse.library.Drag(...), pulse.DriveChannel(0)) | ||
|
|
||
| with pulse.build() as q1_x180: | ||
| pulse.play(pulse.library.Gaussian(...), pulse.DriveChannel(1)) | ||
|
|
||
| # Register the schedule to the gate | ||
| circ.add_calibration('h', [0], custom_h_schedule) # or gate.name string to register | ||
| circ.add_calibration(RxGate(3.14), [0], q1_x180) # Can accept gate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.