Skip to main contentIBM 

What are ISA circuits?

Details on a recent update to Qiskit Runtime primitives.

17 Apr 2024

Kaelyn Ferris

Abby Mitchell

Blake Johnson

Jessie Yu

A recent change to the Qiskit Runtime primitives means that you may be running into a new kind of error message in your projects when submitting circuits to a backend:

The error message then lists a few suggestions to alleviate the issue, but it doesn’t entirely explain what’s going on. So, what exactly is happening here?

With the newest version of Qiskit Runtime, a requirement was introduced which makes it so that all circuits submitted to a backend must conform to the constraints of the backend’s Target. Such circuits are considered to be written in terms of that backend’s Instruction Set Architecture (ISA) — i.e., the set of instructions the device can understand and execute. These Target constraints are defined by factors like the device’s native basis gates, its qubit connectivity, and when relevant, its pulse and other instruction timing specifications.

In this blog post, we’ll offer some quick and easy solutions for anyone running into this new ISA circuits error message, and explain the reasoning behind the change.

So, what’s the fix?

The TL;DR is that if you encounter the error described above, you’ll need to transpile your circuit(s) using either a pass manager that you create or one of the preset passmanagers. The circuits output by the passmanager will then conform to the constraints of the device and, if you’re using the Sampler primitive, you should be good to go from there.

If you’re using Estimator, you’ll need to take an additional step by modifying your observables to match the qubit layout that you chose (e.g., via the apply_layout method if your observables are stored as SparsePauliOp objects). But that’s it. If you’ve come to this article purely to find out how to get rid of that pesky error message, then you’ve just read everything you need to know. The code below demonstrates a simple example of preparing a circuit and observables that will conform to the constraints of a backend.

For our more curious readers, we’ll use the rest of this blog to take a deeper dive into where the constraints of these target backends come from, and why the ISA circuits requirement was introduced.

What is the Target?

The Target object is primarily used within the qiskit.transpiler submodule. It contains all the important information a transpiler pass may need regarding the constraints of a particular backend. This includes items such as the basis gates of each qubit in the hardware, or the native direction of the available two-qubit gates.

Most of the time, you don’t have to worry about the Target object when running your experiments, since it’s already an attribute of the BackendV2 you get when using the QiskitRuntimeService from Qiskit IBM Runtime. All backends on the IBM Quantum™ Platform have their own Target defined by default.

Of course, this raises a key question: If the Target attribute of a backend contains all of the relevant information about the device’s available instructions, what information does the BackendV2 object of a device contain?

The answer is that the BackendV2 provides the hooks to interact with the service or simulator for submitting primitive queries or looking up previous run jobs. It also allows users to request characterization data to model device behavior. In other words, the BackendV2 connects a Target to a service.

Why did this change happen?

The ISA circuits requirement was introduced as part of our ongoing efforts to increase the overall efficiency of our machines. The userbase of IBM Quantum has grown significantly over the past few years — which is great news! — and we want to ensure the devices are as available as possible.

By introducing the prerequisite that circuits must be written to comply with the constraints of a backend, we get a sort of filtration system. The new requirement effectively filters out any jobs submitted to a device which contains circuits that the device won’t be able to execute. This ultimately increases device availability and reduces queue time. Another benefit of the new ISA circuits requirement is that it improves the predictability of circuit executions. If you’ve already done the work of transpiling your circuits before submitting your job, then you’ve essentially removed an opaque and potentially time-consuming step from each one of your circuit executions.

The new requirement also serves to increase a user’s awareness of how much a query will cost. It’s important that the cost of any given query be easy to understand. When you submit a circuit using some abstract oracle (i.e., a circuit written in an abstract set of instructions that do not take the target device into account), you really have no idea whether that circuit has a compact representation in ISA form, or whether it is exponentially large. By transpiling first, you can examine the ISA circuits for properties such as circuit depth or number of entangling gates. This should mean you get fewer surprising outcomes for primitive queries.

Hopefully this article has provided a useful perspective as to why the new ISA circuits requirement was introduced, and clears up any potential confusion about these important objects within the Qiskit SDK and IBM Qiskit Runtime. For more on ISA circuits, be sure to check out our transpilation documentation, as well as our V2 primitives migration guide.

View documentation