Qiskit Practice
kibrahim757 66 questions

Qiskit v2.x mock exam

Select one answer per question. Submit to see the explanation.

Question 65 / 66
Why might the code below fail?
import requests
import json
 
reqUrl = "https://quantum.cloud.ibm.com/api/v1/jobs"

headersList = {
  "Accept": "application/json",
  "Content-Type": "application/json",
  "Authorization": f"Bearer {My_API_token}",
  "Service-CRN": f"{My_Service_CRN}",
  "IBM-API-Version":"2025-05-01"
}

circuit_qasm = '''OPENQASM 3.0; include "stdgates.inc"; bit[1] c; x $0; c[0] = measure $0;'''
 
payload = json.dumps({
  "program_id": "sampler",
  "backend": f"{backend}",
  "params": {
    "pubs": [[
      circuit_qasm
    ]],
    "version": 2
  }
})
 
response = requests.request("POST", reqUrl, data=payload,  headers=headersList)
print(response.json())
job_id = response.json()['id']