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

Add matrix representation of gates to docstrings #597

Closed
kshitijc opened this issue Jul 5, 2023 · 4 comments
Closed

Add matrix representation of gates to docstrings #597

kshitijc opened this issue Jul 5, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@kshitijc
Copy link
Contributor

kshitijc commented Jul 5, 2023

What did you find confusing? Please describe.
The documentation for the supported gates don't sufficiently describe the action of these gates or how each of the parameters are used.

Describe how documentation can be improved
The docstring for each gate implemented here should show the matrix representation of the gate.

Additional context

@kshitijc kshitijc added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 5, 2023
@AbeCoull
Copy link
Contributor

AbeCoull commented Jul 6, 2023

As a point of discussion for the issue, it would seem to make sense to have the docstrings using the math directive so the matrices render correctly in the docs.

@speller26
Copy link
Member

For reference, look at how gate matrices are written in the PennyLane plugin

@rmshaffer
Copy link
Contributor

rmshaffer commented Sep 18, 2023

Related: Each gate currently has documentation generated in three separate places, none of which are particularly useful in terms of telling what the gate or its parameters do. For example, CPhaseShift is documented in these three places:

  1. https://amazon-braket-sdk-python.readthedocs.io/en/stable/_apidoc/braket.circuits.gate.html#braket.circuits.gate.Gate.CPhaseShift
  2. https://amazon-braket-sdk-python.readthedocs.io/en/stable/_apidoc/braket.circuits.gates.html#braket.circuits.gates.CPhaseShift
  3. https://amazon-braket-sdk-python.readthedocs.io/en/stable/_apidoc/braket.circuits.circuit.html#braket.circuits.circuit.Circuit.cphaseshift

Arguably the 3rd one is what users would look up first (if they are calling the gate methods via the Circuit class), and this is likely the least helpful one.

Maybe this should be a separate issue (I'm happy to create a new issue if desired, just let me know) but I wanted to mention it.

@ykharkov
Copy link
Member

Closing the issue, since the PR addressing the issue was merged: #756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants