Add details on the C API to the project README#16192
Conversation
|
One or more of the following people are relevant to this code:
|
255a331 to
6aa3e29
Compare
Arguably the largest development in Qiskit since the 2.0.0 release was the introduction of the C API. This changed how Qiskit is consumable from solely via Python to any environment that can use a C shared library. This expanded the scope and potential user base of Qiskit quite substantially. However, a clear oversight was that the C API is not at all mentioned in the README. This corrects the oversight and adds an explanation that the two public APIs are for Python and C and also installation instructions for the standalone C API.
6aa3e29 to
6e7a29f
Compare
Coverage Report for CI Build 26042851897Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage decreased (-0.01%) to 87.698%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions47 previously-covered lines in 5 files lost coverage.
Coverage Stats
💛 - Coveralls |
| @@ -32,6 +39,22 @@ Pip will handle all dependencies automatically and you will always install the l | |||
|
|
|||
| To install from source, follow the instructions in the [documentation](https://quantum.cloud.ibm.com/docs/guides/install-qiskit-source). | |||
|
|
|||
| ### Standalone C library | |||
|
|
|||
| To install Qiskit as a standalone C library the only option is currently to build Qiskit from source. This requires having the | |||
| [Rust](https://rust-lang.org/) compiler installed. To simplify building having [GNU Make](https://www.gnu.org/software/make/) installed | |||
| is recommended. With these requirements installed you can run: | |||
|
|
|||
| ```bash | |||
| make c | |||
| ``` | |||
|
|
|||
| Which will compile the C library and put the `dist/c` directory in the root of the repository which will contain the shared library and C headers for | |||
| library. | |||
|
|
|||
| You can refer to the [documentation](https://quantum.cloud.ibm.com/docs/en/guides/install-c-api) on installing the C API for more details and how to | |||
| use the built library. | |||
|
|
|||
There was a problem hiding this comment.
Is your intention to change this once we've sorted out the distribution story for C? It's a bit weird having such a large asymmetry.
Even within that: perhaps we should just link to the canonical "build from source" instructions for C in the contributing guide, rather than duplicating them (and the requirements) on the main landing page.
There was a problem hiding this comment.
Yeah, I wanted to make sure we had some instructions for the time being. But once we have a better distribution story that would replace this and we can just link to the build from source instruction.
Co-authored-by: Jake Lishman <jake@binhbar.com>
jakelishman
left a comment
There was a problem hiding this comment.
I still think we've slightly overdone the "build from source" detail in the "install the C API" section of the README, but I'm not that bothered since we intend to change it once we've got distributable artifacts anyway.
…#16209) * Add details on the C API to the project README Arguably the largest development in Qiskit since the 2.0.0 release was the introduction of the C API. This changed how Qiskit is consumable from solely via Python to any environment that can use a C shared library. This expanded the scope and potential user base of Qiskit quite substantially. However, a clear oversight was that the C API is not at all mentioned in the README. This corrects the oversight and adds an explanation that the two public APIs are for Python and C and also installation instructions for the standalone C API. * Update README.md * Simplify wording about C API usage modes * Add sentence to examples section saying explicitly that we're using python * Only use the minor version * Remove locale --------- (cherry picked from commit 1680baf) Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Jake Lishman <jake@binhbar.com>
Arguably the largest development in Qiskit since the 2.0.0 release was the introduction of the C API. This changed how Qiskit is consumable from solely via Python to any environment that can use a C shared library. This expanded the scope and potential user base of Qiskit quite substantially. However, a clear oversight was that the C API is not at all mentioned in the README. This corrects the oversight and adds an explanation that the two public APIs are for Python and C and also installation instructions for the standalone C API.
AI/LLM disclosure