diff --git a/.github/workflows/docs/conf.py b/.github/workflows/docs/conf.py index 4d0b97ef..c33a188d 100644 --- a/.github/workflows/docs/conf.py +++ b/.github/workflows/docs/conf.py @@ -8,6 +8,7 @@ extensions = [ "sphinx.ext.autodoc", + "sphinx_autodoc_typehints", "sphinx.ext.autosummary", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", @@ -36,10 +37,10 @@ pytketdoc_base = "https://tket.quantinuum.com/api-docs/" intersphinx_mapping = { - "https://docs.python.org/3/": None, - pytketdoc_base: None, - "https://qiskit.org/documentation/": None, - "http://docs.qulacs.org/en/latest/": None, + "python": ("https://docs.python.org/3/", None), + "pytket": (pytketdoc_base, None), + "qiskit": ("https://qiskit.org/documentation/", None), + "qulacs": ("http://docs.qulacs.org/en/latest/", None), } autodoc_member_order = "groupwise" diff --git a/.github/workflows/docs/requirements.txt b/.github/workflows/docs/requirements.txt index c8d2b6c4..cc5830a6 100644 --- a/.github/workflows/docs/requirements.txt +++ b/.github/workflows/docs/requirements.txt @@ -1,3 +1,4 @@ -sphinx >= 4.3.2, <6.2.0 +sphinx ~= 6.2 sphinx_book_theme >= 1.0.1, <2.0 sphinx-copybutton +sphinx-autodoc-typehints diff --git a/docs/api.rst b/docs/api.rst index c063b077..f7ebe38d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2,25 +2,30 @@ API documentation ~~~~~~~~~~~~~~~~~ .. autoclass:: pytket.extensions.qiskit.IBMQBackend - :special-members: + :special-members: __init__ + :show-inheritance: :members: .. autoclass:: pytket.extensions.qiskit.IBMQEmulatorBackend :special-members: __init__ + :show-inheritance: :members: .. autoclass:: pytket.extensions.qiskit.AerBackend :special-members: __init__ + :show-inheritance: :inherited-members: :members: .. autoclass:: pytket.extensions.qiskit.AerStateBackend :special-members: __init__ :inherited-members: + :show-inheritance: :members: .. autoclass:: pytket.extensions.qiskit.AerUnitaryBackend :special-members: __init__ + :show-inheritance: :inherited-members: :members: @@ -28,9 +33,13 @@ API documentation :members: qiskit_to_tk, tk_to_qiskit, process_characterisation .. automodule:: pytket.extensions.qiskit.tket_backend + :show-inheritance: :members: :special-members: __init__ +.. automodule:: pytket.extensions.qiskit.backends.crosstalk_model + :members: CrosstalkParams + .. automodule:: pytket.extensions.qiskit.tket_pass :special-members: __init__ diff --git a/pytket/extensions/qiskit/backends/crosstalk_model.py b/pytket/extensions/qiskit/backends/crosstalk_model.py index 8576928f..4d6b937c 100644 --- a/pytket/extensions/qiskit/backends/crosstalk_model.py +++ b/pytket/extensions/qiskit/backends/crosstalk_model.py @@ -40,7 +40,8 @@ @dataclass class FractionalUnitary: """ - Wrapper for a fractional unitary gate + Wrapper for a fractional unitary gate. + :param cmd: the fractional UnitaryBox wrapped in a pytket Command :param n_fractions: the number of fractional gates used to compose the original unitary gate. @@ -74,28 +75,20 @@ class CrosstalkParams: Stores various parameters for modelling crosstalk noise :param zz_crosstalks: symmetric crosstalks between qubit pairs - :type zz_crosstalks: `Dict[Tuple[Qubit, Qubit], float]` :param single_q_phase_errors: dict specify the single qubit phase error on each qubit - :type single_q_phase_errors: `Dict[Qubit, float]` :param two_q_induced_phase_errors: keys of dictionary specify the control and target qubit index, while the values are tuples with the spectator qubit index and the amount of phase error to be applied. - :type two_q_induced_phase_errors: `Dict[Tuple[Qubit, Qubit], Tuple[Qubit, float]]` :param non_markovian_noise: List storing the non-Markovian noise parameters. Each tuple in the list contains the qubit index and the zx, zz noise parameters. - :type non_markovian_noise: `List[Tuple[Qubit, float, float]]` :param virtual_z: If True, then don't break any single qubit Z gate into unitary fractions, instead add the full unitary. - :type bool :param N: hyperparameter specifies splices per second. 1/N must divide all gate times. - :type: float :param gate_times: python dict to store the gate time information. - :type gate_times: `Dict[Tuple[OpType, Tuple[Qubit, ...]], float]` :param phase_damping_error: dict specify amplitude phase damping error on each qubit - :type phase_damping_error: `Dict[Qubit, float]` :param amplitude_damping_error: dict pecify amplitude damping error on each qubit """ diff --git a/pytket/extensions/qiskit/backends/ibm.py b/pytket/extensions/qiskit/backends/ibm.py index b62c6b2b..85c1d7bf 100644 --- a/pytket/extensions/qiskit/backends/ibm.py +++ b/pytket/extensions/qiskit/backends/ibm.py @@ -449,12 +449,15 @@ def process_circuits( """ See :py:meth:`pytket.backends.Backend.process_circuits`. - Supported `kwargs`: - - `postprocess`: apply end-of-circuit simplifications and classical - postprocessing to improve fidelity of results (bool, default False) - - `simplify_initial`: apply the pytket ``SimplifyInitial`` pass to improve - fidelity of results assuming all qubits initialized to zero (bool, default - False) + :Keyword Arguments: + * `postprocess`: + apply end-of-circuit simplifications and classical + postprocessing to improve fidelity of results (bool, default False) + * `simplify_initial`: + apply the pytket ``SimplifyInitial`` pass to improve + fidelity of results assuming all qubits initialized to zero + (bool, default False) + """ circuits = list(circuits)