Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API Documentation & Typing #5

Open
davidsbyfield opened this issue Nov 21, 2024 · 2 comments
Open

Python API Documentation & Typing #5

davidsbyfield opened this issue Nov 21, 2024 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@davidsbyfield
Copy link

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.

@amccaskey amccaskey added bug Something isn't working documentation Improvements or additions to documentation labels Nov 21, 2024
@amccaskey
Copy link
Collaborator

Hey @davidsbyfield. Thank you for submitting this issue, we're glad to see you are using the library!

The Python API docs should definitely not be empty, this is an oversight on our part and we'll get it fixed ASAP. There was a lot of churn in getting this repository stood up and the library released. I'm sure some wires got crossed somewhere.

As for your second bug there, we will triage this and get back to you shortly!

Early days here for CUDA-Q QEC. Lots more coming in the next couple months. We appreciate you trying this out.

@justinlietz
Copy link
Collaborator

Hi @davidsbyfield, thanks for pointing this out, we'll get this fixed ASAP. For now, there are a few complete examples in Python at https://nvidia.github.io/cudaqx/examples_rst/qec/examples.html which should give a good introduction to the APIs and how to use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants