I'm running a couple of circuits at the same time using an array of variables. However, I met an issue regarding accessing the counts. Here's part of the code I have:
probsu = []
circuits = []
for i in range(len(Variable)):
circuit = QuantumCircuit(qrz,crz)
circuit = qc(Variable[i])
circuits.append(circuit)
prob = counts['1001'] / sum(counts.values()) **Issue here**
probsu.append(prob) **Issue here**
circuits = transpile(circuits, backend=backend)
job_manager = IBMQJobManager()
MyExperiments = job_manager. run(circuits, backend=backend, name='MyExperiment')
results = MyExperiments.results()
counts = results.get_counts(circuit)
I'm not able to get the counts since the line is referenced before the definition in the last line. However, there will be similar issues pop up if I remove the bottom lines before the for loop. How can I resolve this issue? Thanks:)