-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken docstrings in bindings and minor API docs updates (#920)
* fix RenameQubitsPass docs * try to fix ZZPhaseToRz, RoutingPass and CustomRoutingPass * try to fix RoundAngles * finally fix ZZPhaseToRz * fix spacing * fix RingArch and to_dict * fix QubitPauliString * fix spacing * fix spacing in ZZPhaseToRz * use sphinx-autodoc-typehints * fix broken getting_started links * fix mistake in ZZPhaseToRz docstring * use sphinx_autodoc_annotation again * update ZZPhaseToRz docstring * fix conf.py * fix duplicate link warning * update pytket.qasm docs * minor wording * remove extra lines from pytket.qasm docs * more pytket.qasm edits * use half-turns instead of radians * fix Bit.to_list() docstring * fix minor formatting issues in pytket.placement and pytket.zx
- Loading branch information
Showing
9 changed files
with
50 additions
and
34 deletions.
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
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 |
---|---|---|
@@ -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 |