iqm-finland / qiskit-on-iqm

Qiskit adapter for IQM's quantum computers
https://iqm-finland.github.io/qiskit-on-iqm/
Apache License 2.0
18 stars 6 forks source link

Jobs timing out #108

Closed ahojukka5 closed 2 weeks ago

ahojukka5 commented 1 month ago

I get APITimeoutError: The job didn't finish in 900 seconds.

By looking here (https://github.com/iqm-finland/iqm-client/blob/main/src/iqm/iqm_client/iqm_client.py#L433), timeout_secs is defined to be DEFAULT_TIMEOUT_SECONDS, but there's no way to control that argument from qiskit_iqm: (https://github.com/iqm-finland/qiskit-on-iqm/blob/main/src/iqm/qiskit_iqm/iqm_job.py#L130).

APITimeoutError raises when the number of circuits and shots is big enough (64 circuits with 16384 shots is enough).

Aerylia commented 1 month ago

Thank you for pointing out this feature discrepancy between iqm_client and qiskit_iqm's IQMJob. It has been added to our backlog (SW-381).

For now, the workaround is to use the IQMClient class directly and using submit_circuits(). This gives a job_id that you can use to construct the IQMJob using the backend and this job_id. You can make the Qiskit QuantumCircuit object into an iqm_client Circuit object using backend.serialize_circuit(circuit). You might need to pass a qubit_mapping dict to make sure that the qubit names in the circuit fit those of the device. For example:

client = IQMClient(url="your url", **some_user_auth_kwargs)
job_id = client.submit_circuits([backend.serialize_circuit(circuit)], qubit_mapping={'1': "QB1", '2': "QB2"})
job = IQMJob(backend, job_id)