qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

Syntax error in SamplerV2 examples

Open rsatoh-c opened this issue 1 year ago • 1 comments

URL to the relevant documentation

https://docs.quantum.ibm.com/api/qiskit/primitives#overview-of-samplerv2

Select all that apply

  • [X] typo
  • [X] code bug
  • [ ] out-of-date content
  • [ ] broken link
  • [ ] other

Describe the fix.

In the example code, print functions have redundant parentheses and run is missing closing parenthesis.

print(f"The primitive-job finished with result {job_result}"))
 
# run a sampler job on the parameterized circuits
job2 = sampler.run([(pqc, theta1), (pqc2, theta2)]
job_result = job2.result()
print(f"The primitive-job finished with result {job_result}"))

rsatoh-c avatar May 01 '24 02:05 rsatoh-c

Hi @rsatoh-c! Looks like this issue should be posted in the qiskit/qiskit repo, which is where the API docs source files live: https://github.com/Qiskit/qiskit/issues/new?assignees=&labels=bug&projects=&template=BUG_REPORT.yaml - can you please open an issue there? Thanks, and I will close this issue here.

abbycross avatar May 01 '24 19:05 abbycross

Looks like this was fixed in https://github.com/Qiskit/qiskit/pull/12587

abbycross avatar Aug 26 '24 03:08 abbycross

Indeed, thanks for checking @abbycross!

Cryoris avatar Aug 26 '24 08:08 Cryoris