Skip to content

Commit caf287c

Browse files
Fix: Correctly link C documentation to the C domain (Qiskit#15250) (Qiskit#15252)
Due to the nature of `breathe`, it is assumed all documentation was coming from the c domain because it was coming from a header file with an unspecified language (h files can be either C++ or C). The following commits add an attribute to the "conf.py" file in docs that specifies that files with a ".h" extension are in the C domain. Co-authored-by: Raynel Sanchez <[email protected]>
1 parent 9fc7f60 commit caf287c

8 files changed

+32
-29
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454

5555
breathe_projects = {"qiskit": "xml/"}
5656
breathe_default_project = "qiskit"
57+
breathe_domain_by_extension = {
58+
"h" : "c",
59+
}
5760

5861
templates_path = ["_templates"]
5962

releasenotes/notes/2.2/add-c-standalone-passes-207be980c30c3fe9.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ features_c:
77
========================================== =============================================================================
88
Transpiler pass C API Counterpart
99
========================================== =============================================================================
10-
:class:`.BasisTranslator` :cpp:func:`qk_transpiler_pass_standalone_basis_translator`
11-
:class:`.CommutativeCancellation` :cpp:func:`qk_transpiler_pass_standalone_commutative_cancellation`
12-
:class:`.ConsolidateBlocks` :cpp:func:`qk_transpiler_pass_standalone_consolidate_blocks`
13-
:class:`.ElidePermutations` :cpp:func:`qk_transpiler_pass_standalone_elide_permutations`
14-
:class:`.CheckGateDirection` :cpp:func:`qk_transpiler_pass_standalone_check_gate_direction`
15-
:class:`.GateDirection` :cpp:func:`qk_transpiler_pass_standalone_gate_direction`
16-
:class:`.InverseCancellation` :cpp:func:`qk_transpiler_pass_standalone_inverse_cancellation`
17-
:class:`.Optimize1qGatesDecomposition` :cpp:func:`qk_transpiler_standalone_optimize_1q_sequences`
18-
:class:`.RemoveDiagonalGatesBeforeMeasure` :cpp:func:`qk_transpiler_pass_standalone_remove_diagonal_gates_before_measure`
19-
:class:`.RemoveIdentityEquivalent` :cpp:func:`qk_transpiler_pass_standalone_remove_identity_equivalent`
20-
:class:`.SabreLayout` :cpp:func:`qk_transpiler_pass_standalone_sabre_layout`
21-
:class:`.Split2QUnitaries` :cpp:func:`qk_transpiler_pass_standalone_split_2q_unitaries`
22-
:class:`.UnitarySynthesis` :cpp:func:`qk_transpiler_pass_standalone_unitary_synthesis`
23-
:class:`.VF2Layout` :cpp:func:`qk_transpiler_pass_standalone_vf2_layout`
10+
:class:`.BasisTranslator` :c:func:`qk_transpiler_pass_standalone_basis_translator`
11+
:class:`.CommutativeCancellation` :c:func:`qk_transpiler_pass_standalone_commutative_cancellation`
12+
:class:`.ConsolidateBlocks` :c:func:`qk_transpiler_pass_standalone_consolidate_blocks`
13+
:class:`.ElidePermutations` :c:func:`qk_transpiler_pass_standalone_elide_permutations`
14+
:class:`.CheckGateDirection` :c:func:`qk_transpiler_pass_standalone_check_gate_direction`
15+
:class:`.GateDirection` :c:func:`qk_transpiler_pass_standalone_gate_direction`
16+
:class:`.InverseCancellation` :c:func:`qk_transpiler_pass_standalone_inverse_cancellation`
17+
:class:`.Optimize1qGatesDecomposition` :c:func:`qk_transpiler_standalone_optimize_1q_sequences`
18+
:class:`.RemoveDiagonalGatesBeforeMeasure` :c:func:`qk_transpiler_pass_standalone_remove_diagonal_gates_before_measure`
19+
:class:`.RemoveIdentityEquivalent` :c:func:`qk_transpiler_pass_standalone_remove_identity_equivalent`
20+
:class:`.SabreLayout` :c:func:`qk_transpiler_pass_standalone_sabre_layout`
21+
:class:`.Split2QUnitaries` :c:func:`qk_transpiler_pass_standalone_split_2q_unitaries`
22+
:class:`.UnitarySynthesis` :c:func:`qk_transpiler_pass_standalone_unitary_synthesis`
23+
:class:`.VF2Layout` :c:func:`qk_transpiler_pass_standalone_vf2_layout`
2424
========================================== =============================================================================

releasenotes/notes/2.2/c-api-ops-count-bug-f633d349de315e89.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
fixes:
33
- |
44
Fixed memory leakage issues during the creation of
5-
a :cpp:struct:`QkOpCounts` instance and during any calls to
6-
:cpp:func:`qk_opcounts_clear` whenever an empty instance is passed.
5+
a :c:struct:`QkOpCounts` instance and during any calls to
6+
:c:func:`qk_opcounts_clear` whenever an empty instance is passed.

releasenotes/notes/2.2/cbindgen-usize-to-size_t-544294518fdfcbb0.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ upgrade_c:
33
- |
44
Most usage of `uintptr_t`` has been changed to ``size_t``. Specifically the following usages have been changed:
55
6-
* :cpp:member:`QkOpCount::count`
7-
* :cpp:member:`QkOpCounts::len`
8-
* :cpp:member:`QkObsTerm::len`
9-
* The return type of :cpp:func:`qk_circuit_num_instructions`.
10-
* The ``index`` argument in :cpp:func:`qk_circuit_get_instruction`.
11-
* The ``boundaries`` argument in :cpp:func:`qk_obs_new`.
12-
* The return types of :cpp:func:`qk_obs_num_terms`, :cpp:func:`qk_obs_len`, and :cpp:func:`qk_obs_boundaries`.
13-
* The return type of :cpp:func:`qk_target_entry_num_properties`, and :cpp:func:`qk_target_num_instructions`.
6+
* :c:member:`QkOpCount::count`
7+
* :c:member:`QkOpCounts::len`
8+
* :c:member:`QkObsTerm::len`
9+
* The return type of :c:func:`qk_circuit_num_instructions`.
10+
* The ``index`` argument in :c:func:`qk_circuit_get_instruction`.
11+
* The ``boundaries`` argument in :c:func:`qk_obs_new`.
12+
* The return types of :c:func:`qk_obs_num_terms`, :c:func:`qk_obs_len`, and :c:func:`qk_obs_boundaries`.
13+
* The return type of :c:func:`qk_target_entry_num_properties`, and :c:func:`qk_target_num_instructions`.
1414
1515
This change was necessary because the tool used to generate the C header files from Qiskit's rust code,
1616
`cbindgen <https://github.com/mozilla/cbindgen?tab=readme-ov-file>`__ was using ``uintptr_t`` by default in places

releasenotes/notes/2.2/parameterized_target_c-9c9a4ad2915c2348.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ features_c:
44
The ``QkTarget`` type can now represent targets that support
55
parameterized ``QkGate`` types that accept any parameter value. Previously,
66
these gates could only be added to the target with a fixed angle value
7-
supported by using :cpp:func:`qk_target_entry_new_fixed` to create the ``QkTargetEntry``.
8-
Now, the :cpp:func:`qk_target_entry_new` function can be used with parameterized gates.
7+
supported by using :c:func:`qk_target_entry_new_fixed` to create the ``QkTargetEntry``.
8+
Now, the :c:func:`qk_target_entry_new` function can be used with parameterized gates.
99
When it is used with parameterized gates, this function indicates that the gate in the target supports any value for
1010
all of the gate's parameters. For example:
1111

releasenotes/notes/2.2/prepare-2.2.0-99d722b656fba0a8.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ prelude: >
44
and bug fixes. The major features of this new release are:
55
66
* **C API transpile function:** The C API now includes a function for transpiling a
7-
quantum circuit: :cpp:func:`qk_transpile`. This function is equivalent to the Python
7+
quantum circuit: :c:func:`qk_transpile`. This function is equivalent to the Python
88
:func:`.transpile` function for a standalone C context.
99
1010
* **Litinski transformation pass:** A new transformation pass :class:`.LitinskiTransformation` that implements

releasenotes/notes/2.2/qk-obs-apply-layot-6d784fa34c18dc1e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
features_c:
33
- |
4-
Added :cpp:func:`qk_obs_apply_layout` to apply new qubit layouts to a ``QkObs`` observable.
4+
Added :c:func:`qk_obs_apply_layout` to apply new qubit layouts to a ``QkObs`` observable.
55
This function takes the observable, the new qubit indices, and an output number of qubits.
66
Importantly, this function allows applying transpile layouts, usually given as
77
``QkTranspileLayout`` by a transpiler pass, to an observable. For example:

releasenotes/notes/2.2/transpile-c-3d8005b1d67705c9.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
features_c:
33
- |
4-
Added a new function :cpp:func:`qk_transpile` to the Qiskit C API. This function is used for transpiling
4+
Added a new function :c:func:`qk_transpile` to the Qiskit C API. This function is used for transpiling
55
quantum circuits in a standalone C context without using Python. This is the last major component
66
needed in the C API for typical hardware execution workflows using Qiskit.
77

0 commit comments

Comments
 (0)