qiskit-community / qiskit-ignis

Ignis (deprecated) provides tools for quantum hardware verification, noise characterization, and error correction.
Apache License 2.0
167 stars 160 forks source link

CTMP mitigator crashes Jupyter notebook kernel #561

Closed nonhermitian closed 3 years ago

nonhermitian commented 3 years ago

Informations

What is the current behavior?

The CTMP mitigator crashes a Jupyter notebook kernel on the following circuit:

qubits=[14, 13, 11, 12, 16, 8, 15, 5, 18, 19, 3, 2, 22, 21, 25, 1]

qc = QuantumCircuit(27, len(qubits))
qc.h(14)
qc.cx(14, 13)
qc.cx(14, 11)
qc.cx(13, 12)
qc.cx(14, 16)
qc.cx(11, 8)
qc.cx(12, 15)
qc.cx(8, 5)
qc.cx(15, 18)
qc.cx(16, 19)
qc.cx(5, 3)
qc.cx(19, 22)
qc.cx(18, 21)
qc.cx(3, 2)
qc.cx(22, 25)
qc.cx(2, 1)
qc.measure(qubits, range(len(qubits)))

when targeting a 27Q system. Performing the mitigation using:

circuits2, metadata2 = expval_meas_mitigator_circuits(len(qubits), method='ctmp')
job_cal2 = execute(circuits2, backend, shots=8192, initial_layout=qubits)
result_cal2 = job_cal2.result()
ctmp_mitigator = ExpvalMeasMitigatorFitter(result_cal2, metadata2).fit()
ctmp_val = expectation_value(counts_noise, meas_mitigator=ctmp_mitigator)

crashes on the last line. Note that method='tensored' works correctly.

Steps to reproduce the problem

Try the above.

What is the expected behavior?

Does not crash.

Suggested solutions

There is no error given save for the kernel crashing modal window.

nonhermitian commented 3 years ago

A bit more work uncovered that the Killed return value is related to SIGKILL and that it is probably due to excessive memory consumption. Indeed, looking at the memory while running, it uses all 32Gb of memory and all my swap space before terminating.

chriseclectic commented 3 years ago

@nonhermitian Can you check if this is fixed by #563?

nonhermitian commented 3 years ago

Yep, that does it! thanks.