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

Small doc formatting issues #10574

Merged
merged 18 commits into from
Sep 22, 2023
Merged

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Aug 4, 2023

Some small formatting issues in docstring found around.

@1ucian0 1ucian0 requested review from nonhermitian and a team as code owners August 4, 2023 19:16
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

@coveralls
Copy link

coveralls commented Aug 4, 2023

Pull Request Test Coverage Report for Build 5866793708

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 247 unchanged lines in 19 files lost coverage.
  • Overall coverage increased (+0.007%) to 87.251%

Files with Coverage Reduction New Missed Lines %
qiskit/exceptions.py 1 96.15%
qiskit/qasm2/init.py 2 93.33%
qiskit/qpy/exceptions.py 2 66.67%
crates/qasm2/src/lex.rs 3 91.39%
qiskit/transpiler/passes/utils/block_to_matrix.py 3 83.33%
qiskit/algorithms/amplitude_estimators/ae.py 4 93.94%
qiskit/circuit/init.py 4 84.85%
qiskit/transpiler/preset_passmanagers/builtin_plugins.py 4 97.04%
qiskit/transpiler/preset_passmanagers/level0.py 4 93.75%
qiskit/transpiler/preset_passmanagers/level1.py 4 96.49%
Totals Coverage Status
Change from base Build 5787606820: 0.007%
Covered Lines: 74292
Relevant Lines: 85147

💛 - Coveralls

label: optional gate label
ctrl_state: The control state in decimal or as a bitstring
(e.g. '111'). If None, use 2**num_ctrl_qubits-1.
(e.g. ``'111'``). If None, use 2**``num_ctrl_qubits``-1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nicer to also wrap the ** in code, since it's also Python syntax

Suggested change
(e.g. ``'111'``). If None, use 2**``num_ctrl_qubits``-1.
(e.g. ``'111'``). If None, use ``2**num_ctrl_qubits - 1``.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Things in this entry need another pass. Checked in a504bb0

@@ -17,7 +17,7 @@


def circuit_to_dag(circuit, copy_operations=True, *, qubit_order=None, clbit_order=None):
"""Build a ``DAGCircuit`` object from a ``QuantumCircuit``.
"""Build a :class:`~.DAGCircuit` object from a :class:`~.QuantumCircuit`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note, the leading ~ is not needed here as this simply truncates the path of the object. Since here there's no path, as you just used .<Object>, there's nothing to truncate (but it's not harmful afaik so no need to change) 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

qiskit/extensions/quantum_initializer/squ.py Outdated Show resolved Hide resolved
qiskit/circuit/gate.py Outdated Show resolved Hide resolved
@coveralls
Copy link

Pull Request Test Coverage Report for Build 5998056952

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.001%) to 87.281%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 91.65%
qiskit/pulse/library/waveform.py 3 93.75%
Totals Coverage Status
Change from base Build 5985235181: 0.001%
Covered Lines: 74286
Relevant Lines: 85111

💛 - Coveralls

qiskit/execute_function.py Outdated Show resolved Hide resolved
@1ucian0
Copy link
Member Author

1ucian0 commented Sep 14, 2023

Thanks for your comments, @Cryoris

I think I addressed them all.

Comment on lines 20 to 21
DAG (directed acyclic graph) Circuits
=====================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unusual to put the definition of an acronym in a title. Probably a bit better to say it as:

DAG Circuits

Quantum operations in the absence of control-flow operations can be represented by a directed acyclic graph (DAG).
...

or have the title as "Circuits as Directed Acyclic Graphs" and define the "DAG" acronym in the prose.

Copy link
Member Author

@1ucian0 1ucian0 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 430d0b3

"""Object to represent a quantum circuit as a directed acyclic graph
"""Object to represent a quantum circuit as a DAG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think using the full text here was clearer, but I don't feel strongly.

Copy link
Member Author

@1ucian0 1ucian0 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 16b75c7

Comment on lines 34 to 35
This function needs `pydot <https://github.com/erocarrera/pydot>`__, which in turn needs
`Graphviz <https://www.graphviz.org/>`__ to be installed.
This function needs `pydot <https://github.com/pydot/pydot>`_, which in turn needs
`Graphviz <https://www.graphviz.org/>`_ to be installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The double underscore is also fine here - the single creates a named hyperlink (so you could later use <Graphviz_> as if it was the URL and it'd alias the first one), while the double doesn't allow the re-use. The docs are here: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases.

No need to change anything here - both are fine - just pointing out that you don't need to worry about this in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always learning new things. reverting in c6af56c so the diff is cleaner.

jakelishman
jakelishman previously approved these changes Sep 18, 2023
qiskit/dagcircuit/dagdependency.py Outdated Show resolved Hide resolved
@jakelishman jakelishman added documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Sep 18, 2023
@jakelishman jakelishman added this pull request to the merge queue Sep 22, 2023
Merged via the queue into Qiskit:main with commit d3a6172 Sep 22, 2023
13 of 15 checks passed
mergify bot pushed a commit that referenced this pull request Sep 22, 2023
* small doc fixes

* more small changes

* Update qiskit/extensions/quantum_initializer/squ.py

Co-authored-by: Julien Gacon <[email protected]>

* improve gate docs

* Apply suggestions from code review

Co-authored-by: Julien Gacon <[email protected]>

* Update qiskit/converters/circuit_to_dag.py

* Update qiskit/execute_function.py

* Circuits as Directed Acyclic Graphs

* a quantum circuit as a Directed Acyclic Graphs (DAG

* __

* Fix errant plural

---------

Co-authored-by: Julien Gacon <[email protected]>
Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit d3a6172)
github-merge-queue bot pushed a commit that referenced this pull request Sep 22, 2023
* small doc fixes

* more small changes

* Update qiskit/extensions/quantum_initializer/squ.py

Co-authored-by: Julien Gacon <[email protected]>

* improve gate docs

* Apply suggestions from code review

Co-authored-by: Julien Gacon <[email protected]>

* Update qiskit/converters/circuit_to_dag.py

* Update qiskit/execute_function.py

* Circuits as Directed Acyclic Graphs

* a quantum circuit as a Directed Acyclic Graphs (DAG

* __

* Fix errant plural

---------

Co-authored-by: Julien Gacon <[email protected]>
Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit d3a6172)

Co-authored-by: Luciano Bello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants