Skip to content

Commit

Permalink
* Added a check to ensure that the backend has the cx gate in RZXCali…
Browse files Browse the repository at this point in the history
…brationBuilder.
  • Loading branch information
eggerdj committed Feb 3, 2021
1 parent 756d61a commit 278e609
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qiskit/transpiler/passes/scheduling/calibration_creators.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,16 @@ def get_calibration(self, params: List, qubits: List) -> Schedule:
schedule: The calibration schedule for the RZXGate(theta).
Raises:
QiskitError: if the control and target qubits cannot be identified.
QiskitError: if the control and target qubits cannot be identified or the backend
does not support cx between the qubits.
"""
theta = params[0]
q1, q2 = qubits[0], qubits[1]

if not self._inst_map.has('cx', qubits):
raise QiskitError('This transpilation pass requires the backend to support cx '
'between qubits %i and %i.' % (q1, q2))

cx_sched = self._inst_map.get('cx', qubits=(q1, q2))
rzx_theta = Schedule(name='rzx(%.3f)' % theta)

Expand Down

0 comments on commit 278e609

Please sign in to comment.