Open AlanThinks opened 2 weeks ago
In the notebook B1 | First Steps into... , in the last code cell
B1 | First Steps into...
last code cell
counts_sample=results_sampler[0].data.meas.get_counts() There is no variable results_sampler
counts_sample=results_sampler[0].data.meas.get_counts()
results_sampler
results_counts[0]
result[0]
result
It still won't work because it's calling the wrong method on the wrong type of object SamplerPubResult and/or DataBin, not sure.
SamplerPubResult
DataBin
result.data returns a DataBin object, which does not have a meas or get_counts method
result.data
meas
get_counts
Ref:
@MiamiQuantumFest
install needed for visualization: %pip install qiskit[visualization] matplotlib
Get and plot the results: result = job.result() counts_sampler = result[0].data.c.get_counts()
result = job.result() counts_sampler = result[0].data.c.get_counts()
In the notebook
B1 | First Steps into...
, in thelast code cell
counts_sample=results_sampler[0].data.meas.get_counts()
There is no variableresults_sampler
results_counts[0]
toresult[0]
, or simplyresult
depending on the object being returnedIt still won't work because it's calling the wrong method on the wrong type of object
SamplerPubResult
and/orDataBin
, not sure.result.data
returns a DataBin object, which does not have ameas
orget_counts
methodRef: