mirror of https://github.com/Qiskit/qiskit.git
Cast ParameterExpression to float in RZXBuilder and RZXCalibrationBuilderNoEcho (#8965)
* committing changes but still debugging * commiting to check necessary changes * added explicit casting to get_calibration in rzx_builder.py in two places * found a linting error in alap.py * Remove redundant float cast Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
This commit is contained in:
parent
799caa7ad9
commit
de8e4dd836
|
@ -164,11 +164,17 @@ class RZXCalibrationBuilder(CalibrationBuilder):
|
|||
schedule: The calibration schedule for the RZXGate(theta).
|
||||
|
||||
Raises:
|
||||
QiskitError: if rotation angle is not assigned.
|
||||
QiskitError: If the control and target qubits cannot be identified.
|
||||
CalibrationNotAvailable: RZX schedule cannot be built for input node.
|
||||
"""
|
||||
theta = node_op.params[0]
|
||||
|
||||
try:
|
||||
theta = float(theta)
|
||||
except TypeError as ex:
|
||||
raise QiskitError("Target rotation angle is not assigned.") from ex
|
||||
|
||||
rzx_theta = Schedule(name="rzx(%.3f)" % theta)
|
||||
rzx_theta.metadata["publisher"] = CalibrationPublisher.QISKIT
|
||||
|
||||
|
@ -275,12 +281,18 @@ class RZXCalibrationBuilderNoEcho(RZXCalibrationBuilder):
|
|||
schedule: The calibration schedule for the RZXGate(theta).
|
||||
|
||||
Raises:
|
||||
QiskitError: if rotation angle is not assigned.
|
||||
QiskitError: If the control and target qubits cannot be identified,
|
||||
or the backend does not natively support the specified direction of the cx.
|
||||
CalibrationNotAvailable: RZX schedule cannot be built for input node.
|
||||
"""
|
||||
theta = node_op.params[0]
|
||||
|
||||
try:
|
||||
theta = float(theta)
|
||||
except TypeError as ex:
|
||||
raise QiskitError("Target rotation angle is not assigned.") from ex
|
||||
|
||||
rzx_theta = Schedule(name="rzx(%.3f)" % theta)
|
||||
rzx_theta.metadata["publisher"] = CalibrationPublisher.QISKIT
|
||||
|
||||
|
|
Loading…
Reference in New Issue