Skip to content

What are "estimator_pub" and "sampler_pub?" #5217

@Seeker3005

Description

@Seeker3005

Environment

  • Qiskit version: 2.4.1
  • Python version: 3.12.3
  • Operating system: Windows 11 Home

What is happening?

I am getting an error when running the "Close a Batch" sample code in "Run jobs in a batch" (https://quantum.cloud.ibm.com/docs/en/guides/run-jobs-batch) because "estimator_pub" and "sampler_pub" are not defined.

How can we reproduce the issue?

Run the following code in a Jupyter Notebook:
with Batch(backend=backend) as batch:
estimator = Estimator()
sampler = Sampler()
job1 = estimator.run([estimator_pub])
job2 = sampler.run([sampler_pub])

The batch is no longer accepting jobs but the submitted job will run to completion.

result = job1.result()
result2 = job2.result()

What should happen?

You get an error saying "NameError: name 'estimator_pub' is not defined."

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    content 📄needs triage 🤔this issue is pending weekly prioritization by the docs team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions