diff --git a/docs/conf.py b/docs/conf.py index 172da360265d..9dfbb3f73fcf 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,8 +57,13 @@ pygments_style = "colorful" -# Whether module names are included in crossrefs of functions, classes, etc. -add_module_names = False +# This adds the module name to e.g. function API docs. We use the default of True because our +# module pages sometimes have functions from submodules on the page, and we want to make clear +# that you must include the submodule to import it. We should strongly consider reorganizing our +# code to avoid this, i.e. re-exporting the submodule members from the top-level module. Once fixed +# and verified by only having a single `.. currentmodule::` in the file, we can turn this back to +# False. +add_module_names = True # A list of prefixes that are ignored for sorting the Python module index # (e.g., if this is set to ['foo.'], then foo.bar is shown under B, not F). diff --git a/qiskit/algorithms/__init__.py b/qiskit/algorithms/__init__.py index 3ee911b9c1c4..18767f1fdd01 100644 --- a/qiskit/algorithms/__init__.py +++ b/qiskit/algorithms/__init__.py @@ -280,23 +280,7 @@ Exceptions ---------- -.. autosummary:: - :toctree: ../stubs/ - - AlgorithmError - - -Utility methods ---------------- - -Utility methods used by algorithms. - -.. autosummary:: - :toctree: ../stubs/ - - eval_observables - estimate_observables - +.. autoexception:: AlgorithmError Utility classes --------------- @@ -308,6 +292,14 @@ AlgorithmJob +Utility functions +----------------- + +Utility functions used by algorithms. + +.. autofunction:: eval_observables +.. autofunction:: estimate_observables + """ import warnings diff --git a/qiskit/assembler/__init__.py b/qiskit/assembler/__init__.py index ee4dfa7e2196..a356501a263c 100644 --- a/qiskit/assembler/__init__.py +++ b/qiskit/assembler/__init__.py @@ -20,26 +20,17 @@ Circuit Assembler ================= -.. autosummary:: - :toctree: ../stubs/ - - assemble_circuits +.. autofunction:: assemble_circuits Schedule Assembler ================== -.. autosummary:: - :toctree: ../stubs/ - - assemble_schedules +.. autofunction:: assemble_schedules Disassembler ============ -.. autosummary:: - :toctree: ../stubs/ - - disassemble +.. autofunction:: disassemble RunConfig ========= diff --git a/qiskit/circuit/__init__.py b/qiskit/circuit/__init__.py index 7c0548db797a..079ead121c85 100644 --- a/qiskit/circuit/__init__.py +++ b/qiskit/circuit/__init__.py @@ -345,10 +345,9 @@ Random Circuits --------------- -.. autosummary:: - :toctree: ../stubs/ - - random.random_circuit +.. currentmodule:: qiskit.circuit.random +.. autofunction:: random_circuit +.. currentmodule:: qiskit.circuit """ from .quantumcircuit import QuantumCircuit from .classicalregister import ClassicalRegister, Clbit diff --git a/qiskit/circuit/library/__init__.py b/qiskit/circuit/library/__init__.py index 4d530fc79ca5..2e3637924dab 100644 --- a/qiskit/circuit/library/__init__.py +++ b/qiskit/circuit/library/__init__.py @@ -394,98 +394,91 @@ Techniques for the synthesis of reversible Toffoli networks, 2007 http://dx.doi.org/10.1145/1278349.1278355 -.. autosummary:: - :toctree: ../stubs/ - - templates.nct.template_nct_2a_1 - templates.nct.template_nct_2a_2 - templates.nct.template_nct_2a_3 - templates.nct.template_nct_4a_1 - templates.nct.template_nct_4a_2 - templates.nct.template_nct_4a_3 - templates.nct.template_nct_4b_1 - templates.nct.template_nct_4b_2 - templates.nct.template_nct_5a_1 - templates.nct.template_nct_5a_2 - templates.nct.template_nct_5a_3 - templates.nct.template_nct_5a_4 - templates.nct.template_nct_6a_1 - templates.nct.template_nct_6a_2 - templates.nct.template_nct_6a_3 - templates.nct.template_nct_6a_4 - templates.nct.template_nct_6b_1 - templates.nct.template_nct_6b_2 - templates.nct.template_nct_6c_1 - templates.nct.template_nct_7a_1 - templates.nct.template_nct_7b_1 - templates.nct.template_nct_7c_1 - templates.nct.template_nct_7d_1 - templates.nct.template_nct_7e_1 - templates.nct.template_nct_9a_1 - templates.nct.template_nct_9c_1 - templates.nct.template_nct_9c_2 - templates.nct.template_nct_9c_3 - templates.nct.template_nct_9c_4 - templates.nct.template_nct_9c_5 - templates.nct.template_nct_9c_6 - templates.nct.template_nct_9c_7 - templates.nct.template_nct_9c_8 - templates.nct.template_nct_9c_9 - templates.nct.template_nct_9c_10 - templates.nct.template_nct_9c_11 - templates.nct.template_nct_9c_12 - templates.nct.template_nct_9d_1 - templates.nct.template_nct_9d_2 - templates.nct.template_nct_9d_3 - templates.nct.template_nct_9d_4 - templates.nct.template_nct_9d_5 - templates.nct.template_nct_9d_6 - templates.nct.template_nct_9d_7 - templates.nct.template_nct_9d_8 - templates.nct.template_nct_9d_9 - templates.nct.template_nct_9d_10 +.. currentmodule:: qiskit.circuit.library.templates.nct +.. autofunction:: template_nct_2a_1 +.. autofunction:: template_nct_2a_2 +.. autofunction:: template_nct_2a_3 +.. autofunction:: template_nct_4a_1 +.. autofunction:: template_nct_4a_2 +.. autofunction:: template_nct_4a_3 +.. autofunction:: template_nct_4b_1 +.. autofunction:: template_nct_4b_2 +.. autofunction:: template_nct_5a_1 +.. autofunction:: template_nct_5a_2 +.. autofunction:: template_nct_5a_3 +.. autofunction:: template_nct_5a_4 +.. autofunction:: template_nct_6a_1 +.. autofunction:: template_nct_6a_2 +.. autofunction:: template_nct_6a_3 +.. autofunction:: template_nct_6a_4 +.. autofunction:: template_nct_6b_1 +.. autofunction:: template_nct_6b_2 +.. autofunction:: template_nct_6c_1 +.. autofunction:: template_nct_7a_1 +.. autofunction:: template_nct_7b_1 +.. autofunction:: template_nct_7c_1 +.. autofunction:: template_nct_7d_1 +.. autofunction:: template_nct_7e_1 +.. autofunction:: template_nct_9a_1 +.. autofunction:: template_nct_9c_1 +.. autofunction:: template_nct_9c_2 +.. autofunction:: template_nct_9c_3 +.. autofunction:: template_nct_9c_4 +.. autofunction:: template_nct_9c_5 +.. autofunction:: template_nct_9c_6 +.. autofunction:: template_nct_9c_7 +.. autofunction:: template_nct_9c_8 +.. autofunction:: template_nct_9c_9 +.. autofunction:: template_nct_9c_10 +.. autofunction:: template_nct_9c_11 +.. autofunction:: template_nct_9c_12 +.. autofunction:: template_nct_9d_1 +.. autofunction:: template_nct_9d_2 +.. autofunction:: template_nct_9d_3 +.. autofunction:: template_nct_9d_4 +.. autofunction:: template_nct_9d_5 +.. autofunction:: template_nct_9d_6 +.. autofunction:: template_nct_9d_7 +.. autofunction:: template_nct_9d_8 +.. autofunction:: template_nct_9d_9 +.. autofunction:: template_nct_9d_10 +.. currentmodule:: qiskit.circuit.library Clifford template circuits -------------------------- Template circuits over Clifford gates. -.. autosummary:: - :toctree: ../stubs/ - - clifford_2_1 - clifford_2_2 - clifford_2_3 - clifford_2_4 - clifford_3_1 - clifford_4_1 - clifford_4_2 - clifford_4_3 - clifford_4_4 - clifford_5_1 - clifford_6_1 - clifford_6_2 - clifford_6_3 - clifford_6_4 - clifford_6_5 - clifford_8_1 - clifford_8_2 - clifford_8_3 +.. autofunction:: clifford_2_1 +.. autofunction:: clifford_2_2 +.. autofunction:: clifford_2_3 +.. autofunction:: clifford_2_4 +.. autofunction:: clifford_3_1 +.. autofunction:: clifford_4_1 +.. autofunction:: clifford_4_2 +.. autofunction:: clifford_4_3 +.. autofunction:: clifford_4_4 +.. autofunction:: clifford_5_1 +.. autofunction:: clifford_6_1 +.. autofunction:: clifford_6_2 +.. autofunction:: clifford_6_3 +.. autofunction:: clifford_6_4 +.. autofunction:: clifford_6_5 +.. autofunction:: clifford_8_1 +.. autofunction:: clifford_8_2 +.. autofunction:: clifford_8_3 RZXGate template circuits ------------------------- Template circuits with :class:`~qiskit.circuit.library.RZXGate`. -.. autosummary:: - :toctree: ../stubs/ - - rzx_yz - rzx_xz - rzx_cy - rzx_zz1 - rzx_zz2 - rzx_zz3 +.. autofunction:: rzx_yz +.. autofunction:: rzx_xz +.. autofunction:: rzx_cy +.. autofunction:: rzx_zz1 +.. autofunction:: rzx_zz2 +.. autofunction:: rzx_zz3 """ diff --git a/qiskit/compiler/__init__.py b/qiskit/compiler/__init__.py index fd6429260db4..4974fe68a4cd 100644 --- a/qiskit/compiler/__init__.py +++ b/qiskit/compiler/__init__.py @@ -20,13 +20,10 @@ Circuit and Pulse Compilation Functions ======================================= -.. autosummary:: - :toctree: ../stubs/ - - assemble - schedule - transpile - sequence +.. autofunction:: assemble +.. autofunction:: schedule +.. autofunction:: transpile +.. autofunction:: sequence """ diff --git a/qiskit/converters/__init__.py b/qiskit/converters/__init__.py index 2e7c0a9092f0..afac4cd2231f 100644 --- a/qiskit/converters/__init__.py +++ b/qiskit/converters/__init__.py @@ -17,18 +17,15 @@ .. currentmodule:: qiskit.converters -.. autosummary:: - :toctree: ../stubs/ - - circuit_to_dag - dag_to_circuit - circuit_to_instruction - circuit_to_gate - ast_to_dag - dagdependency_to_circuit - circuit_to_dagdependency - dag_to_dagdependency - dagdependency_to_dag +.. autofunction:: circuit_to_dag +.. autofunction:: dag_to_circuit +.. autofunction:: circuit_to_instruction +.. autofunction:: circuit_to_gate +.. autofunction:: ast_to_dag +.. autofunction:: dagdependency_to_circuit +.. autofunction:: circuit_to_dagdependency +.. autofunction:: dag_to_dagdependency +.. autofunction:: dagdependency_to_dag """ from .circuit_to_dag import circuit_to_dag diff --git a/qiskit/opflow/__init__.py b/qiskit/opflow/__init__.py index 9551dd3f318b..babed3da26b5 100644 --- a/qiskit/opflow/__init__.py +++ b/qiskit/opflow/__init__.py @@ -149,21 +149,15 @@ Utility functions ================= -.. autosummary:: - :toctree: ../stubs/ - - commutator - anti_commutator - double_commutator +.. autofunction:: commutator +.. autofunction:: anti_commutator +.. autofunction:: double_commutator Exceptions ========== -.. autosummary:: - :toctree: ../stubs/ - - OpflowError +.. autoexception:: OpflowError """ import warnings diff --git a/qiskit/providers/__init__.py b/qiskit/providers/__init__.py index e581c9721fe0..7b1ef8527049 100644 --- a/qiskit/providers/__init__.py +++ b/qiskit/providers/__init__.py @@ -125,13 +125,10 @@ Exceptions ---------- -.. autosummary:: - :toctree: ../stubs/ - - QiskitBackendNotFoundError - BackendPropertyError - JobError - JobTimeoutError +.. autoexception:: QiskitBackendNotFoundError +.. autoexception:: BackendPropertyError +.. autoexception:: JobError +.. autoexception:: JobTimeoutError ====================== Writing a New Provider diff --git a/qiskit/pulse/__init__.py b/qiskit/pulse/__init__.py index 07ebcba99b7b..d8c42734cebf 100644 --- a/qiskit/pulse/__init__.py +++ b/qiskit/pulse/__init__.py @@ -54,7 +54,7 @@ Exceptions ========== -.. autoclass:: PulseError +.. autoexception:: PulseError """ # Builder imports. diff --git a/qiskit/pulse/builder.py b/qiskit/pulse/builder.py index b5410776df14..913384a56f3c 100644 --- a/qiskit/pulse/builder.py +++ b/qiskit/pulse/builder.py @@ -231,10 +231,7 @@ The above is just a small taste of what is possible with the builder. See the rest of the module documentation for more information on its capabilities. -.. autosummary:: - :toctree: ../stubs/ - - build +.. autofunction:: build Channels @@ -257,13 +254,10 @@ DriveChannel(0) -.. autosummary:: - :toctree: ../stubs/ - - acquire_channel - control_channels - drive_channel - measure_channel +.. autofunction:: acquire_channel +.. autofunction:: control_channels +.. autofunction:: drive_channel +.. autofunction:: measure_channel Instructions @@ -299,21 +293,17 @@ drive_sched.draw() - -.. autosummary:: - :toctree: ../stubs/ - - acquire - barrier - call - delay - play - reference - set_frequency - set_phase - shift_frequency - shift_phase - snapshot +.. autofunction:: acquire +.. autofunction:: barrier +.. autofunction:: call +.. autofunction:: delay +.. autofunction:: play +.. autofunction:: reference +.. autofunction:: set_frequency +.. autofunction:: set_phase +.. autofunction:: shift_frequency +.. autofunction:: shift_phase +.. autofunction:: snapshot Contexts @@ -340,18 +330,15 @@ pulse_prog.draw() -.. autosummary:: - :toctree: ../stubs/ - - align_equispaced - align_func - align_left - align_right - align_sequential - circuit_scheduler_settings - frequency_offset - phase_offset - transpiler_settings +.. autofunction:: align_equispaced +.. autofunction:: align_func +.. autofunction:: align_left +.. autofunction:: align_right +.. autofunction:: align_sequential +.. autofunction:: circuit_scheduler_settings +.. autofunction:: frequency_offset +.. autofunction:: phase_offset +.. autofunction:: transpiler_settings Macros @@ -374,12 +361,9 @@ MemorySlot(0) -.. autosummary:: - :toctree: ../stubs/ - - measure - measure_all - delay_qubits +.. autofunction:: measure +.. autofunction:: measure_all +.. autofunction:: delay_qubits Circuit Gates @@ -405,14 +389,11 @@ with pulse.build(backend) as u3_sched: pulse.u3(math.pi, 0, math.pi, 0) -.. autosummary:: - :toctree: ../stubs/ - - cx - u1 - u2 - u3 - x +.. autofunction:: cx +.. autofunction:: u1 +.. autofunction:: u2 +.. autofunction:: u3 +.. autofunction:: x Utilities @@ -446,16 +427,13 @@ There are 160 samples in 3.5555555555555554e-08 seconds There are 1e-06 seconds in 4500 samples. -.. autosummary:: - :toctree: ../stubs/ - - active_backend - active_transpiler_settings - active_circuit_scheduler_settings - num_qubits - qubit_channels - samples_to_seconds - seconds_to_samples +.. autofunction:: active_backend +.. autofunction:: active_transpiler_settings +.. autofunction:: active_circuit_scheduler_settings +.. autofunction:: num_qubits +.. autofunction:: qubit_channels +.. autofunction:: samples_to_seconds +.. autofunction:: seconds_to_samples """ import collections import contextvars diff --git a/qiskit/pulse/library/__init__.py b/qiskit/pulse/library/__init__.py index 2562f96f24ef..d8809607e3d9 100644 --- a/qiskit/pulse/library/__init__.py +++ b/qiskit/pulse/library/__init__.py @@ -57,22 +57,19 @@ Waveform Pulse Representation ============================= -.. autosummary:: - :toctree: ../stubs/ - - constant - zero - square - sawtooth - triangle - cos - sin - gaussian - gaussian_deriv - sech - sech_deriv - gaussian_square - drag +.. autofunction:: constant +.. autofunction:: zero +.. autofunction:: square +.. autofunction:: sawtooth +.. autofunction:: triangle +.. autofunction:: cos +.. autofunction:: sin +.. autofunction:: gaussian +.. autofunction:: gaussian_deriv +.. autofunction:: sech +.. autofunction:: sech_deriv +.. autofunction:: gaussian_square +.. autofunction:: drag .. _symbolic_pulses: diff --git a/qiskit/pulse/transforms/__init__.py b/qiskit/pulse/transforms/__init__.py index fcc5557bf565..4fb4bf40e9ef 100644 --- a/qiskit/pulse/transforms/__init__.py +++ b/qiskit/pulse/transforms/__init__.py @@ -47,18 +47,15 @@ The canonicalization transforms convert schedules to a form amenable for execution on OpenPulse backends. -.. autosummary:: - :toctree: ../stubs/ - - add_implicit_acquires - align_measures - block_to_schedule - compress_pulses - flatten - inline_subroutines - pad - remove_directives - remove_trivial_barriers +.. autofunction:: add_implicit_acquires +.. autofunction:: align_measures +.. autofunction:: block_to_schedule +.. autofunction:: compress_pulses +.. autofunction:: flatten +.. autofunction:: inline_subroutines +.. autofunction:: pad +.. autofunction:: remove_directives +.. autofunction:: remove_trivial_barriers .. _pulse_dag: @@ -69,10 +66,7 @@ The DAG transforms create DAG representation of input program. This can be used for optimization of instructions and equality checks. -.. autosummary:: - :toctree: ../stubs/ - - block_to_dag +.. autofunction:: block_to_dag .. _pulse_transform_chain: @@ -82,10 +76,7 @@ A sequence of transformations to generate a target code. -.. autosummary:: - :toctree: ../stubs/ - - target_qobj_transform +.. autofunction:: target_qobj_transform """ diff --git a/qiskit/qasm/__init__.py b/qiskit/qasm/__init__.py index f442aaef845f..322d230343c6 100644 --- a/qiskit/qasm/__init__.py +++ b/qiskit/qasm/__init__.py @@ -20,10 +20,7 @@ QASM Routines ============= -.. autosummary:: - :toctree: ../stubs/ - - Qasm +.. autoclass:: Qasm Pygments diff --git a/qiskit/qpy/__init__.py b/qiskit/qpy/__init__.py index 631b6865fea1..4482fb0753bd 100644 --- a/qiskit/qpy/__init__.py +++ b/qiskit/qpy/__init__.py @@ -71,11 +71,8 @@ API documentation ================= -.. autosummary:: - :toctree: ../stubs/ - - load - dump +.. autofunction:: load +.. autofunction:: dump QPY Compatibility ================= diff --git a/qiskit/quantum_info/__init__.py b/qiskit/quantum_info/__init__.py index c507e0d2bed4..6021955e8d54 100644 --- a/qiskit/quantum_info/__init__.py +++ b/qiskit/quantum_info/__init__.py @@ -62,59 +62,51 @@ Measures ======== -.. autosummary:: - :toctree: ../stubs/ - - average_gate_fidelity - process_fidelity - gate_error - diamond_norm - state_fidelity - purity - concurrence - entropy - entanglement_of_formation - mutual_information +.. autofunction:: average_gate_fidelity +.. autofunction:: process_fidelity +.. autofunction:: gate_error +.. autofunction:: diamond_norm +.. autofunction:: state_fidelity +.. autofunction:: purity +.. autofunction:: concurrence +.. autofunction:: entropy +.. autofunction:: entanglement_of_formation +.. autofunction:: mutual_information Utility Functions ================= -.. autosummary:: - :toctree: ../stubs/ - - partial_trace - schmidt_decomposition - shannon_entropy - commutator - anti_commutator - double_commutator +.. autofunction:: partial_trace +.. autofunction:: schmidt_decomposition +.. autofunction:: shannon_entropy +.. autofunction:: commutator +.. autofunction:: anti_commutator +.. autofunction:: double_commutator Random ====== -.. autosummary:: - :toctree: ../stubs/ - - random_statevector - random_density_matrix - random_unitary - random_hermitian - random_pauli - random_clifford - random_quantum_channel - random_cnotdihedral - random_pauli_table - random_pauli_list - random_stabilizer_table +.. autofunction:: random_statevector +.. autofunction:: random_density_matrix +.. autofunction:: random_unitary +.. autofunction:: random_hermitian +.. autofunction:: random_pauli +.. autofunction:: random_clifford +.. autofunction:: random_quantum_channel +.. autofunction:: random_cnotdihedral +.. autofunction:: random_pauli_table +.. autofunction:: random_pauli_list +.. autofunction:: random_stabilizer_table Analysis ========= +.. autofunction:: hellinger_distance +.. autofunction:: hellinger_fidelity + .. autosummary:: :toctree: ../stubs/ - hellinger_distance - hellinger_fidelity Z2Symmetries Synthesis @@ -125,10 +117,11 @@ OneQubitEulerDecomposer TwoQubitBasisDecomposer - two_qubit_cnot_decompose Quaternion - decompose_clifford XXDecomposer + +.. autofunction:: two_qubit_cnot_decompose +.. autofunction:: decompose_clifford """ from __future__ import annotations diff --git a/qiskit/result/__init__.py b/qiskit/result/__init__.py index 024df50506b1..08b43f704939 100644 --- a/qiskit/result/__init__.py +++ b/qiskit/result/__init__.py @@ -23,9 +23,10 @@ Result ResultError Counts - marginal_counts - marginal_distribution - marginal_memory + +.. autofunction:: marginal_counts +.. autofunction:: marginal_distribution +.. autofunction:: marginal_memory Distributions ============= @@ -39,10 +40,7 @@ Expectation values ================== -.. autosummary:: - :toctree: ../stubs/ - - sampled_expectation_value +.. autofunction:: sampled_expectation_value Mitigation ========== diff --git a/qiskit/scheduler/__init__.py b/qiskit/scheduler/__init__.py index b9f2ef97ada3..b85ee77d3764 100644 --- a/qiskit/scheduler/__init__.py +++ b/qiskit/scheduler/__init__.py @@ -19,11 +19,11 @@ A circuit scheduler compiles a circuit program to a pulse program. -.. autosummary:: - :toctree: ../stubs/ +.. autoclass:: ScheduleConfig - schedule_circuit - ScheduleConfig +.. currentmodule:: qiskit.scheduler.schedule_circuit +.. autofunction:: schedule_circuit +.. currentmodule:: qiskit.scheduler .. automodule:: qiskit.scheduler.methods """ diff --git a/qiskit/scheduler/methods/__init__.py b/qiskit/scheduler/methods/__init__.py index b41135d6a5c6..1fe4b301b7ab 100644 --- a/qiskit/scheduler/methods/__init__.py +++ b/qiskit/scheduler/methods/__init__.py @@ -15,10 +15,8 @@ Pulse scheduling methods. -.. autosummary:: - :toctree: ../stubs/ - - basic +.. autofunction:: as_soon_as_possible +.. autofunction:: as_late_as_possible """ from qiskit.scheduler.methods.basic import as_soon_as_possible, as_late_as_possible diff --git a/qiskit/synthesis/__init__.py b/qiskit/synthesis/__init__.py index ff7a3b025a8f..c312ae0dfebd 100644 --- a/qiskit/synthesis/__init__.py +++ b/qiskit/synthesis/__init__.py @@ -34,61 +34,45 @@ Linear Function Synthesis ========================= -.. autosummary:: - :toctree: ../stubs/ - synth_cnot_count_full_pmh - synth_cnot_depth_line_kms +.. autofunction:: synth_cnot_count_full_pmh +.. autofunction:: synth_cnot_depth_line_kms Linear-Phase Synthesis ====================== -.. autosummary:: - :toctree: ../stubs/ - synth_cz_depth_line_mr - synth_cx_cz_depth_line_my +.. autofunction:: synth_cz_depth_line_mr +.. autofunction:: synth_cx_cz_depth_line_my Permutation Synthesis ===================== -.. autosummary:: - :toctree: ../stubs/ - - synth_permutation_depth_lnn_kms - synth_permutation_basic - synth_permutation_acg +.. autofunction:: synth_permutation_depth_lnn_kms +.. autofunction:: synth_permutation_basic +.. autofunction:: synth_permutation_acg Clifford Synthesis ================== -.. autosummary:: - :toctree: ../stubs/ - - synth_clifford_full - synth_clifford_ag - synth_clifford_bm - synth_clifford_greedy - synth_clifford_layers - synth_clifford_depth_lnn +.. autofunction:: synth_clifford_full +.. autofunction:: synth_clifford_ag +.. autofunction:: synth_clifford_bm +.. autofunction:: synth_clifford_greedy +.. autofunction:: synth_clifford_layers +.. autofunction:: synth_clifford_depth_lnn CNOTDihedral Synthesis ====================== -.. autosummary:: - :toctree: ../stubs/ - - synth_cnotdihedral_full - synth_cnotdihedral_two_qubits - synth_cnotdihedral_general +.. autofunction:: synth_cnotdihedral_full +.. autofunction:: synth_cnotdihedral_two_qubits +.. autofunction:: synth_cnotdihedral_general Stabilizer State Synthesis ========================== -.. autosummary:: - :toctree: ../stubs/ - - synth_stabilizer_layers - synth_stabilizer_depth_lnn +.. autofunction:: synth_stabilizer_layers +.. autofunction:: synth_stabilizer_depth_lnn Discrete Basis Synthesis ======================== @@ -97,7 +81,8 @@ :toctree: ../stubs/ SolovayKitaevDecomposition - generate_basic_approximations + +.. autofunction:: generate_basic_approximations """ diff --git a/qiskit/tools/__init__.py b/qiskit/tools/__init__.py index 4f6f8e02879b..6bddd22ba889 100644 --- a/qiskit/tools/__init__.py +++ b/qiskit/tools/__init__.py @@ -24,22 +24,16 @@ Tasks can be executed in parallel using this function. It has a built-in event publisher to show the progress of the parallel tasks. -.. autosummary:: - :toctree: ../stubs/ - - parallel_map +.. autofunction:: parallel_map Monitoring ---------- A helper module to get IBM backend information and submitted job status. -.. autosummary:: - :toctree: ../stubs/ - - job_monitor - backend_monitor - backend_overview +.. autofunction:: job_monitor +.. autofunction:: backend_monitor +.. autofunction:: backend_overview .. automodule:: qiskit.tools.events diff --git a/qiskit/tools/events/__init__.py b/qiskit/tools/events/__init__.py index 9ada164d8d06..d15a537bb942 100644 --- a/qiskit/tools/events/__init__.py +++ b/qiskit/tools/events/__init__.py @@ -19,15 +19,7 @@ .. currentmodule:: qiskit.tools.events -TextProgressBar ---------------- - -A text based progress bar, which also enables Jupyter magics. - -.. autosummary:: - :toctree: ../stubs/ - - TextProgressBar +.. autoclass:: TextProgressBar """ from .progressbar import TextProgressBar diff --git a/qiskit/transpiler/preset_passmanagers/__init__.py b/qiskit/transpiler/preset_passmanagers/__init__.py index e38b1effd57c..4a0ddc10dc0f 100644 --- a/qiskit/transpiler/preset_passmanagers/__init__.py +++ b/qiskit/transpiler/preset_passmanagers/__init__.py @@ -34,31 +34,27 @@ Preset Pass Manager Generation ------------------------------ -.. autosummary:: - :toctree: ../stubs/ - - generate_preset_pass_manager - level_0_pass_manager - level_1_pass_manager - level_2_pass_manager - level_3_pass_manager +.. autofunction:: generate_preset_pass_manager +.. autofunction:: level_0_pass_manager +.. autofunction:: level_1_pass_manager +.. autofunction:: level_2_pass_manager +.. autofunction:: level_3_pass_manager .. _stage_generators: Stage Generator Functions ------------------------- -.. autosummary:: - :toctree: ../stubs/ - - ~qiskit.transpiler.preset_passmanagers.common.generate_control_flow_options_check - ~qiskit.transpiler.preset_passmanagers.common.generate_error_on_control_flow - ~qiskit.transpiler.preset_passmanagers.common.generate_unroll_3q - ~qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager - ~qiskit.transpiler.preset_passmanagers.common.generate_routing_passmanager - ~qiskit.transpiler.preset_passmanagers.common.generate_pre_op_passmanager - ~qiskit.transpiler.preset_passmanagers.common.generate_translation_passmanager - ~qiskit.transpiler.preset_passmanagers.common.generate_scheduling +.. currentmodule:: qiskit.transpiler.preset_passmanagers.common +.. autofunction:: generate_control_flow_options_check +.. autofunction:: generate_error_on_control_flow +.. autofunction:: generate_unroll_3q +.. autofunction:: generate_embed_passmanager +.. autofunction:: generate_routing_passmanager +.. autofunction:: generate_pre_op_passmanager +.. autofunction:: generate_translation_passmanager +.. autofunction:: generate_scheduling +.. currentmodule:: qiskit.transpiler.preset_passmanagers """ from qiskit.transpiler.passmanager_config import PassManagerConfig diff --git a/qiskit/transpiler/preset_passmanagers/plugin.py b/qiskit/transpiler/preset_passmanagers/plugin.py index 83d66ceae6a2..53fd7b8389bf 100644 --- a/qiskit/transpiler/preset_passmanagers/plugin.py +++ b/qiskit/transpiler/preset_passmanagers/plugin.py @@ -160,8 +160,9 @@ def pass_manager(self, pass_manager_config, optimization_level): PassManagerStagePlugin PassManagerStagePluginManager - list_stage_plugins - passmanager_stage_plugins + +.. autofunction:: list_stage_plugins +.. autofunction:: passmanager_stage_plugins """ import abc diff --git a/qiskit/utils/__init__.py b/qiskit/utils/__init__.py index 8d06dd5f48d1..a1329457f8f9 100644 --- a/qiskit/utils/__init__.py +++ b/qiskit/utils/__init__.py @@ -18,34 +18,27 @@ .. currentmodule:: qiskit.utils -.. autosummary:: - :toctree: ../stubs/ - - add_deprecation_to_docstring - deprecate_arg - deprecate_arguments - deprecate_func - deprecate_function - local_hardware_info - is_main_process - apply_prefix - detach_prefix - wrap_method +.. autofunction:: add_deprecation_to_docstring +.. autofunction:: deprecate_arg +.. autofunction:: deprecate_arguments +.. autofunction:: deprecate_func +.. autofunction:: deprecate_function +.. autofunction:: local_hardware_info +.. autofunction:: is_main_process +.. autofunction:: apply_prefix +.. autofunction:: detach_prefix +.. autofunction:: wrap_method Algorithm Utilities =================== -.. autosummary:: - :toctree: ../stubs/ - :nosignatures: - - summarize_circuits - get_entangler_map - validate_entangler_map - has_ibmq - has_aer - name_args - algorithm_globals +.. autofunction:: summarize_circuits +.. autofunction:: get_entangler_map +.. autofunction:: validate_entangler_map +.. autofunction:: has_ibmq +.. autofunction:: has_aer +.. autofunction:: name_args +.. autodata:: algorithm_globals .. autosummary:: :toctree: ../stubs/ diff --git a/qiskit/visualization/__init__.py b/qiskit/visualization/__init__.py index 539714f04f19..29eb5cf2c0cc 100644 --- a/qiskit/visualization/__init__.py +++ b/qiskit/visualization/__init__.py @@ -260,10 +260,7 @@ Exceptions ========== -.. autosummary:: - :toctree: ../stubs/ - - VisualizationError +.. autoexception:: VisualizationError """ import os