I'm trying to make a calibration matrix using CompleteMeasFitter as in here on IBMQ Melbourne, but I need to use all 15 qubits, which mean it has to run 32768 calibration circuit, far exceeding the 75 limit of the deivce (It returns The number of experiments in the Qobj (32768) is higher than the number of experiments supported by the device (75) [1102].)

Is there any way for me to retrieve the mitigation matrix in this case? Maybe something IBM generates every time they calibrate the machine? Thank you!


1 Answer 1


I think in this case you can split the experiments into multiple jobs. The idea is that you split measurement calibration circuits generated by complete_meas_cal into a number of batches, execute the first batch and use the corresponding results to initialize a measurement correction fitter with CompleteMeasFitter. Then you can use the CompleteMeasFitter.add_data method to update the measurement correction fitter with the rest of calibration circuit batches. Finally, you will get the fitter you want. Here is a sample code for explanation. I use only four qubits for simplicity but this code can be generalized to 15 qubits for your case.

from qiskit import QuantumCircuit, execute, Aer, IBMQ
provider = IBMQ.get_provider(hub='ibm-q')
device = provider.get_backend('ibmq_16_melbourne')

from qiskit.ignis.mitigation.measurement import (complete_meas_cal,CompleteMeasFitter)
# Generate the calibration circuits
qr = qiskit.QuantumRegister(4)
meas_calibs, state_labels = complete_meas_cal(qr=qr, circlabel='mcal')

#Split calibration circuits into two batches
job1_res = qiskit.execute(meas_calibs[0:8], backend=device, shots=1024,optimization_level=0).result()
job2_res = qiskit.execute(meas_calibs[8:16], backend=device, shots=1024,optimization_level=0).result()

#Initialize the measurement correction fitter with the first 8 calibration circuits
meas_fitter = CompleteMeasFitter(job1_res, state_labels, circlabel='mcal')

enter image description here

#Update the measurement correction fitter with the second 8 calibration circuits

enter image description here

We create a circuit with four qubits, so we get 16 calibration circuits. we split them into two batches. As you can see, if we plot the calibration matrix after initializing the measurement correction fitter with the first batch of calibration circuits, it only shows a half calibration matrix. After we update the fitter with the last batch of calibration circuits, we can see the full calibration matrix.

I hope my answer would help.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.