How to calibrate a qubit other than qubit 0?

I replicated successfully the qiskit tutorial (in a jupyter notebook using VSCode) found here: https://learn.qiskit.org/course/quantum-hardware-pulses/calibrating-qubits-using-qiskit-pulse

But when I tried to calibrate a different qubit (changing the line qubit = 0 to, say, qubit = 1, I get only background noise (ranging from -6.15 to -5.90 a.u.) instead of a nice peak (reaching around 2 a.u.) when plotting sweep_values. By the way, I don't know if this is important, I had to also change the line sweep_values.append(res[qubit]) to sweep_values.append(res[0]) because it was giving me an error (res is of size 1). This was on ibm_hanoi.

Why do I get only noise when switching to another qubit?

Did you modify this cell in section 2?

sweep_gate = Gate("sweep", 1, [freq])

qc_sweep = QuantumCircuit(1, 1)

qc_sweep.append(sweep_gate, [0])
qc_sweep.measure(0, 0)

# Create the frequency settings for the sweep (MUST BE IN HZ)
frequencies_Hz = frequencies_GHz*GHz
exp_sweep_circs = [qc_sweep.assign_parameters({freq: f}, inplace=False) for f in frequencies_Hz]


Try replacing it with this:

n_bits = backend_config.n_qubits
sweep_gate = Gate("sweep", 1, [freq])

qc_sweep = QuantumCircuit(n_bits, 1)

qc_sweep.append(sweep_gate, [qubit])
qc_sweep.measure(qubit, 0)

• That worked just fine, thanks a lot! They should change the tutorial, I think, as it gives the impression that all you have to do is change the line qubit = 0. May 13, 2023 at 1:24