2

I tried to change a little the code here for running the quantum volume circuits in real devices. My code is

backend = provider.get_backend('ibmq_bogota')

shots = 1000 for trial in range(ntrials): clear_output(wait=True) t_qcs = transpile(qv_circs[trial], backend=backend, initial_layout=qubit_lists[0]) qobj = [assemble(t_qcs)]

job_manager = IBMQJobManager()
job_set_foo = job_manager.run(qobj, backend=backend, shots=shots, name='QV trial %d'%(trial))

print(job_set_foo.report(detailed=True)) print(f'Completed trial {trial+1}/{ntrials}')

But I get

status: job submit failed: 'bad input to assemble() function; must be either circuits or schedules'

I don't understand how this can fail,since qv_circs must contain the necessary attributes. Note that I wrote qobj = [assemble(t_qcs)] instead of qobj = assemble(t_qcs). If I do the latter I obtain

'QasmQobj' object is not iterable

EDIT:

Some information about the objects:

print(t_qcs)
[<qiskit.circuit.quantumcircuit.QuantumCircuit object at 0x7fa2398698a0>]
print(type(t_qcs))
<class 'list'>
ryanhill1
  • 2,623
  • 1
  • 11
  • 39
user2820579
  • 631
  • 4
  • 13

2 Answers2

2

By doing some error tracking, you'll find that

TypeError: 'QasmQobj' object is not iterable`

was raised from

IBMQJobManagerInvalidStateError: Pulse schedules found, but the backend does not support pulse schedules.

So your code was ok, it's just that the IBMQ Bogota backend doesn't support pulse schedules. Right now it appears that the only IBMQ QPU that does support pulse schedules is IBMQ Armonk:

>>> provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')
>>> for backend in provider.backends():
... config = backend.configuration()
... if config.open_pulse:
...     print(config.backend_name)
ibmq_armonk

IBMQ Armonk is a single-qubit device, so the qubit_lists and any other qubit-related parts of your code will have to be modified.

Good luck!

ryanhill1
  • 2,623
  • 1
  • 11
  • 39
2

As per Qiskit's release notes, under "IBM Q Provider 0.12.0"[1]

qiskit.providers.ibmq.IBMQBackend.run() method now takes one or more QuantumCircuit or Schedule. Use of QasmQobj and PulseQobj is now deprecated.

So, you shouldn't call assemble. Just pass the transpiled circuits to IBMQJobManager.run() method:

shots = 1000
for trial in range(ntrials):
    clear_output(wait=True)
    t_qcs = transpile(qv_circs[trial], backend=backend, initial_layout=qubit_lists)
job_manager = IBMQJobManager()
job_set_foo = job_manager.run(t_qcs, backend=backend, shots=shots, name='QV trial %d'%(trial))

print(job_set_foo.report(detailed=True)) print(f'Completed trial {trial+1}/{ntrials}')

I tested this code using the latest Qiskit version and it worked without any problem. The backend was ibmq_santiago (it is the backend returned by least_busy() function when I called it)

Egretta.Thula
  • 11,986
  • 1
  • 13
  • 34