Skip to content

User API: support pulse gate calibrations#4859

Merged
mergify[bot] merged 18 commits into
Qiskit:masterfrom
SooluThomas:pulse-gates-user-API
Aug 21, 2020
Merged

User API: support pulse gate calibrations#4859
mergify[bot] merged 18 commits into
Qiskit:masterfrom
SooluThomas:pulse-gates-user-API

Conversation

@SooluThomas
Copy link
Copy Markdown
Member

@SooluThomas SooluThomas commented Aug 3, 2020

Summary

This PR implements stage 2 after PR #4761

We introduce a new circuit method add_calibrations.

Details and comments

def add_calibration(self,
                     gate: Union[Gate, str],
                     qubits: Union[int, Tuple[int]],
                     params: List[Union[float, Parameter]],
                     schedule: Schedule) -> None:
        self._calibrations[gate_name][(tuple(qubits), tuple(gate_params))] = schedule

TODO

  • Fix this: Currently, it works for custom gates but not on the standard gates because gate.name errors for standard gates.

@lcapelluto lcapelluto mentioned this pull request Aug 10, 2020
2 tasks
Comment thread qiskit/circuit/quantumcircuit.py Outdated
Comment thread qiskit/circuit/quantumcircuit.py
Comment thread qiskit/circuit/quantumcircuit.py Outdated
return self.append(CZGate(label=label, ctrl_state=ctrl_state),
[control_qubit, target_qubit], [])

def add_calibration(self, gate, qubits, schedule):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Given the comment below, that we have to optionally accept params (I forgot about the case where gate is a str), I'm not sure if it's better to do add_calibration(gate, qubits, schedule, params) or add_calibration(gate, schedule, qubits, params), or even schedule first...
@ajavadia what is the intuitive order, here?

Comment thread qiskit/circuit/quantumcircuit.py Outdated
@lcapelluto lcapelluto self-assigned this Aug 11, 2020
Comment thread qiskit/circuit/quantumcircuit.py Outdated
Comment thread qiskit/circuit/quantumcircuit.py Outdated
Comment thread qiskit/circuit/quantumcircuit.py Outdated
Comment thread qiskit/circuit/quantumcircuit.py
Comment thread test/python/circuit/test_circuit_properties.py
@lcapelluto lcapelluto mentioned this pull request Aug 19, 2020
1 task
Comment thread qiskit/compiler/transpile.py Outdated
Comment thread test/python/circuit/test_circuit_properties.py
@lcapelluto lcapelluto marked this pull request as ready for review August 21, 2020 18:51
@lcapelluto lcapelluto requested a review from a team as a code owner August 21, 2020 18:51
Comment thread qiskit/compiler/transpile.py Outdated
Comment thread test/python/circuit/test_circuit_properties.py Outdated
@drewrisinger
Copy link
Copy Markdown
Contributor

drewrisinger commented Aug 21, 2020

I really appreciated seeing the examples you used to have in the tests, would love to see an example in the release notes or documentation somewhere.

Comment thread qiskit/compiler/transpile.py Outdated
@lcapelluto lcapelluto added the Changelog: Added Add an "Added" entry in the GitHub Release changelog. label Aug 21, 2020
@mergify mergify Bot merged commit 023693b into Qiskit:master Aug 21, 2020
@lcapelluto lcapelluto mentioned this pull request Aug 23, 2020
2 tasks
Copy link
Copy Markdown
Contributor

@drewrisinger drewrisinger left a comment

Choose a reason for hiding this comment

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

Few notes on documentation clarity
EDIT: removed b/c already merged, wasn't paying attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Added Add an "Added" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants