-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix broken docstrings in bindings and minor API docs updates #920
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6da46b0
fix RenameQubitsPass docs
CalMacCQ e1244c2
try to fix ZZPhaseToRz, RoutingPass and CustomRoutingPass
CalMacCQ cc955c5
Merge branch 'develop' into fix/round_angles
CalMacCQ 820e72f
Merge branch 'develop' into fix/round_angles
CalMacCQ 00ac411
Merge branch 'fix/round_angles' of github.com:CQCL/tket into fix/roun…
CalMacCQ d3f69a0
try to fix RoundAngles
CalMacCQ 0976cdd
finally fix ZZPhaseToRz
CalMacCQ fe50e09
fix spacing
CalMacCQ 7a00e59
Merge branch 'develop' into fix/round_angles
CalMacCQ c142330
fix RingArch and to_dict
CalMacCQ e6b9213
fix QubitPauliString
CalMacCQ e5fbf5f
fix spacing
CalMacCQ 233c184
fix spacing in ZZPhaseToRz
CalMacCQ 20eaf62
use sphinx-autodoc-typehints
CalMacCQ e9b478a
Merge branch 'fix/round_angles' of github.com:CQCL/tket into fix/roun…
CalMacCQ a5c3df4
fix broken getting_started links
CalMacCQ 98aed47
fix mistake in ZZPhaseToRz docstring
CalMacCQ 3d676e6
use sphinx_autodoc_annotation again
CalMacCQ 6ff580c
update ZZPhaseToRz docstring
CalMacCQ 9458e3c
fix conf.py
CalMacCQ 38e4cbf
fix duplicate link warning
CalMacCQ 02ea72c
Merge branch 'develop' into fix/round_angles
CalMacCQ 35c5741
update pytket.qasm docs
CalMacCQ d227dc5
minor wording
CalMacCQ e1415dd
remove extra lines from pytket.qasm docs
CalMacCQ b354c4c
more pytket.qasm edits
CalMacCQ d7244b9
use half-turns instead of radians
CalMacCQ 6d1fa51
fix Bit.to_list() docstring
CalMacCQ c258c77
fix minor formatting issues in pytket.placement and pytket.zx
CalMacCQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ Example usage: | |
from pytket.circuit.display import get_circuit_renderer | ||
|
||
circuit_renderer = get_circuit_renderer() # Instantiate a circuit renderer | ||
circuit_renderer.set_render_options(zx_style=False) # Configure render options | ||
circuit_renderer.set_render_options(zx_style=True) # Configure render options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because the renderer no longer uses ZX by default |
||
circuit_renderer.condense_c_bits = False # You can also set the properties on the instance directly | ||
print("Render options:") | ||
print(circuit_renderer.get_render_options()) # View currently set render options | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ This prints out a summary of readouts (the final values of the classical bits) a | |
|
||
Each pytket :py:class:`Backend` comes with its own default compilation method. This is a recommended sequence of optimisation passes to meet the requirements of the specific :py:class:`Backend`. | ||
|
||
The following code snippet will show how to compile a circuit to run on an IBM device. This requires setting up IBM credentials (see `this page <https://cqcl.github.io/pytket-qiskit/api/index.html#access-and-credentials>`). | ||
The following code snippet will show how to compile a circuit to run on an IBM device. This requires setting up IBM credentials (see the `credentials guide <https://cqcl.github.io/pytket-qiskit/api/index.html#access-and-credentials>`_). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed this to avoid the duplicate link labelled "this page". Fixes a sphinx warning |
||
|
||
:: | ||
|
||
|
@@ -106,7 +106,7 @@ The following code snippet will show how to compile a circuit to run on an IBM d | |
compiled_circ = belem_device.get_compiled_circuit(circ) | ||
result = backend.run_circuit(compiled_circ, n_shots=100) | ||
|
||
Here the default compilation pass is applied by :py:meth:`IBMQBackend.get_compiled_circuit`. See `this page <https://cqcl.github.io/pytket-qiskit/api/index.html>`_ for more details. | ||
Here the default compilation pass is applied by :py:meth:`IBMQBackend.get_compiled_circuit`. See `this page <https://cqcl.github.io/pytket-qiskit/api/index.html#default-compilation>`_ for more details. | ||
|
||
As an alternative, We can experiment with constructing our own circuit compilation routines in pytket. Passes from the :py:mod:`pytket.passes` module can be applied individually or composed in sequence. | ||
See the section of the user manual on `circuit compilation <https://cqcl.github.io/pytket/manual/manual_compiler.html>`_ and the corresponding `notebook example <https://github.com/CQCL/pytket/blob/main/examples/compilation_example.ipynb>`_ for more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
pytket.qasm | ||
================================== | ||
:py:class:`Circuit` objects can be converted to and from OpenQASM, although we do not support all operations. | ||
In particular, we do not currently support: | ||
|
||
1) Importing from libraries other than "qelib1" | ||
2) Ability to interpret gates acting on a whole register in the OpenQASM style | ||
However, we do support symbolic parameters of gates, both on import and export. | ||
|
||
Any pytket :py:class:`Circuit` that is exported to this format should be valid for importing again as a :py:class:`Circuit`, making this a convenient file format | ||
Any pytket :py:class:`Circuit` that is exported to OpenQASM format with ``pytket.qasm`` should be valid for importing again as a :py:class:`Circuit`, making this a convenient file format | ||
to save your :py:class:`Circuit` objects. | ||
|
||
However, we do support symbolic parameters of gates, both on import and export. | ||
In addition to the default ``qelib1`` qasm header, the ``hqslib1`` header is also supported. | ||
We can set the ``header`` argument in the qasm conversion functions as follows. | ||
|
||
:: | ||
|
||
from pytket.qasm import circuit_to_qasm_str | ||
|
||
qasm_str = circuit_to_qasm_str(circ, header="hqslib1") | ||
|
||
.. note:: Unlke pytket backends the qasm converters do not handle `implicit qubit permutations <https://cqcl.github.io/pytket/manual/manual_circuit.html#implicit-qubit-permutations>`_ . In other words if a circuit containing an implicit qubit permutation is converted to a qasm file the implicit permutation will not be accounted for and the circuit will be missing this permutation when reimported. | ||
.. note:: Unlike pytket backends, the qasm converters do not handle `implicit qubit permutations <https://cqcl.github.io/pytket/manual/manual_circuit.html#implicit-qubit-permutations>`_. In other words if a circuit containing an implicit qubit permutation is converted to a qasm file the implicit permutation will not be accounted for and the circuit will be missing this permutation when reimported. | ||
|
||
.. automodule:: pytket.qasm | ||
:members: circuit_from_qasm, circuit_from_qasm_wasm, circuit_to_qasm, circuit_from_qasm_str, circuit_to_qasm_str, circuit_from_qasm_io, circuit_to_qasm_io |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't actually see what the problem was with this one.