Python API Documentation & Typing
@justinlietz is already working on this.
Since Nov 21, 2024.
- Dominant language
- C++
- Stars
- 117
- Forks
- 74
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 25
Description
Hi Nvidia team,
Thank you for open-sourcing this library, it's very exciting and I'm keen to try some QEC experiments with GPU acceleration!
I notice that the Python API part of the documentation has not been filled in: https://nvidia.github.io/cudaqx/api/qec/python_api.html
and also that the Python interface has no typing, which makes using it difficult as the IDE isn't able to help with the types of variables, or whether something is a function or a variable, and no hints for parameters are given when using functions. It would be awesome if this could be added :)
I'm trying to follow the example in the docs here: https://nvidia.github.io/cudaqx/components/qec/introduction.html#usage-example
and find that I'm getting an index error:
IndexError: index 0 is out of bounds for axis 0 with size 0
when running the following code:
code = qec.get_code("steane")
decoder = qec.get_decoder("single_error_lut", code.get_parity())
syndromes, data_qubit_results = qec.sample_memory_circuit(code, 10, 1)
result = decoder.decode(syndromes[0])
if result.converged:
print("Error locations:",
[i for i,p in enumerate(result.result) if p > 0.5])
It's possible I'm doing something silly, so do let me know if that's the case.
Thanks very much again for open-sourcing this, and I look forward to using it further.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.