question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: Hyperlinks to QuTiP functions and classes

See original GitHub issue

It would be nice if the docstrings in QuTiP were well formatted, such that, when Sphinx builds the API and guidelines documentation, there are working link to QuTiP functions and classes. An example of working link is qutip.steadystate.steadystate in http://qutip.org/docs/latest/guide/guide-steady.html#steady-state-solvers-in-qutip

An example of working link in the API doc is options: qutip.solver.Options in the attributes of the HEOMSolver class http://qutip.org/docs/latest/apidoc/classes.html#non-markovian-solvers

A way to proceed would be to:

  1. reformat all instances in the docstrings of qutip/qutip such that they are in the form of :py:meth:mymodule.MyClass.mymethod, see https://stackoverflow.com/questions/22700606/how-would-i-cross-reference-a-function-generated-by-autodoc-in-sphinx

  2. Build the documentation with Sphinx to check that the change works and generates an active hyperlink in the relative html page of the documentation.

  3. Iterate 1) and 2) for instances in which Qobj or other QuTiP functions or classes are found.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
spinolinocommented, Jun 6, 2022

I just registered for the unitaryhack and saw this issue. I could have a look at it.

1reaction
nathanshammahcommented, Apr 6, 2019

An example is in the Dicke class of PIQS, the permutational invariant solver. The docstring says

Parameters: | N: int
The number of two-level systems.
hamiltonian: :class: qutip.Qobj
A Hamiltonian in the Dicke basis.The matrix dimensions are (nds, nds), with nds being the number of Dicke states. The Hamiltonian can be built with the operators given by the jspin functions.

Ideally, the hamiltonian specification as :class: qutip.Qobj should be a hyperlink. Formatting it correctly with :: and the correct spaces should make it work.

Another example is in the docstring of the basis(), and bell_state() functiona, which returns a state:qobj. This could point to the Qobj class.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classes — QuTiP 4.7 Documentation
The Qobj class is the QuTiP representation of quantum operators and state vectors. This class also implements math operations +,-,* between Qobj instances ......
Read more >
Basic Operations on Quantum Objects - QuTiP
In the rest of the documentation, functions are written using qutip.module.function() notation which links to the corresponding function in the QuTiP API: ...
Read more >
Classes — QuTiP 4.1 Documentation
Function to solve for an open quantum system using the HEOM model. Parameters: rho0 : Qobj. Initial state (density matrix) of the system....
Read more >
Classes — QuTiP 4.3 Documentation
A class for representing quantum objects, such as quantum operators and states. The Qobj class is the QuTiP representation of quantum operators ...
Read more >
Classes — QuTiP 4.4 Documentation
The Qobj class is the QuTiP representation of quantum operators and ... This function is identical to the qutip.qobj.ptrace function that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found