Skip to content

Implementing estimator interface #145

Closed

Description

@doichanj

What should we add?

Qiskit C++ currently only has sampler interface to run circuit to get sampling bitstrings. Estimator interface is also demanding to get estimation on Pauli strings.

Implementing a BackendEstimatorV2 class as well as BackendSamplerV2 class
(https://github.com/Qiskit/qiskit-cpp/blob/main/src/primitives/backend_sampler_v2.hpp)
and implementing estimator.run() function that will accept an EstimatorPub class as well as SamplerPub (https://github.com/Qiskit/qiskit-cpp/blob/main/src/primitives/containers/sampler_pub.hpp)
An EstimatorPub will have ISA circuit and observables (see https://quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/estimator-v2)

estimator.run() function will return BackendEstimatorJob class as well as BackendSamplerJob class (https://github.com/Qiskit/qiskit-cpp/blob/main/src/primitives/backend_sampler_job.hpp) containing estimation values.

[added 9 June]
Using SparseObservable class for input pubs.

Implement Backend::run function that accepts std::vector<EstimatorPub> (at least for QRMI backend) to run as estimator program id.

Activity

  1. 1ucian0 commented on Jun 3, 2026

    @1ucian0
    Member
    ❗ From June 3rd to 17th, this issue is participating in the 6th edition of unitaryHACK more info...

    If you want to participate, please follow these guidelines:

    The winners will be announced on June 24th.

    Happy hacking!

  2. rosspeili commented on Jun 4, 2026

    @rosspeili

    Hey Jun Doi (@doichanj) opened a PR that addresses the issue, including ripple effects and complementary files, docs, code fixes that short the need for follow up PRs.

  3. jsaroni commented on Jun 4, 2026

    @jsaroni

    Hi Luciano Bello (@1ucian0), Jun Doi (@doichanj),
    Thank you for the check! I submitted the PR first complete with quickly passing test designs, did precision analyses from hardware runs that are often overlooked, and filing compliance that addressed the needed implementations. Please let me know if you have more feedback, I'm happy to discuss!

  4. Polarnova commented on Jun 7, 2026

    @Polarnova
  5. 1ucian0 commented on Jun 8, 2026

    @1ucian0
    Member

    Thank you to everyone who has submitted a PR for this issue! We currently have several promising fixes under review, so please hold off on submitting new PRs until the Qiskit team posts a follow-up comment here.

    We will review the existing submissions in due course. Thank you for your patience!

  6. doichanj commented on Jun 9, 2026

    @doichanj
    CollaboratorAuthor

    Thank you for submitting PR's for this PR but, I'm very sorry but I missed to add implementation guides in this issue.

    I added two instructions:

    • using SparseObservable class
    • implement backend::run function for a vector of EstimatorPub to run with estimator program id on IQP
  7. doichanj commented on Jun 9, 2026

    @doichanj
    CollaboratorAuthor

    I'm now reviewing #160 this PR well follows the instruction and work on the actual device

  8. rosspeili commented on Jun 9, 2026

    @rosspeili

    Thanks for adding the implementation notes Jun Doi (@doichanj) , that helped a lot. I have updated our branch to use SparseObservable and native BackendV2::run for EstimatorPub via QRMI (program_id = "estimator"). Looked at #160 while refactoring, and kept the same idea but dropped the sampler workaround and trimmed it to what was needed. Pushed on same branch/pr.

  9. added a commit that references this issue on Jun 9, 2026
  10. 1ucian0 commented on Jun 9, 2026

    @1ucian0
    Member

    Hi GoiBasia (@GoiBasia)

    Congratulations for getting the bounty! please comment in this issue so I can assign it to you.

  11. GoiBasia commented on Jun 9, 2026

    @GoiBasia
    Contributor

    Congratulations for getting the bounty! please comment in this issue so I can assign it to you.

    Thank you so much! I’m really glad I could be part of this and really enjoyed working on this quantum project. Let me know if you need any further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions