This code is experimental and its API may change without prior warning. Use it at your own risk.
Qiskit C++ provides a modern C++ (version C++ 11 or later) interface of Qiskit for circuit building, transpilation, sampler jobs, and QRMI-backed estimator jobs, as same as Qiskit Python interfaces. This interface is based on Qiskit C-API introduced in Qiskit 2.1.
Linux AlmaLinux 9 Amazon Linux 2023 RedHat Enterprise Linux 8 RedHat Enterprise Linux 9 SuSE 15 Ubuntu 22.04 Ubuntu 24.04
RedHat Enterprise Linux 8
RedHat Enterprise Linux 9
macOS Sequoia 15.1 or above
Sequoia 15.1 or above
Preparing Qiskit and Qiskit C extension
Before building Qiskit C++, install Qiskit 2.2 or later and build Qiskit C extension library
Preparing Interface API to Quantum hardware
Qiskit C++ requires one of the following APIs to access IBM Quantum Platform to run the quantum circuits.
qiskit-ibm-runtime C ( )
QRMI ( )
SQC 0.10.0 ( )
Before building your application with Qiskit C++, build one of these APIs.
If you want to use QRMI, build as following.
If you want to use qiskit-ibm-runtime C, build as following. (Note, qiskit-ibm-runtime C is an early prototype so build method may be changed)
If you want to use SQC C API , follow the SQC documentation . Basically, SQC is pre-built and available in the environment, and thus you only need to set up authentication credentials (JWT token) and environment variables based on the provided scripts.
Qiskit C++ only has C++ header files. There is nothing to do to build the SDK.
Examples are available in this directory .
To build application using Qiskit C++, add path to Qiskit C-API, include path to qiskit.h (installed in dist/c/include ) and library libqiskit.so (installed in dist/c/lib ) or qiskit_cext.dll.lib (generated in target/release ) for Windows. See ./samples/CMakeLists.txt for example to make test program.
If you want to build sampler or transpiler example, you will need one of qiskit-ibm-runtime C or QRMI or SQC. The estimator example currently requires QRMI.
Then example can be built by setting QISKIT_IBM_RUNTIME_C_ROOT or QRMI_ROOT or SQC_ROOT to cmake.
To run sampler example, set your account information in $ /.qiskit/qiskit-ibm.json (see ) or setting following environment variables to access Quantum hardware.
The estimator interface is available through primitives::BackendEstimatorV2 and currently requires QRMI or another backend that implements BackendV2::run(std::vector &, double) . Estimator PUB circuits must be unmeasured and can use Pauli labels, Pauli-label maps, Pauli term vectors, or quantum_info::SparseObservable inputs. Empty observables are rejected before backend submission, and malformed estimator result cardinality is rejected while reading provider results. Estimator job cancellation is not currently supported, so BackendEstimatorJob::cancel() returns false .
To run the sample example with SQC, you also need to set the library options to the environment variable SQC_LIBS , which is automatically set by a provided script (see here ), before running cmake. In SQC 0.10.0, backend_setup.sh configures SQC_LIBS as follows:
See tutorial for more examples.
Making your own interface to Quantum hardware
Qiskit C++ offers an abstract interface to access Quantum hardware. You can make your own interface to the hardware by overriding providers::Job and providers::BackendV2 and make your own service provider to make backend object like service::QiskitRuntimeService class. Refer to ./src/providers/qrmi_backend.hpp and ./src/providers/qrmi_job.hpp for details.
Regardless if you are part of the core team or an external contributor, welcome and thank you for contributing to Qiskit C++
Contributor must add test cases under ./test directory if you have added new features to Qiskit C++. Also all the test cases running on the github repository should be passed.
Checking API document
Contributor can generate API document from source.
API document will be created under html directory.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
