Skip to content

Commit

Permalink
Fix rzz parameter validation on Qiskit 1.1
Browse files Browse the repository at this point in the history
The rzz validation check was using `CircuitInstruction.params`, an alias
for `CircuitInstruction.operation.params` added in Qiskit 1.2. Here the
usage is replaced `CircuitInstruction.operation.params` to keep
compatibility with Qiskit 1.1.
  • Loading branch information
wshanks committed Oct 21, 2024
1 parent c689b98 commit 3e567d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qiskit_ibm_runtime/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ def _is_isa_circuit_helper(circuit: QuantumCircuit, target: Target, qubit_map: D
# errors (beyond pi/2 does not trigger an error down the stack, only may become less
# accurate).
if name == "rzz" and (
instruction.params[0] < 0.0 or instruction.params[0] > 1.001 * np.pi / 2
instruction.operation.params[0] < 0.0
or instruction.operation.params[0] > 1.001 * np.pi / 2
):
return f"The instruction {name} on qubits {qargs} is supported only for angles in the \
range [0, pi/2], but an angle of {instruction.params[0]} has been provided."
range [0, pi/2], but an angle of {instruction.operation.params[0]} has been provided."

if isinstance(operation, ControlFlowOp):
for sub_circ in operation.blocks:
Expand Down

0 comments on commit 3e567d5

Please sign in to comment.