Skip to content

Conversation

@SamFerracin
Copy link
Collaborator

Currently, when we validate the content of a job's circuit, we assume that every backend can do reset, measure, and delay. However, this may not always be true. This PR removes the assumption.

@SamFerracin SamFerracin requested a review from yaelbh January 6, 2026 19:05
@SamFerracin
Copy link
Collaborator Author

Reproducer:

from qiskit.circuit import QuantumCircuit
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2

backend = service.backend("ibm_miami")

circuit = QuantumCircuit(1)
circuit.x(0)
circuit.reset(0)
circuit.measure_all()

sampler = SamplerV2(backend)
sampler.run([circuit])

This now makes ISA validation fail:

---------------------------------------------------------------------------
IBMInputValueError                        Traceback (most recent call last)
Cell In[10], line 12
      9 circuit.measure_all()
     11 sampler = SamplerV2(backend)
---> 12 job = sampler.run([circuit])
     13 job

File [~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/sampler.py:111](http://localhost:8888/lab/workspaces/auto-H/tree/Bugs/~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/sampler.py#line=110), in SamplerV2.run(self, pubs, shots)
    107 coerced_pubs = [SamplerPub.coerce(pub, shots) for pub in pubs]
    109 validate_classical_registers(coerced_pubs)
--> 111 return self._run(coerced_pubs)

File [~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/base_primitive.py:149](http://localhost:8888/lab/workspaces/auto-H/tree/Bugs/~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/base_primitive.py#line=148), in BasePrimitiveV2._run(self, pubs)
    147 for pub in pubs:
    148     if getattr(self._backend, "target", None) and not is_simulator(self._backend):
--> 149         validate_isa_circuits([pub.circuit], self._backend.target)
    151     if isinstance(self._backend, IBMBackend):
    152         self._backend.check_faulty(pub.circuit)

File [~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/utils/validations.py:97](http://localhost:8888/lab/workspaces/auto-H/tree/Bugs/~/Git/qiskit-ibm-runtime/qiskit_ibm_runtime/utils/validations.py#line=96), in validate_isa_circuits(circuits, target)
     95 message = is_isa_circuit(circuit, target)
     96 if message:
---> 97     raise IBMInputValueError(
     98         message
     99         + " Circuits that do not match the target hardware definition are no longer "
    100         "supported after March 4, 2024. See the transpilation documentation "
    101         "(https://quantum.cloud.ibm.com/docs/guides/transpile) for instructions "
    102         "to transform circuits and the primitive examples "
    103         "(https://quantum.cloud.ibm.com/docs/guides/primitives-examples) to see "
    104         "this coupled with operator transformations."
    105     )

IBMInputValueError: 'The instruction reset on qubits (0,) is not supported by the target system. Circuits that do not match the target hardware definition are no longer supported after March 4, 2024. See the transpilation documentation (https://quantum.cloud.ibm.com/docs/guides/transpile) for instructions to transform circuits and the primitive examples (https://quantum.cloud.ibm.com/docs/guides/primitives-examples) to see this coupled with operator transformations.'

@SamFerracin SamFerracin requested a review from jyu00 January 6, 2026 19:55
@SamFerracin SamFerracin changed the title [WIP] Improve ISA validation Improve ISA validation of non-unitary operations Jan 6, 2026
yaelbh
yaelbh previously approved these changes Jan 7, 2026
@SamFerracin SamFerracin enabled auto-merge January 8, 2026 13:51
@SamFerracin SamFerracin added this pull request to the merge queue Jan 8, 2026
Merged via the queue into Qiskit:main with commit 8417fc3 Jan 8, 2026
17 checks passed
diego-plan9 pushed a commit to diego-plan9/qiskit-ibm-runtime that referenced this pull request Jan 9, 2026
* fix

* cleaned

* test

* black

* CR

* better

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants