Qiskit / documentation

The documentation content home for https://docs.quantum.ibm.com.
https://docs.quantum.ibm.com
Apache License 2.0
38 stars 81 forks source link

Document job limits #2059

Closed blakejohnson closed 1 month ago

blakejohnson commented 1 month ago

URL, if applicable

No response

Describe the new content you are requesting.

We need to document the limits imposed by the job validation service for jobs sent to IBM backends.

These limits come in three forms:

  1. Max executions (i.e. "shots") - applies when a user requests a specific number of shots. We apply a uniform limit of 5M.
  2. Max number of low-level instructions per qubit - this limit ensures that the user circuits fit within the instruction memory of the control system. The system permits up to 32M instructions per qubit. We can provide a table with the cost model we assume in translating ISA circuit instructions to control system instructions.
  3. Max number of 2-qubit gates per job - this limit ensures that your job can be manipulated within the memory limits of the low-level software stack. The actual limit depends on the options selected in the particular Sampler or Estimator query. We document the lower bound on allowed 2Q gates per job. That is, if a job has fewer than that many 2Q gates, it should pass validation. Some jobs may allow more, and the service will calculate the particular limit allowed for the user selected options and communicate that in the validation error message. The 2Q gate limit per job lower bound is 10k 2-qubit gates.

We check that jobs satisfy these limits on receipt of the job so that users don't experience the pain of waiting hours or days in queue only to have their job fail at execution time.

Note: I will follow up with the instruction cost model.

If this new content request is accepted, do you want to write the content?

I can help the team by providing enough information to write the material

blakejohnson commented 1 month ago

Ok, so for the instructions per qubit, our cost model makes the follow assignment of ISA instructions to the corresponding controller instruction counts:

instruction count
rz 1
delay 1
sx 2
x 2
cx 5
cz 5
ecr 5
measure 10
reset 17
init 50
blakejohnson commented 1 month ago

Users should be aware that certain Primitive options increase the size of their circuit, and the limits apply after the expected increase in circuit size. In particular, enabling dynamical decoupling will introduce additional 1Q gates that are included in the instructions per qubit count. And using gate-folding ZNE introduces additional 2Q gates relevant to the 2Q gate limit (in particular, the number of 2Q gates will be multiplied by the largest noise factor requested in gate-folding ZNE).

jyu00 commented 1 month ago

Max executions (i.e. "shots") - applies when a user requests a specific number of shots. We apply a uniform limit of 5M.

Note that this is not just shots itself. It is the number of executions - i.e. circuits times shots. circuits here are circuits generated after PUB elements are broadcasted. For example, if you have a pub with 1 circuit, observables with shape (1, 6) and parameters with shape (4, 1), then this would render 4 6=24 circuits (or fewer if observables are commutable). Now if you requested 2k shots, then total execution is 242k=48k executions.

blakejohnson commented 1 month ago

Thanks, @jyu00.