diff --git a/docs/api/qiskit-c/dev/qk-bit-term.mdx b/docs/api/qiskit-c/dev/qk-bit-term.mdx
index 856462a9049..cd817d5abf5 100644
--- a/docs/api/qiskit-c/dev/qk-bit-term.mdx
+++ b/docs/api/qiskit-c/dev/qk-bit-term.mdx
@@ -91,7 +91,7 @@ The numeric structure of these is that they are all four-bit values of which the
Get the label for a bit term.
-
+
#### Example
@@ -101,11 +101,11 @@ The numeric structure of these is that they are all four-bit values of which the
char label = qk_bitterm_label(bit_term);
```
-
+
#### Safety
-
+
The behavior is undefined if `bit_term` is not a valid `uint8_t` value of a `QkBitTerm`.
diff --git a/docs/api/qiskit-c/dev/qk-circuit-library.mdx b/docs/api/qiskit-c/dev/qk-circuit-library.mdx
index 1504e85056b..c9864fc9110 100644
--- a/docs/api/qiskit-c/dev/qk-circuit-library.mdx
+++ b/docs/api/qiskit-c/dev/qk-circuit-library.mdx
@@ -85,11 +85,11 @@ The Qiskit circuit library contains functions and higher-level building blocks f
The `interactions` matrix is interpreted as an `n × n` row-major array of 64-bit integers, where `n = num_qubits`. The diagonal entries set T-like phase powers, and the upper triangle encodes two-qubit CPhase interactions.
-
+
#### Safety
-
+
If `num_qubits > 0`, `interactions` **must** be a valid, non-null pointer to at least `num_qubits * num_qubits` contiguous `int64_t` values in row-major order. The memory pointed to by `interactions` must be properly aligned, readable for the duration of this call, and not mutably aliased. Passing an invalid pointer or a buffer that is too small results in undefined behaviour.
@@ -128,7 +128,7 @@ The Qiskit circuit library contains functions and higher-level building blocks f
This frees the memory of the `z` and `x` arrays and frees the `angle`. This function should only be called for `QkPauliProductRotation` objects whose data has been populated by Rust.
-
+
#### Example
@@ -156,11 +156,11 @@ The Qiskit circuit library contains functions and higher-level building blocks f
qk_param_free(angle);
```
-
+
#### Safety
-
+
Behavior is undefined if `inst` is not a valid, non-null pointer to a `QkPauliProductRotation`, or if the internal data of `QkPauliProductRotation` is incoherent.
@@ -176,7 +176,7 @@ The Qiskit circuit library contains functions and higher-level building blocks f
This frees the memory of the `z` and `x` arrays. This function should only be called for `QkPauliProductMeasurement` objects whose data has been populated by Rust.
-
+
#### Example
@@ -203,11 +203,11 @@ The Qiskit circuit library contains functions and higher-level building blocks f
// since this data is allocated by C, we do not call `qk_pauli_product_measurement_clear(&inst)`
```
-
+
#### Safety
-
+
Behavior is undefined if `inst` is not a valid, non-null pointer to a `QkPauliProductMeasurement`, or if the internal data of `QkPauliProductMeasurement` is incoherent.
@@ -227,7 +227,7 @@ The Qiskit circuit library contains functions and higher-level building blocks f
\[1] A. Cross et al. Validating quantum computers using randomized model circuits, Phys. Rev. A 100, 032328 (2019). [arXiv:1811.12926](https://arxiv.org/abs/1811.12926)
-
+
#### Example
@@ -253,7 +253,7 @@ The Qiskit circuit library contains functions and higher-level building blocks f
The Suzuki-Trotter formulas improve the error of the Lie-Trotter approximation. In this implementation, the operators are provided as sum terms of a Pauli operator. Higher order decompositions are based on recursions, see Ref. \[1] for more details.
-
+
#### Example
@@ -274,19 +274,19 @@ The Qiskit circuit library contains functions and higher-level building blocks f
qk_circuit_free(qc);
```
-
+
#### Safety
-
+
Behavior is undefined `op` is not a valid, non-null pointer to a `QkObs`.
-
+
#### References
-
+
\[1]: D. Berry, G. Ahokas, R. Cleve and B. Sanders, “Efficient quantum algorithms for simulating sparse Hamiltonians” (2006). [arXiv:quant-ph/0508139](https://arxiv.org/abs/quant-ph/0508139)
diff --git a/docs/api/qiskit-c/dev/qk-circuit.mdx b/docs/api/qiskit-c/dev/qk-circuit.mdx
index 87bb06f1534..0155021f482 100644
--- a/docs/api/qiskit-c/dev/qk-circuit.mdx
+++ b/docs/api/qiskit-c/dev/qk-circuit.mdx
@@ -1350,6 +1350,31 @@ The circuit C API currently only supports creating circuits that contain operati
The pointer to the copied circuit.
+### qk\_circuit\_estimate\_fidelity
+
+
+ Estimate the fidelity of a physical circuit.
+
+ This function will compute the product of the error rates for each gate in the circuit to estimate the fidelity of the circuit. This method is not intended to compute a realistic simulation of the fidelity of execution on real hardware. It is designed to provide an estimate of how the transpiler would work with the fidelity for various heuristics in its operation. It is typically only useful for comparing different compilation outputs against each other to estimate which one would produce a better quality execution on hardware.
+
+
+
+ #### Safety
+
+
+
+ Behavior is undefined if `circuit` and `target` are not a valid, non-null pointer to a `QkCircuit` and `QkTarget` respectively.
+
+ **Parameters**
+
+ * **circuit** – A pointer to the circuit to estimate the fidelity of.
+ * **target** – A pointer to the target that the circuit will be executed on. This is used to get the error rates for the instructions in the circuit.
+
+ **Returns**
+
+ The computed fidelity of the circuit. This will return NaN if the circuit is not physical, meaning there are instructions in `circuit` not supported by `target`.
+
+
### qk\_circuit\_to\_python
@@ -1359,11 +1384,11 @@ The circuit C API currently only supports creating circuits that contain operati
It is not safe to use the `QkCircuit` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkCircuit`, not hold a borrowed reference (for example, a `QkCircuit *` retrieved from `qk_circuit_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `circuit` is not a valid non-null pointer to an initialized and owned `QkCircuit`.
@@ -1385,11 +1410,11 @@ The circuit C API currently only supports creating circuits that contain operati
It is not safe to use the `QkCircuit` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkCircuit`, not hold a borrowed reference (for example, a `QkCircuit *` retrieved from `qk_circuit_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `circuit` is not a valid non-null pointer to an initialized and owned `QkCircuit`.
@@ -1415,11 +1440,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_circuit_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -1445,11 +1470,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_circuit_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
@@ -1470,11 +1495,11 @@ The circuit C API currently only supports creating circuits that contain operati
It is not safe to use the `QkQuantumRegister` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkQuantumRegister`, not hold a borrowed reference (for example, a `QkQuantumRegister *` retrieved from `qk_quantum_register_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `qr` is not a valid non-null pointer to an initialized and owned `QkQuantumRegister`.
@@ -1498,11 +1523,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_quantum_register_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -1526,11 +1551,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_quantum_register_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
@@ -1551,11 +1576,11 @@ The circuit C API currently only supports creating circuits that contain operati
It is not safe to use the `QkClassicalRegister` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkClassicalRegister`, not hold a borrowed reference (for example, a `QkClassicalRegister *` retrieved from `qk_classical_register_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `cr` is not a valid non-null pointer to an initialized and owned `QkClassicalRegister`.
@@ -1579,11 +1604,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_classical_register_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -1607,11 +1632,11 @@ The circuit C API currently only supports creating circuits that contain operati
You can also use `qk_classical_register_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
diff --git a/docs/api/qiskit-c/dev/qk-dag.mdx b/docs/api/qiskit-c/dev/qk-dag.mdx
index f85f7c30704..e731cd435ea 100644
--- a/docs/api/qiskit-c/dev/qk-dag.mdx
+++ b/docs/api/qiskit-c/dev/qk-dag.mdx
@@ -151,7 +151,7 @@ The C API currently only supports building DAGs that contain operations defined
You must free the returned DAG with `qk_dag_free` when done with it.
-
+
#### Example
@@ -169,7 +169,7 @@ The C API currently only supports building DAGs that contain operations defined
Add a quantum register to the DAG.
-
+
#### Example
@@ -181,11 +181,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag` and if `reg` is not a valid, non-null pointer to a `QkQuantumRegister`.
@@ -200,7 +200,7 @@ The C API currently only supports building DAGs that contain operations defined
Add a classical register to the DAG.
-
+
#### Example
@@ -212,11 +212,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag` and if `reg` is not a valid, non-null pointer to a `QkClassicalRegister`.
@@ -231,7 +231,7 @@ The C API currently only supports building DAGs that contain operations defined
Get the number of qubits the DAG contains.
-
+
#### Example
@@ -244,11 +244,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -266,7 +266,7 @@ The C API currently only supports building DAGs that contain operations defined
Get the number of clbits the DAG contains.
-
+
#### Example
@@ -279,11 +279,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -301,7 +301,7 @@ The C API currently only supports building DAGs that contain operations defined
Return the total number of operation nodes in the DAG.
-
+
#### Example
@@ -318,11 +318,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_quantum_register_free(qr);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -342,7 +342,7 @@ The C API currently only supports building DAGs that contain operations defined
This function returns a copy of the DAG’s global phase and the value must be freed via :c:func:`qk_param_free` after usage.
-
+
#### Example
@@ -356,11 +356,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -380,7 +380,7 @@ The C API currently only supports building DAGs that contain operations defined
This function copies the new global phase upon setting it, so the caller retains ownership of the `QkParam` phase, and the value of the phase must be freed via :c:func:`qk_param_free` after setting.
-
+
#### Example
@@ -392,11 +392,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag` and if `phase` is not a valid, non-null pointer to a `QkParam`.
@@ -417,11 +417,11 @@ The C API currently only supports building DAGs that contain operations defined
The result can be used in a switch statement to dispatch proper handling when iterating over nodes of unknown type.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -440,11 +440,11 @@ The C API currently only supports building DAGs that contain operations defined
Retrieve the index of the input node of the wire corresponding to the given qubit.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -463,11 +463,11 @@ The C API currently only supports building DAGs that contain operations defined
Retrieve the index of the output node of the wire corresponding to the given qubit.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -486,11 +486,11 @@ The C API currently only supports building DAGs that contain operations defined
Retrieve the index of the input node of the wire corresponding to the given clbit.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -509,11 +509,11 @@ The C API currently only supports building DAGs that contain operations defined
Retrieve the index of the output node of the wire corresponding to the given clbit.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -532,11 +532,11 @@ The C API currently only supports building DAGs that contain operations defined
Retrieve the value of a wire endpoint node.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -557,11 +557,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not an operation.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -582,11 +582,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not an operation.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -607,11 +607,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not an operation.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -632,11 +632,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not an operation.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -657,11 +657,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not an operation.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -680,7 +680,7 @@ The C API currently only supports building DAGs that contain operations defined
Apply a `QkGate` to the DAG.
-
+
#### Example
@@ -696,11 +696,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_quantum_register_free(qr);
```
-
+
#### Safety
-
+
The `qubits` and `params` types are expected to be a pointer to an array of `uint32_t` and `double` respectively where the length is matching the expectations for the standard gate. If the array is insufficiently long the behavior of this function is undefined as this will read outside the bounds of the array. It can be a null pointer if there are no qubits or params for a given gate. You can check `qk_gate_num_qubits` and `qk_gate_num_params` to determine how many qubits and params are required for a given gate.
@@ -724,11 +724,11 @@ The C API currently only supports building DAGs that contain operations defined
Apply a measure to a DAG.
-
+
#### Example
-
+
Measure all qubits into the corresponding clbit index at the end of the circuit.
@@ -739,11 +739,11 @@ The C API currently only supports building DAGs that contain operations defined
}
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not an aligned, non-null pointer to a valid `QkDag`, or if `qubit` or `clbit` are out of range.
@@ -764,11 +764,11 @@ The C API currently only supports building DAGs that contain operations defined
Apply a reset to the DAG.
-
+
#### Examples
-
+
Apply initial resets on all qubits.
@@ -779,11 +779,11 @@ The C API currently only supports building DAGs that contain operations defined
}
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not an aligned, non-null pointer to a valid `QkDag`, or if `qubit` is out of range.
@@ -803,11 +803,11 @@ The C API currently only supports building DAGs that contain operations defined
Apply a barrier to the DAG.
-
+
#### Examples
-
+
Apply a final barrier on all qubits:
@@ -823,11 +823,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_apply_barrier(dag, qubits, num_qubits, true);
```
-
+
#### Safety
-
+
Behavior is undefined if:
@@ -855,11 +855,11 @@ The C API currently only supports building DAGs that contain operations defined
See :[Circuit conventions](/docs/api/qiskit/dev/circuit#circuit-conventions) for detail on the bit-labelling and matrix conventions of Qiskit.
-
+
#### Safety
-
+
Behavior is undefined if any of:
@@ -887,7 +887,7 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not a standard gate operation.
-
+
#### Example
@@ -905,11 +905,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_quantum_register_free(qr);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`. If `out_params` is non-NULL, it must point to a buffer large enough to hold all the gate’s params, otherwise behavior is undefined as this function will write beyond its bounds. You can check `qk_dag_op_node_num_params` to determine how many params are required for any given operation node.
@@ -931,11 +931,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if the node is not a unitary gate.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a non-null pointer to a valid `QkDag`, if `out` is unaligned, or if `out` is not valid for `4**num_qubits` writes of `QkComplex64`.
@@ -955,11 +955,11 @@ The C API currently only supports building DAGs that contain operations defined
Panics if `node` is not an operation node.
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -980,7 +980,7 @@ The C API currently only supports building DAGs that contain operations defined
The successors array and its length are returned as a `QkDagNeighbors` struct, where each element in the array corresponds to a DAG node index. You must call the `qk_dag_neighbors_clear` function when done to free the memory allocated for the struct.
-
+
#### Example
@@ -998,11 +998,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -1023,7 +1023,7 @@ The C API currently only supports building DAGs that contain operations defined
The predecessors array and its length are returned as a `QkDagNeighbors` struct, where each element in the array corresponds to a DAG node index. You must call the `qk_dag_neighbors_clear` function when done to free the memory allocated for the struct.
-
+
#### Example
@@ -1041,11 +1041,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -1066,11 +1066,11 @@ The C API currently only supports building DAGs that contain operations defined
The function deallocates the memory pointed to by the `neighbors` field and sets it to NULL. It also sets the `num_neighbors` field to 0.
-
+
#### Safety
-
+
Behavior is undefined if `neighbors` is not a valid, non-null pointer to a [QkDagNeighbors](#structqkdagneighbors) object populated with either `qk_dag_successors` or `qk_dag_predecessors`.
@@ -1088,11 +1088,11 @@ The C API currently only supports building DAGs that contain operations defined
You must call `qk_circuit_instruction_clear` to reset the `QkCircuitInstruction` before reusing it or dropping it.
-
+
#### Examples
-
+
Iterate through a DAG to find which qubits have measures on them:
@@ -1115,11 +1115,11 @@ The C API currently only supports building DAGs that contain operations defined
free(measured);
```
-
+
#### Safety
-
+
Behavior is undefined if either `dag` or `instruction` are not valid, aligned, non-null pointers to the relevant data type. The fields of `instruction` need not be initialized.
@@ -1137,7 +1137,7 @@ The C API currently only supports building DAGs that contain operations defined
`other` may include a smaller or equal number of wires for each type.
-
+
#### Example
@@ -1187,11 +1187,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_quantum_register_free(rqr);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `other` are not valid, non-null pointers to a `QkDag`. If `qubit` nor `clbit` are NULL, it must contains a less or equal amount than what the circuit owns.
@@ -1212,7 +1212,7 @@ The C API currently only supports building DAGs that contain operations defined
Free the DAG.
-
+
#### Example
@@ -1221,11 +1221,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not either null or a valid pointer to a `QkDag`.
@@ -1241,7 +1241,7 @@ The C API currently only supports building DAGs that contain operations defined
The new circuit is copied from the DAG; the original `dag` reference is still owned by the caller and still required to be freed with `qk_dag_free`. You must free the returned circuit with `qk_circuit_free` when done with it.
-
+
#### Example
@@ -1257,11 +1257,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -1279,7 +1279,7 @@ The C API currently only supports building DAGs that contain operations defined
Return the operation nodes in the DAG listed in topological order.
-
+
#### Example
@@ -1311,11 +1311,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag` or if `out_order` is not a valid, non-null pointer to a sequence of `qk_dag_num_op_nodes(dag)` consecutive elements of `uint32_t`.
@@ -1330,7 +1330,7 @@ The C API currently only supports building DAGs that contain operations defined
Replace a node in a `QkDag` with a subcircuit specified by another `QkDag`
-
+
#### Example
@@ -1361,11 +1361,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` and `replacement` are not a valid, non-null pointer to a `QkDag`.
@@ -1388,7 +1388,7 @@ The C API currently only supports building DAGs that contain operations defined
* duration
* all the qubits and clbits, including the registers.
-
+
#### Example
@@ -1412,11 +1412,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(copied_dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid pointer to a `QkDag`.
@@ -1438,7 +1438,7 @@ The C API currently only supports building DAGs that contain operations defined
Upon replacement, the nodes in the block are removed and substituted by a new node acting on the given qubits.
-
+
#### Example
@@ -1465,11 +1465,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if any of:
@@ -1500,7 +1500,7 @@ The C API currently only supports building DAGs that contain operations defined
The new operation should match the shape of the replaced operation. The qargs and cargs for the node will remain the same.
-
+
#### Example
@@ -1521,11 +1521,11 @@ The C API currently only supports building DAGs that contain operations defined
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if any of:
@@ -1547,11 +1547,11 @@ The C API currently only supports building DAGs that contain operations defined
It is not safe to use the `QkDag` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkDag`, not hold a borrowed reference (for example, a `QkDag *` retrieved from `qk_dag_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `dag` is not a valid non-null pointer to an initialized and owned `QkDag`.
@@ -1575,11 +1575,11 @@ The C API currently only supports building DAGs that contain operations defined
You can also use `qk_dag_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -1603,11 +1603,11 @@ The C API currently only supports building DAGs that contain operations defined
You can also use `qk_dag_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
diff --git a/docs/api/qiskit-c/dev/qk-neighbors.mdx b/docs/api/qiskit-c/dev/qk-neighbors.mdx
index 737bc3e9572..ceef7b99be9 100644
--- a/docs/api/qiskit-c/dev/qk-neighbors.mdx
+++ b/docs/api/qiskit-c/dev/qk-neighbors.mdx
@@ -17,11 +17,11 @@ python_api_name: QkNeighbors
This object is read-only from C. To satisfy the safety guarantees of `qk_neighbors_clear`, you must not overwrite any data initialized by `qk_neighbors_from_target`, including any pointed-to data.
-
+
#### Representation
-
+
After initialization by `qk_neighbors_from_target`, the structure will be in one of two modes:
@@ -62,11 +62,11 @@ python_api_name: QkNeighbors
This is represented by `neighbors` and `partition` being null pointers, so they are not valid for any reads.
-
+
#### Safety
-
+
`neighbors` must point to a valid, initialized `QkNeighbors` object.
@@ -86,7 +86,7 @@ python_api_name: QkNeighbors
If the target contains multi-qubit gates, they will be ignored and the connectivity will only represent the two-qubit coupling constraints. If the target represents all-to-all connectivity, the function returns `true`, and the output pointers will be initialized to be null pointers, in keeping with the representation of all-to-all connectivity.
-
+
#### Examples
@@ -108,11 +108,11 @@ python_api_name: QkNeighbors
qk_neighbors_clear(&neighbors);
```
-
+
#### Safety
-
+
`target` must point to a valid `QkTarget` object. `neighbors` must be aligned and safe to write to, but need not be initialized.
@@ -135,11 +135,11 @@ python_api_name: QkNeighbors
This should only be called on `QkNeighbors` objects that were initialized by `qk_neighbors_from_target`.
-
+
#### Safety
-
+
`neighbors` must point to a valid, initialized `QkNeighbors` object, which must have been initialized by a call to `qk_neighbors_from_target` and unaltered since then.
diff --git a/docs/api/qiskit-c/dev/qk-obs-term.mdx b/docs/api/qiskit-c/dev/qk-obs-term.mdx
index 30c627e7842..265576fe1a7 100644
--- a/docs/api/qiskit-c/dev/qk-obs-term.mdx
+++ b/docs/api/qiskit-c/dev/qk-obs-term.mdx
@@ -19,11 +19,11 @@ This is a group of functions for interacting with an opaque (Rust-space) SparseT
This contains the coefficient (`coeff`), the number of qubits of the observable (`num_qubits`) and pointers to the `bit_terms` and `indices` arrays, which have length `len`. It’s the responsibility of the user that the data is coherent, see also the below section on safety.
-
+
#### Safety
-
+
* `bit_terms` must be a non-null, aligned pointer to `len` elements of type `QkBitTerm`.
* `indices` must be a non-null, aligned pointer to `len` elements of type `uint32_t`.
@@ -66,7 +66,7 @@ This is a group of functions for interacting with an opaque (Rust-space) SparseT
Return a string representation of the sparse term.
-
+
#### Example
@@ -79,11 +79,11 @@ This is a group of functions for interacting with an opaque (Rust-space) SparseT
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined `term` is not a valid, non-null pointer to a `QkObsTerm`.
diff --git a/docs/api/qiskit-c/dev/qk-obs.mdx b/docs/api/qiskit-c/dev/qk-obs.mdx
index 0318b91848e..4f6fd8b9cf5 100644
--- a/docs/api/qiskit-c/dev/qk-obs.mdx
+++ b/docs/api/qiskit-c/dev/qk-obs.mdx
@@ -145,7 +145,7 @@ for (size_t i = 0; i < num_terms; i++) {
Construct the zero observable (without any terms).
-
+
#### Example
@@ -167,7 +167,7 @@ for (size_t i = 0; i < num_terms; i++) {
Construct the identity observable.
-
+
#### Example
@@ -191,7 +191,7 @@ for (size_t i = 0; i < num_terms; i++) {
Any of the pointer arguments may be `NULL` if and only if their corresponding length is zero.
-
+
#### Example
@@ -211,11 +211,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined if any of the following conditions are violated:
@@ -244,7 +244,7 @@ for (size_t i = 0; i < num_terms; i++) {
Free the observable.
-
+
#### Example
@@ -253,11 +253,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined if `obs` is not either null or a valid pointer to a `QkObs`.
@@ -271,7 +271,7 @@ for (size_t i = 0; i < num_terms; i++) {
Add a term to the observable.
-
+
#### Example
@@ -287,11 +287,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkExitCode exit_code = qk_obs_add_term(obs, &term);
```
-
+
#### Safety
-
+
Behavior is undefined if any of the following is violated:
@@ -315,7 +315,7 @@ for (size_t i = 0; i < num_terms; i++) {
A `QkObsTerm` contains pointers to the indices and bit terms in the term, which can be used to modify the internal data of the observable. This can leave the observable in an incoherent state and should be avoided, unless great care is taken. It is generally safer to construct a new observable instead of attempting in-place modifications.
-
+
#### Example
@@ -327,11 +327,11 @@ for (size_t i = 0; i < num_terms; i++) {
// QkExitCode error = qk_obs_term(obs, 12, &term);
```
-
+
#### Safety
-
+
Behavior is undefined if any of the following is violated
@@ -354,7 +354,7 @@ for (size_t i = 0; i < num_terms; i++) {
Get the number of terms in the observable.
-
+
#### Example
@@ -363,11 +363,11 @@ for (size_t i = 0; i < num_terms; i++) {
size_t num_terms = qk_obs_num_terms(obs); // num_terms==1
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -385,7 +385,7 @@ for (size_t i = 0; i < num_terms; i++) {
Get the number of qubits the observable is defined on.
-
+
#### Example
@@ -394,11 +394,11 @@ for (size_t i = 0; i < num_terms; i++) {
uint32_t num_qubits = qk_obs_num_qubits(obs); // num_qubits==100
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -416,7 +416,7 @@ for (size_t i = 0; i < num_terms; i++) {
Get the number of bit terms/indices in the observable.
-
+
#### Example
@@ -425,11 +425,11 @@ for (size_t i = 0; i < num_terms; i++) {
size_t len = qk_obs_len(obs); // len==0, as there are no non-trivial bit terms
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -449,7 +449,7 @@ for (size_t i = 0; i < num_terms; i++) {
This can be used to read and modify the observable’s coefficients. The resulting pointer is valid to read for `qk_obs_num_terms(obs)` elements of `QkComplex64`.
-
+
#### Example
@@ -463,11 +463,11 @@ for (size_t i = 0; i < num_terms; i++) {
}
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -487,7 +487,7 @@ for (size_t i = 0; i < num_terms; i++) {
This can be used to read and modify the observable’s indices. The resulting pointer is valid to read for `qk_obs_len(obs)` elements of size `uint32_t`.
-
+
#### Example
@@ -511,11 +511,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -535,7 +535,7 @@ for (size_t i = 0; i < num_terms; i++) {
This can be used to read and modify the observable’s term boundaries. The resulting pointer is valid to read for `qk_obs_num_terms(obs) + 1` elements of size `size_t`.
-
+
#### Example
@@ -557,11 +557,11 @@ for (size_t i = 0; i < num_terms; i++) {
}
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -581,7 +581,7 @@ for (size_t i = 0; i < num_terms; i++) {
This can be used to read and modify the observable’s bit terms. The resulting pointer is valid to read for `qk_obs_len(obs)` elements of size `uint8_t`.
-
+
#### Example
@@ -605,11 +605,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`, or if invalid values are written into the resulting `QkBitTerm` pointer.
@@ -627,7 +627,7 @@ for (size_t i = 0; i < num_terms; i++) {
Multiply the observable by a complex coefficient.
-
+
#### Example
@@ -637,11 +637,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *result = qk_obs_multiply(obs, &coeff);
```
-
+
#### Safety
-
+
Behavior is undefined if any of the following is violated
@@ -663,7 +663,7 @@ for (size_t i = 0; i < num_terms; i++) {
Multiply the observable in-place by a complex coefficient.
-
+
#### Example
@@ -673,11 +673,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_multiply_inplace(obs, &coeff);
```
-
+
#### Safety
-
+
Behavior is undefined if any of the following is violated
@@ -695,7 +695,7 @@ for (size_t i = 0; i < num_terms; i++) {
Add two observables.
-
+
#### Example
@@ -705,11 +705,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *result = qk_obs_add(left, right);
```
-
+
#### Safety
-
+
Behavior is undefined if `left` or `right` are not valid, non-null pointers to `QkObs`\ s.
@@ -728,7 +728,7 @@ for (size_t i = 0; i < num_terms; i++) {
Add an observable to an existing one.
-
+
#### Example
@@ -738,11 +738,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_add_inplace(left, right);
```
-
+
#### Safety
-
+
Behavior is undefined if `left` or `right` are not valid, non-null pointers to `QkObs`\ s.
@@ -757,7 +757,7 @@ for (size_t i = 0; i < num_terms; i++) {
Add two observables while scaling the coefficients of the right one.
-
+
#### Example
@@ -768,11 +768,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *result = qk_obs_scaled_add(left, right, &factor);
```
-
+
#### Safety
-
+
Behavior is undefined if `left` or `right` are not valid, non-null pointers to `QkObs`\ s.
@@ -792,7 +792,7 @@ for (size_t i = 0; i < num_terms; i++) {
Add a scaled observable to an existing one.
-
+
#### Example
@@ -803,11 +803,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_scaled_add_inplace(left, right, &factor);
```
-
+
#### Safety
-
+
Behavior is undefined if `left` or `right` are not valid, non-null pointers to `QkObs`\ s.
@@ -823,7 +823,7 @@ for (size_t i = 0; i < num_terms; i++) {
Compose (multiply) two observables.
-
+
#### Example
@@ -833,11 +833,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *result = qk_obs_compose(first, second);
```
-
+
#### Safety
-
+
Behavior is undefined if `first` or `second` are not valid, non-null pointers to `QkObs`\ s.
@@ -858,7 +858,7 @@ for (size_t i = 0; i < num_terms; i++) {
Notably, this allows composing two observables of different size.
-
+
#### Example
@@ -868,11 +868,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *result = qk_obs_compose(first, second);
```
-
+
#### Safety
-
+
To call this function safely
@@ -897,11 +897,11 @@ for (size_t i = 0; i < num_terms; i++) {
The layout is set by an array `layout` of new indices, specifying that qubit at current index `i` is relabelled to index `layout[i]`. The number of qubits the observable acts on can be extended by setting a larger `num_qubits` than the current observable has.
-
+
#### Example
-
+
This interface allows to relabel and extend the qubit indices:
@@ -937,11 +937,11 @@ for (size_t i = 0; i < num_terms; i++) {
free(layout);
```
-
+
#### Safety
-
+
Behavior is undefined if `obs` is not a valid, non-null pointer to `QkObs` or if `layout` is not a valid, non-null pointer to a sequence of `qk_obs_num_qubits(obs)` consecutive elements of `uint32_t`.
@@ -966,7 +966,7 @@ for (size_t i = 0; i < num_terms; i++) {
Calculate the canonical representation of the observable.
-
+
#### Example
@@ -978,11 +978,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *canonical = qk_obs_canonicalize(two, tol);
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -1001,7 +1001,7 @@ for (size_t i = 0; i < num_terms; i++) {
Copy the observable.
-
+
#### Example
@@ -1010,11 +1010,11 @@ for (size_t i = 0; i < num_terms; i++) {
QkObs *copied = qk_obs_copy(original);
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -1034,7 +1034,7 @@ for (size_t i = 0; i < num_terms; i++) {
Note that this does not compare mathematical equality, but data equality. This means that two observables might represent the same observable but not compare as equal.
-
+
#### Example
@@ -1044,11 +1044,11 @@ for (size_t i = 0; i < num_terms; i++) {
bool are_equal = qk_obs_equal(observable, other);
```
-
+
#### Safety
-
+
Behavior is undefined if `obs` or `other` are not valid, non-null pointers to `QkObs`\ s.
@@ -1067,7 +1067,7 @@ for (size_t i = 0; i < num_terms; i++) {
Return a string representation of a `QkObs`.
-
+
#### Example
@@ -1078,11 +1078,11 @@ for (size_t i = 0; i < num_terms; i++) {
qk_obs_free(obs);
```
-
+
#### Safety
-
+
Behavior is undefined `obs` is not a valid, non-null pointer to a `QkObs`.
@@ -1104,11 +1104,11 @@ for (size_t i = 0; i < num_terms; i++) {
Free a string representation.
-
+
#### Safety
-
+
Behavior is undefined if `str` is not a pointer returned by `qk_obs_str` or `qk_obsterm_str`.
@@ -1124,11 +1124,11 @@ for (size_t i = 0; i < num_terms; i++) {
It is not safe to use the `QkObs` pointer after calling this function. In particular, you should not attempt to clear or free it. The caller must own the `QkObs`, not hold a borrowed reference (for example, a `QkObs *` retrieved from `qk_obs_borrow_from_python` is not owned).
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `obs` is not a valid non-null pointer to an initialized and owned `QkObs`.
@@ -1152,11 +1152,11 @@ for (size_t i = 0; i < num_terms; i++) {
You can also use `qk_obs_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -1180,11 +1180,11 @@ for (size_t i = 0; i < num_terms; i++) {
You can also use `qk_obs_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
diff --git a/docs/api/qiskit-c/dev/qk-param.mdx b/docs/api/qiskit-c/dev/qk-param.mdx
index ffcb085b308..cbc9dff83f7 100644
--- a/docs/api/qiskit-c/dev/qk-param.mdx
+++ b/docs/api/qiskit-c/dev/qk-param.mdx
@@ -19,7 +19,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Construct a new `QkParam` representing an unbound symbol.
-
+
#### Example
@@ -27,11 +27,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
QkParam *a = qk_param_new_symbol("a");
```
-
+
#### Safety
-
+
The `name` parameter must be a pointer to memory that contains a valid nul terminator at the end of the string. It also must be valid for reads of bytes up to and including the nul terminator.
@@ -51,7 +51,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
The `QkParam` returned from this function can be used to store the result of binary or unary operations.
-
+
#### Example
@@ -72,7 +72,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Free the `QkParam`.
-
+
#### Example
@@ -81,11 +81,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_free(a);
```
-
+
#### Safety
-
+
Behavior is undefined if `param` is not either null or a valid pointer to a `QkParam`.
@@ -99,7 +99,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Construct a new `QkParam` from a `double`.
-
+
#### Example
@@ -121,7 +121,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Construct a new `QkParam` from a complex number, given as `QkComplex64`.
-
+
#### Example
@@ -144,7 +144,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Copy a `QkParam`.
-
+
#### Example
@@ -153,11 +153,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
QkParam *b = qk_param_copy(a);
```
-
+
#### Safety
-
+
The behavior is undefined if `param` is not a valid pointer to a non-null `QkParam`.
@@ -175,7 +175,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Get a string representation of the `QkParam`.
-
+
#### Example
@@ -187,11 +187,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_free(a);
```
-
+
#### Safety
-
+
The behavior is undefined if `param` is not a valid pointer to a non-null `QkParam`.
@@ -213,7 +213,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Add two `QkParam`.
-
+
#### Example
@@ -224,11 +224,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_add(out, a, b);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out`, `lhs` or `rhs` is not a valid, non-null pointer to a `QkParam`.
@@ -248,7 +248,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Subtract two `QkParam`.
-
+
#### Example
@@ -259,11 +259,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_sub(out, a, b);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out`, `lhs` or `rhs` is not a valid, non-null pointer to a `QkParam`.
@@ -283,7 +283,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Multiply two `QkParam`.
-
+
#### Example
@@ -294,11 +294,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_mul(out, a, b);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out`, `lhs` or `rhs` is not a valid, non-null pointer to a `QkParam`.
@@ -318,7 +318,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Divide a `QkParam` by another.
-
+
#### Example
@@ -329,11 +329,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_div(out, a, b);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out`, `num` or `den` is not a valid, non-null pointer to a `QkParam`.
@@ -353,7 +353,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Raise a `QkParam` to the power of another.
-
+
#### Example
@@ -364,11 +364,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_pow(out, base, pow);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out`, `base` or `pow` is not a valid, non-null pointer to a `QkParam`.
@@ -388,7 +388,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the sine of a `QkParam`.
-
+
#### Example
@@ -398,11 +398,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_sin(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -421,7 +421,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the cosine of a `QkParam`.
-
+
#### Example
@@ -431,11 +431,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_cos(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -454,7 +454,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the tangent of a `QkParam`.
-
+
#### Example
@@ -464,11 +464,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_tan(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -487,7 +487,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the arcsine of a `QkParam`.
-
+
#### Example
@@ -497,11 +497,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_asin(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -520,7 +520,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the arccosine of a `QkParam`.
-
+
#### Example
@@ -530,11 +530,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_acos(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -553,7 +553,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the arctangent of a `QkParam`.
-
+
#### Example
@@ -563,11 +563,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_atan(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -586,7 +586,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the natural logarithm of a `QkParam`.
-
+
#### Example
@@ -596,11 +596,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_log(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -619,7 +619,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Apply the exponential function to a `QkParam`.
-
+
#### Example
@@ -629,11 +629,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_exp(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -652,7 +652,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the absolute value of a `QkParam`.
-
+
#### Example
@@ -662,11 +662,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_abs(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -685,7 +685,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Get the sign of a `QkParam`.
-
+
#### Example
@@ -695,11 +695,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_sign(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -718,7 +718,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Negate a `QkParam`.
-
+
#### Example
@@ -728,11 +728,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_neg(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -751,7 +751,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Calculate the complex conjugate of a `QkParam`.
-
+
#### Example
@@ -761,11 +761,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
qk_param_conjugate(out, a);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `out` or `src` is not a valid, non-null pointer to a `QkParam`.
@@ -784,7 +784,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
Compare two `QkParam` for equality.
-
+
#### Example
@@ -799,11 +799,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
bool equal = qk_param_equal(x, y);
```
-
+
#### Safety
-
+
The behavior is undefined if any of `lhs` or `rhs` is not a valid, non-null pointer to a `QkParam`.
@@ -824,7 +824,7 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
If the parameter could not be cast to a `double`, because there were unbound parameters, `NAN` is returned. Note that for `QkParam` representing complex values the real part is returned.
-
+
#### Example
@@ -841,11 +841,11 @@ While functionality for a `QkParam` within a circuit is currently limited, a use
double out = qk_param_as_real(y);
```
-
+
#### Safety
-
+
The behavior is undefined if `param` is not a valid, non-null pointer to a `QkParam`.
diff --git a/docs/api/qiskit-c/dev/qk-target-entry.mdx b/docs/api/qiskit-c/dev/qk-target-entry.mdx
index baf88ffa3c4..26cb7ef1352 100644
--- a/docs/api/qiskit-c/dev/qk-target-entry.mdx
+++ b/docs/api/qiskit-c/dev/qk-target-entry.mdx
@@ -41,7 +41,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Creates an entry to the `QkTarget` based on a `QkGate` instance.
-
+
#### Example
@@ -63,7 +63,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Creates a new entry for adding a measurement instruction to a `QkTarget`.
-
+
#### Example
@@ -91,7 +91,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Creates a new entry for adding a reset instruction to a `QkTarget`.
-
+
#### Example
@@ -119,7 +119,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Creates an entry in the `QkTarget` based on a `QkGate` instance with no parameters.
-
+
#### Example
@@ -128,11 +128,11 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
QkTargetEntry *entry = qk_target_entry_new_fixed(QkGate_CRX, crx_params, "crx_fixed")";
```
-
+
#### Safety
-
+
The `params` type is expected to be a pointer to an array of `double` where the length matches the expectations of the `QkGate`. If the array is insufficiently long the behavior of this function is undefined as this will read outside the bounds of the array. It can be a null pointer if there are no params for a given gate. You can check `qk_gate_num_params` to determine how many qubits are required for a given gate.
@@ -158,7 +158,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Retrieves the number of properties stored in the target entry.
-
+
#### Example
@@ -168,11 +168,11 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
size_t props_size = qk_target_entry_num_properties(entry);
```
-
+
#### Safety
-
+
The behavior is undefined if `entry` is not a valid, non-null pointer to a `QkTargetEntry` object.
@@ -190,7 +190,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Frees the entry.
-
+
#### Example
@@ -199,11 +199,11 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
qk_target_entry_free(entry);
```
-
+
#### Safety
-
+
The behavior is undefined if `entry` is not a valid, non-null pointer to a `QkTargetEntry` object.
@@ -221,7 +221,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Adds an instruction property instance based on its assigned qargs.
-
+
#### Example
@@ -231,11 +231,11 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
qk_target_entry_add_property(entry, qargs, 2, 0.0, 0.1);
```
-
+
#### Safety
-
+
The behavior is undefined if `entry` is not a valid, non-null pointer to a `QkTargetEntry` object.
@@ -257,7 +257,7 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
Sets a custom name to the target entry.
-
+
#### Example
@@ -266,11 +266,11 @@ qk_target_entry_add_property(entry, NULL, 0, NAN, 0.003);
qk_target_entry_set_name(entry, "cx_gate");
```
-
+
#### Safety
-
+
The behavior is undefined if `entry` is not a valid, non-null pointer to a `QkTargetEntry` object. The `name` pointer is expected to be either a C string comprising of valid UTF-8 characters or a null pointer.
diff --git a/docs/api/qiskit-c/dev/qk-target.mdx b/docs/api/qiskit-c/dev/qk-target.mdx
index d9c52dda8e5..428ed31b6cf 100644
--- a/docs/api/qiskit-c/dev/qk-target.mdx
+++ b/docs/api/qiskit-c/dev/qk-target.mdx
@@ -106,7 +106,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Construct a new `QkTarget` with the given number of qubits. The number of qubits is bound to change if an instruction is added with properties that apply to a collection of qargs in which any index is higher than the specified number of qubits
-
+
#### Example
@@ -134,11 +134,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
You can also use `qk_target_convert_from_python`, which is logically the exact same as this function, but can be directly used as a “converter” function for the `PyArg_Parse*` family of Python converter functions.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `ob` is not a valid non-null pointer to a Python object.
@@ -162,11 +162,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
You can also use `qk_target_borrow_from_python`, which is logically the exact same as this, but with a more natural signature for direct usage.
-
+
#### Safety
-
+
The caller must be attached to a Python interpreter. Behavior is undefined if `object` is not a valid non-null pointer to a Python object, or if `address` is not a pointer to writeable data of the correct type.
@@ -185,7 +185,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the number of qubits of this `QkTarget`.
-
+
#### Example
@@ -194,11 +194,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
uint32_t num_qubits = qk_target_num_qubits(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -216,7 +216,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the dt value of this `QkTarget`.
-
+
#### Example
@@ -226,11 +226,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
double dt = qk_target_dt(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -248,7 +248,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the granularity value of this `QkTarget`.
-
+
#### Example
@@ -258,11 +258,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
uint32_t granularity = qk_target_granularity(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -280,7 +280,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the `min_length` value of this `QkTarget`.
-
+
#### Example
@@ -290,11 +290,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
size_t min_length = qk_target_min_length(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -312,7 +312,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the `pulse_alignment` value of this `QkTarget`.
-
+
#### Example
@@ -322,11 +322,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
uint32_t pulse_alignment = qk_target_pulse_alignment(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -344,7 +344,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the `acquire_alignment` value of this `QkTarget`.
-
+
#### Example
@@ -354,11 +354,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
uint32_t acquire_alignment = qk_target_pulse_alignment(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -376,7 +376,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Sets the dt value of this `QkTarget`.
-
+
#### Example
@@ -385,11 +385,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
double dt = qk_target_set_dt(target, 10e-9);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -408,7 +408,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Sets the `granularity` value of this `QkTarget`.
-
+
#### Example
@@ -418,11 +418,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_set_granularity(target, 2);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -441,7 +441,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Sets the `min_length` value of this `QkTarget`.
-
+
#### Example
@@ -451,11 +451,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_set_min_length(target, 3);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -474,7 +474,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the `pulse_alignment` value of this `QkTarget`.
-
+
#### Example
@@ -484,11 +484,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_set_pulse_alignment(target, 4);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -507,7 +507,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Sets the `acquire_alignment` value of this `QkTarget`.
-
+
#### Example
@@ -517,11 +517,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_set_acquire_alignment(target, 5);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -540,7 +540,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Creates a copy of the `QkTarget`.
-
+
#### Example
@@ -554,11 +554,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
QkTarget *copied = qk_target_copy(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -576,7 +576,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Free the `QkTarget`.
-
+
#### Example
@@ -585,11 +585,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -603,7 +603,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Adds a gate to the `QkTarget` through a `QkTargetEntry`.
-
+
#### Example
@@ -615,11 +615,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
QkExitCode result = qk_target_add_instruction(target, entry);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -640,7 +640,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Modifies the properties of a gate in the `QkTarget`.
-
+
#### Example
@@ -655,11 +655,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_update_property(target, QkGate_CRX, qargs, 2, 0.0012, 1.1);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -684,7 +684,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Returns the number of instructions tracked by a `QkTarget`.
-
+
#### Example
@@ -696,11 +696,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
size_t num_instructions = qk_target_num_instructions(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -718,7 +718,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Checks if the provided instruction and its qargs are supported by this `Target`.
-
+
#### Example
@@ -740,11 +740,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `target` is not a valid, non-null pointer to a `QkTarget`.
@@ -769,7 +769,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Return the index at which an operation is located based on its name.
-
+
#### Example
@@ -781,11 +781,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
size_t op_idx = qk_target_op_index(target, "h");
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`. Behavior is undefined if `name` is not a pointer to a valid null-terminated string.
@@ -804,7 +804,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Return the name of the operation stored at that index in the `QkTarget` instance’s gate map.
-
+
#### Example
@@ -818,11 +818,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_str_free(op_name);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -841,7 +841,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Return the number of properties defined for the specified operation in the `QkTarget` instance, a.k.a. the length of the property map. Panics if the operation index is not present.
-
+
#### Example
@@ -853,11 +853,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
size_t num_props = qk_target_op_num_properties(target, 0);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -876,7 +876,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Retrieve the index at which some qargs are stored. Returns `SIZE_MAX` if not found.
-
+
#### Example
@@ -891,11 +891,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
size_t idx_0_1 = qk_target_op_qargs_index(target, 0, qargs);
```
-
+
#### Safety
-
+
Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`.
@@ -917,7 +917,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Panics if any of the indices are out of range.
-
+
#### Example
@@ -940,11 +940,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
}
```
-
+
#### Safety
-
+
Behavior is undefined if `target` is not a valid, non-null pointer to a `QkTarget`. Behavior is undefined if each `qargs_out` or `qargs_len` are not aligned and writeable for a single value of the correct type.
@@ -964,7 +964,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Panics if any of the indices are out of range.
-
+
#### Example
@@ -980,11 +980,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_op_props(target, 0, 0, &inst_props);
```
-
+
#### Safety
-
+
Behavior is undefined if `target` is not a valid, non-null pointer to a `QkTarget`. Behavior is undefined if `inst_props` does not point to an address of the correct size to store `QkInstructionProperties` in.
@@ -1001,7 +1001,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Retrieves information about an operation in the Target via index. If the index is not present, this function will panic. You can check the `QkTarget` total number of instructions using `qk_target_num_instructions`.
-
+
#### Example
@@ -1020,11 +1020,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_op_clear(&op);
```
-
+
#### Safety
-
+
Behavior is undefined if `target` is not a valid, non-null pointer to a `QkTarget`. Behavior is undefined if `out_op` does not point to an address of the correct size to store `QkTargetOp` in.
@@ -1040,7 +1040,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Tries to retrieve a `QkGate` based on the operation stored in an index. The user is responsible for checking whether this operation is a gate in the `QkTarget` via using `qk_target_op_get`. If not, this function will panic.
-
+
#### Example
@@ -1065,11 +1065,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
qk_target_op_clear(&op);
```
-
+
#### Safety
-
+
Behavior is undefined if the `target` pointer is null or not aligned.
@@ -1088,11 +1088,11 @@ The Target C API currently only supports additions of `QkGate` instances with ei
Clears the `QkTargetOp` object.
-
+
#### Safety
-
+
The behavior will be undefined if the pointer is null or not-aligned. The data belonging to a `QkTargetOp` originates in Rust and can only be freed using this function.
diff --git a/docs/api/qiskit-c/dev/qk-transpile-layout.mdx b/docs/api/qiskit-c/dev/qk-transpile-layout.mdx
index b3ef99a9497..369d88196ff 100644
--- a/docs/api/qiskit-c/dev/qk-transpile-layout.mdx
+++ b/docs/api/qiskit-c/dev/qk-transpile-layout.mdx
@@ -79,11 +79,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
Return the number of qubits in the input circuit to the transpiler.
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`.
@@ -101,11 +101,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
Return the number of qubits in the output circuit from the transpiler.
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`.
@@ -131,11 +131,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
indicates that the layout maps virtual qubit 0 -> physical qubit 1, virtual qubit 1 -> physical qubit -> 0, and virtual qubit 2 -> physical qubit 2.
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`. `initial_layout` must be a valid, non-null pointer with a large enough allocation to store the size necessary for the initial layout. If `filter_ancillas` is true this will be number of input qubits (which can be checked with `qk_transpile_layout_num_input_qubits()`) or the number of output qubits if `filter_ancillas` is false (which can be queried with `qk_transpile_layout_num_output_qubits()`).
@@ -163,11 +163,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
indicates that qubit 0 from the start of the circuit is at qubit 1 at the end of the circuit, 1 -> 2, and 2 -> 0.
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`. `output_permutation` must be a valid, non-null pointer with a large enough allocation to store the size necessary for the output\_permutation. This will always be the number of output qubits in the `QkTranspileLayout` which can be queried with `qk_transpile_layout_num_output_qubits()`.
@@ -194,11 +194,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
indicates that virtual qubit 0’s state in the original circuit is on physical qubit 2 at the end of the transpiled circuit, 1 -> 0, and 2 -> 1.
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`. `final_layout` must be a valid, non-null pointer with a large enough allocation to store the size necessary for the final layout. If `filter_ancillas` is true this will be number of input qubits (which can be checked with `qk_transpile_layout_num_input_qubits()`) or the number of output qubits if `filter_ancillas` is false (which can be queried with `qk_transpile_layout_num_output_qubits()`).
@@ -216,11 +216,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
This will generate a `QkTranspileLayout` with the initial layout set (and no ouptput permutation) from a provided mapping. The intent of this function is to enable creating a custom layout pass that also creates a `QkTranspileLayout` that you can use with subsequent stage functions such as `qk_transpile_stage_routing`.
-
+
#### Safety
-
+
Behavior is undefined if `original_dag` and target `target` are not a valid, aligned, non-null pointer to a `QkDag` or a `QkTarget` respectively. `qubit_mapping` must be a valid pointer to a contiguous array of `uint32_t` with enough space for the number of qubits indicated in `target`.
@@ -240,11 +240,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
Free a `QkTranspileLayout` object
-
+
#### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkTranspileLayout`.
@@ -260,11 +260,11 @@ The transpiler will also allocate ancilla qubits to the circuit if the target ha
The created Python-space object is a copy of the `QkTranspileLayout` provided, the data representation is different between C and Python and the data is not moved to Python like for some other `*_to_python` functions.
-
+
#### Safety
-
+
Behavior is undefined if `layout` and `circuit` are not valid, non-null pointers to a `QkTranspileLayout` and `QkCircuit` respectively. It is assumed that the thread currently executing this function holds the Python GIL. This is required to create the Python object returned by this function.
diff --git a/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx b/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx
index 87ddf0dfb1e..8aa0e37449c 100644
--- a/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx
+++ b/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx
@@ -27,7 +27,7 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
This pass is intended to be run before a layout (mapping virtual qubits to physical qubits) is set during the transpilation pipeline. This pass iterates over the DAG and when a Swap gate is encountered it permutes the virtual qubits in the DAG and removes the swap gate. This will effectively remove any swap gates in the DAG prior to running layout. This optimization is not valid after a layout has been set and should not be run in this case.
-
+
#### Example
@@ -49,11 +49,11 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
qk_dag_free(dag);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDAG`.
@@ -73,7 +73,7 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
The pass checks if the directions of two-qubit gates comply with the gate directions specified in a given target.
-
+
#### Example
@@ -96,11 +96,11 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `target` are not valid, non-null pointers to `QkDag` and `QkTarget` objects, respectively.
@@ -121,7 +121,7 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
The GateDirection pass modifies asymmetric gates to match the hardware coupling directions. This pass supports replacements for the `cx`, `cz`, `ecr`, `swap`, `rzx`, `rxx`, `ryy` and `rzz` gates, using predefined identities.
-
+
#### Example
@@ -145,11 +145,11 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `target` are not valid, non-null pointers to `QkDag` and `QkTarget` objects, respectively.
@@ -176,7 +176,7 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Example
@@ -208,11 +208,11 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
qk_quantum_register_free(qr);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag` and if `target` is not a valid pointer to a `QkTarget`.
@@ -229,7 +229,7 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
Transpiler pass to remove diagonal gates (like RZ, T, Z, etc) before a measurement. Including diagonal 2Q gates.
-
+
#### Example
@@ -248,11 +248,11 @@ The Qiskit C API provides transpiler pass functions in two forms: ones that oper
qk_classical_register_free(cr);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDag`.
@@ -281,7 +281,7 @@ $$
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the RAYON\_NUM\_THREADS environment variable. For example, setting RAYON\_NUM\_THREADS=4 would limit the thread pool to 4 threads.
-
+
#### Example
@@ -314,11 +314,11 @@ $$
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `target` is not a valid, non-null pointer to a `QkDag` and `QkTarget`.
@@ -334,11 +334,11 @@ $$
Run the Split2QUnitaries transpiler pass on a DAG Circuit
-
+
#### Safety
-
+
Behavior is undefined if `dag` is not a valid, non-null pointer to a `QkDAG`.
@@ -366,7 +366,7 @@ $$
This pass is multithreaded, and will perform the analysis in parallel and use all the cores available on your local system. You can refer to the [configuration guide](/docs/guides/configure-qiskit-local) for details on how to control the threading behavior for Qiskit more broadly which will also control this pass
-
+
#### Example
@@ -399,11 +399,11 @@ $$
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `target` is not a valid, non-null pointer to a `QkDag` and `QkTarget`.
@@ -425,7 +425,7 @@ $$
The BasisTranslator transpiler pass translates gates to a target basis by searching for a set of translations from the standard EquivalenceLibrary.
-
+
#### Example
@@ -450,11 +450,11 @@ $$
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` and/or `target` are not valid, non-null pointers to a `QkCircuit` or `QkTarget`.
@@ -474,7 +474,7 @@ $$
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Example
@@ -487,11 +487,11 @@ $$
qk_transpiler_pass_standalone_commutative_cancellation(qc, NULL, 1.0);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, `QkCircuit` and `QkTarget`. `QkCircuit` is not expected to be null and behavior is undefined if it is.
@@ -513,11 +513,11 @@ $$
ConsolidateBlocks is a transpiler pass that consolidates consecutive blocks of gates operating on the same qubits into a Unitary gate, to later on be resynthesized, which leads to a more optimal subcircuit.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit` and if `target` is not a valid pointer to a `QkTarget`.
@@ -536,11 +536,11 @@ $$
This pass converts all standard gates (with less than 4 qubits) in the circuit into a sequence of `QkPauliProductRotation` gates and measurements into `QkPauliProductMeasurement` instructions. Note that this pass panics if the circuit contains non-standard gates. The suggested workflow is to first transpile into a standard basis, keeping rotation gates (such as `QkGate_RXX` and others) intact where possible, and then call this pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not valid, non-null pointers to a `QkCircuit`.
@@ -556,11 +556,11 @@ $$
Refer to the `qk_transpiler_pass_elide_permutations` function for more details about the pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit`.
@@ -580,11 +580,11 @@ $$
Refer to the `qk_transpiler_pass_check_gate_direction` function for more details about the pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` are not valid, non-null pointers to `QkCircuit` and `QkTarget` objects, respectively.
@@ -605,11 +605,11 @@ $$
Refer to the `qk_transpiler_pass_gate_direction` function for more details about the pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` are not valid, non-null pointers to `QkCircuit` and `QkTarget` objects, respectively.
@@ -649,7 +649,7 @@ $$
* (QkGate\_SX, QkGate\_SXdg)
* (QkGate\_CS, QkGate\_CSdg)
-
+
#### Example
@@ -663,11 +663,11 @@ $$
qk_transpiler_pass_standalone_inverse_cancellation(qc);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit`.
@@ -683,11 +683,11 @@ $$
This pass commutes all Clifford gates to the end of the circuit, converting Pauli rotation gates into `QkPauliProductRotation` gates and measurements into `QkPauliProductMeasurement` instructions. Note that this pass currently only supports circuits that have `QkGate_T`, `QkGate_Tdg` or `QkGate_RZ` gates as non-Cliffords and panics otherwise. The suggested workflow is to first transpile into a Clifford+RZ basis and then call this pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not valid, non-null pointers to a `QkCircuit`.
@@ -709,11 +709,11 @@ $$
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit` and if `target` is not a valid pointer to a `QkTarget`.
@@ -732,11 +732,11 @@ $$
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit` and if `target` is not a valid pointer to a `QkTarget`.
@@ -753,11 +753,11 @@ $$
Refer to the `qk_transpiler_pass_remove_diagonal_gates_before_measure` function for more details about the pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit`.
@@ -775,11 +775,11 @@ $$
This function is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the RAYON\_NUM\_THREADS environment variable. For example, setting RAYON\_NUM\_THREADS=4 would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`.
@@ -805,11 +805,11 @@ $$
This function is multithreaded and will launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### References
-
+
\[1] Henry Zou and Matthew Treinish and Kevin Hartman and Alexander Ivrii and Jake Lishman. “LightSABRE: A Lightweight and Enhanced SABRE Algorithm” [arXiv:2409.08368](https://doi.org/10.48550/arXiv.2409.08368)
@@ -819,11 +819,11 @@ $$
[arXiv:1809.02573](https://arxiv.org/pdf/1809.02573.pdf)
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`.
@@ -845,11 +845,11 @@ $$
Refer to the `qk_transpiler_pass_split_2q_unitaries` function for more details about the pass.
-
+
#### Safety
-
+
Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit`.
@@ -873,7 +873,7 @@ $$
This function is multithreaded, and will perform the analysis in parallel and use all the cores available on your local system. You can refer to the [configuration guide](/docs/guides/configure-qiskit-local) for details on how to control the threading behavior for Qiskit more broadly which will also control this pass
-
+
#### Example
@@ -903,11 +903,11 @@ $$
qk_target_free(target);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`.
@@ -929,7 +929,7 @@ $$
This pass is multithreaded and will potentially launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Example
@@ -956,11 +956,11 @@ $$
qk_transpiler_pass_standalone_unitary_synthesis(qc, target, 0, 1.0);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`.
@@ -983,7 +983,7 @@ $$
If this pass finds a solution that means there is a “perfect layout” and that no further swap mapping or routing is needed. However, there is not always a possible solution, or a solution might exist but it is not found within the limits specified when the pass is called.
-
+
#### Example
@@ -1012,11 +1012,11 @@ $$
qk_vf2_layout_configuration_free(config);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`. Behavior is undefined if `config` is a non-null pointer that does not point to a valid `QkVF2LayoutConfiguration` object (but a null pointer is fine).
@@ -1049,7 +1049,7 @@ $$
In both of the first two cases, `qk_vf2_layout_has_match` will return `true`. In only the first case, `qk_vf2_layout_has_improvement` will return `true`.
-
+
#### Example
@@ -1077,11 +1077,11 @@ $$
qk_vf2_layout_configuration_free(config);
```
-
+
#### Safety
-
+
Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`. Behavior is undefined if `config` is a non-null pointer that does not point to a valid `QkVF2LayoutConfiguration` object (but a null pointer is fine).
@@ -1107,11 +1107,11 @@ $$
Replaced by [`qk_transpiler_pass_standalone_vf2_layout_average()`](#qk_transpiler_pass_standalone_vf2_layout_average "qk_transpiler_pass_standalone_vf2_layout_average").
-
+
#### Safety
-
+
The safety requirements of `qk_transpiler_pass_standalone_vf2_layout_average` must be respected for `circuit` and `target`.
diff --git a/docs/api/qiskit-c/dev/qk-transpiler.mdx b/docs/api/qiskit-c/dev/qk-transpiler.mdx
index be6ae85c0fb..1ab418c42d7 100644
--- a/docs/api/qiskit-c/dev/qk-transpiler.mdx
+++ b/docs/api/qiskit-c/dev/qk-transpiler.mdx
@@ -67,11 +67,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
>
> Create a pointer to an empty `QkTranspilerStageState` object
>
->
+>
>
> #### Safety
>
->
+>
>
> Behavior is undefined if `state` is not a valid pointer allocated.
>
@@ -85,11 +85,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
>
> Free a `QkTranspilerStageState` object
>
->
+>
>
> #### Safety
>
->
+>
>
> Behavior is undefined if `state` is not a valid, non-null pointer to a `QkTranspilerStageState`.
>
@@ -105,11 +105,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
>
> This pointer is owned by the `state` object and should not be freed using `qk_transpile_layout_free`. Instead, free the original `state` object using `qk_transpile_state_free`.
>
->
+>
>
> #### Safety
>
->
+>
>
> Behavior is undefined if `state` is not a valid, non-null pointer to a `QkTranspilerStageState`.
>
@@ -129,11 +129,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
>
> Calling this method consumes the `QkTranspileLayout` object which means the user will not need to call `qk_transpile_layout_free`. The user should still de-allocate the space allotted for it using `free`.
>
->
+>
>
> #### Safety
>
->
+>
>
> Behavior is undefined if `state` is not a valid, non-null pointer to a `QkTranspilerStageState`. Behavior is undefined if `state` is not a valid pointer to a `QkTranspileLayout`.
>
@@ -168,11 +168,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `dag`, `target`, or `state`, are not valid, non-null pointers to a `QkDag`, `QkTarget`, or a `QkTranspileLayout` pointer respectively. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`. The value of the inner pointer for `state` will be overwritten by this function. If the value pointed to needs to be freed this must be done outside of this function as it will not be freed by this function.
@@ -200,11 +200,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `dag`, `target`, or `layout`, are not valid, non-null pointers to a `QkDag`, `QkTarget`, or a `QkTranspileLayout` pointer respectively. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`.
@@ -232,11 +232,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `dag` and `target` are not valid, non-null pointers to a `QkDag`, or a `QkTarget` respectively. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`.
@@ -264,11 +264,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `dag` and `target` are not valid, non-null pointers to a `QkDag`, `QkTarget` respectively. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`.
@@ -295,11 +295,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `dag` or `target`, are not valid, non-null pointers to a `QkDag`, or a `QkTarget` respectively. Behavior is also undefined if `layout` is not a valid, aligned, pointer to a pointer to a `QkTranspileLayout` or a pointer to a `NULL` pointer. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`.
@@ -325,11 +325,11 @@ A container collecting individual attributes shared by the transpiler stages. Wh
This function is multithreaded internally and will launch a thread pool with threads equal to the number of CPUs reported by the operating system by default. This will include logical cores on CPUs with simultaneous multithreading. You can tune the number of threads with the `RAYON_NUM_THREADS` environment variable. For example, setting `RAYON_NUM_THREADS=4` would limit the thread pool to 4 threads.
-
+
#### Safety
-
+
Behavior is undefined if `circuit`, `target`, or `result`, are not valid, non-null pointers to a `QkCircuit`, `QkTarget`, or `QkTranspileResult` respectively. `options` must be a valid pointer a to a `QkTranspileOptions` or `NULL`. `error` must be a valid pointer to a `char` pointer or `NULL`.
diff --git a/docs/api/qiskit-c/dev/qk-vf-2-layout.mdx b/docs/api/qiskit-c/dev/qk-vf-2-layout.mdx
index 4da83d82091..6adeb786f6a 100644
--- a/docs/api/qiskit-c/dev/qk-vf-2-layout.mdx
+++ b/docs/api/qiskit-c/dev/qk-vf-2-layout.mdx
@@ -33,11 +33,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
Free a `QkVf2LayoutConfiguration` object.
-
+
#### Safety
-
+
Behavior is undefined if `config` is a non-null pointer, but does not point to a valid, aligned `QkVF2LayoutConfiguration` object.
@@ -53,11 +53,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
The VF2 algorithm keeps track of the number of steps it has taken, and terminates when it reaches the limit. After the first match is found, the limit swaps from the “before” limit to the “after” limit without resetting the number of steps taken.
-
+
#### Safety
-
+
Behavior is undefined if `config` is not a valid, aligned, non-null pointer to a `QkVF2LayoutConfiguration`.
@@ -75,11 +75,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
This is not a hard limit; it is only checked when an improved layout is encountered. Using this option also makes the pass non-deterministic. It is generally recommended to use `qk_vf2_layout_configuration_set_call_limit` instead.
-
+
#### Safety
-
+
Behavior is undefined if `config` is not a valid, aligned, non-null pointer to a `QkVF2LayoutConfiguration`.
@@ -96,11 +96,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
Since the VF2 search tree is pruned on-the-fly based on scoring in the `QkTarget`, this limit is not especially powerful. See `qk_vf2_layout_configuration_set_call_limit` for a tighter bound.
-
+
#### Safety
-
+
Behavior is undefined if `config` is not a valid, aligned, non-null pointer to a `QkVF2LayoutConfiguration`.
@@ -119,11 +119,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
If this function was not called, no node shuffling takes place.
-
+
#### Safety
-
+
Behavior is undefined if `config` is not a valid, aligned, non-null pointer to a `QkVF2LayoutConfiguration`.
@@ -140,11 +140,11 @@ The configuration for the VF2 layout passes. This is an encapsulated configurati
You typically want to set this `true` if you are using the VF2 passes to improve a circuit that is already lowered to hardware, in order to set a baseline for the score-based pruning. If not, you can leave this as `false` (the default), to avoid a calculation that likely will not have any impact.
-
+
#### Safety
-
+
Behavior is undefined if `config` is not a valid, aligned, non-null pointer to a `VF2LayoutConfiguration`.
@@ -171,11 +171,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns
A `true` value includes the situation where the configuration specified to try the “trivial” layout and it was found to be the best (and consequently no qubit relabelling is necessary, other than ancilla expansion if appropriate). See `qk_vf2_layout_result_has_improvement` to distinguish whether an explicit remapping is stored.
-
+
##### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2LayoutResult`.
@@ -193,11 +193,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns
Check whether the result is an improvement to the trivial layout.
-
+
##### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2LayoutResult`.
@@ -215,11 +215,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns
Get the physical qubit for a given virtual qubit
-
+
##### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2LayoutResult` containing a result, or if the qubit is out of range for the initial circuit.
@@ -238,7 +238,7 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns
Free a `QkVF2LayoutResult` object
-
+
##### Example
@@ -246,11 +246,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns
QkCircuit *qc = qk_circuit_new(1, 0);
```
-
+
##### Safety
-
+
Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2Layout`.
diff --git a/docs/api/qiskit-ibm-runtime/dev/batch.mdx b/docs/api/qiskit-ibm-runtime/dev/batch.mdx
index 6bf256a5c41..ac312efa6dc 100644
--- a/docs/api/qiskit-ibm-runtime/dev/batch.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/batch.mdx
@@ -100,7 +100,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### backend
-
+
Return backend for this session.
**Returns**
@@ -114,7 +114,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### cancel
-
+
Cancel all pending jobs in a session.
**Return type**
@@ -124,7 +124,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### close
-
+
Close the session so new jobs will no longer be accepted.
Close the session so new jobs will no longer be accepted, but existing queued or running jobs will run to completion. The session will be terminated once there are no more pending jobs.
@@ -136,7 +136,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### details
-
+
Return session details.
**Returns**
@@ -165,7 +165,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### from\_id
-
+
Construct a Session object with a given `session_id`.
For example:
@@ -202,7 +202,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### status
-
+
Return current session status.
**Returns**
@@ -222,7 +222,7 @@ python_api_name: qiskit_ibm_runtime.Batch
### usage
-
+
Return session usage in seconds.
Session usage is the time from when the first job starts until the session goes inactive, is closed, or when its last job completes, whichever happens last.
diff --git a/docs/api/qiskit-ibm-runtime/dev/estimator-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/estimator-v2.mdx
index 41c21e15232..430644a592c 100644
--- a/docs/api/qiskit-ibm-runtime/dev/estimator-v2.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/estimator-v2.mdx
@@ -91,7 +91,7 @@ python_api_name: qiskit_ibm_runtime.EstimatorV2
### backend
-
+
Return the backend the primitive query will be run on.
**Return type**
diff --git a/docs/api/qiskit-ibm-runtime/dev/executor.mdx b/docs/api/qiskit-ibm-runtime/dev/executor.mdx
index 421786bae33..4e31816f8cd 100644
--- a/docs/api/qiskit-ibm-runtime/dev/executor.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/executor.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.Executor
# Executor
-
+
Bases: `object`
Class for running [`QuantumProgram`](quantum-program-quantum-program "qiskit_ibm_runtime.quantum_program.QuantumProgram")\s.
@@ -60,7 +60,7 @@ python_api_name: qiskit_ibm_runtime.Executor
### backend
-
+
Return the backend the primitive query will be run on.
**Return type**
@@ -70,7 +70,7 @@ python_api_name: qiskit_ibm_runtime.Executor
### run
-
+
Run a quantum program.
**Parameters**
diff --git a/docs/api/qiskit-ibm-runtime/dev/noise-learner-noise-learner.mdx b/docs/api/qiskit-ibm-runtime/dev/noise-learner-noise-learner.mdx
index 3aaae0a643b..9d06d62a6e9 100644
--- a/docs/api/qiskit-ibm-runtime/dev/noise-learner-noise-learner.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/noise-learner-noise-learner.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner.NoiseLearner
# NoiseLearner
-
+
Bases: `object`
Class for executing noise learning experiments.
@@ -85,7 +85,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner.NoiseLearner
### backend
-
+
Return the backend the primitive query will be run on.
**Return type**
@@ -95,7 +95,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner.NoiseLearner
### run
-
+
Submit a request to the noise learner program.
This function breaks the given list of circuits into a list of unique layers, following the strategy set by the `twirling_strategy` field specified in the `options` (see `NoiseLearnerOptions` for more details) and sorting them based on the number of times they occur in the various circuits. Then, it runs the noise learning experiment for as many layers as specified by the `max_layers_to_learn` field in the `options`, prioritizing layers that occur more frequently.
diff --git a/docs/api/qiskit-ibm-runtime/dev/noise-learner-v3-noise-learner-v3.mdx b/docs/api/qiskit-ibm-runtime/dev/noise-learner-v3-noise-learner-v3.mdx
index 2e28fcaa942..23365095af2 100644
--- a/docs/api/qiskit-ibm-runtime/dev/noise-learner-v3-noise-learner-v3.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/noise-learner-v3-noise-learner-v3.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner_v3.NoiseLearnerV3
# NoiseLearnerV3
-
+
Bases: `object`
Class for executing noise learning experiments.
@@ -45,7 +45,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner_v3.NoiseLearnerV3
### backend
-
+
Return the backend the primitive query will be run on.
**Return type**
@@ -55,7 +55,7 @@ python_api_name: qiskit_ibm_runtime.noise_learner_v3.NoiseLearnerV3
### run
-
+
Submit a request to the noise learner program.
**Parameters**
diff --git a/docs/api/qiskit-ibm-runtime/dev/options-models-noise-learner-v3-options.mdx b/docs/api/qiskit-ibm-runtime/dev/options-models-noise-learner-v3-options.mdx
index e8afa2a67e9..b92ea9685f2 100644
--- a/docs/api/qiskit-ibm-runtime/dev/options-models-noise-learner-v3-options.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/options-models-noise-learner-v3-options.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.options_models.NoiseLearnerV3Options
# NoiseLearnerV3Options
-
+
Bases: `object`
Options for [`NoiseLearnerV3`](noise-learner-v3-noise-learner-v3 "qiskit_ibm_runtime.noise_learner_v3.NoiseLearnerV3").
diff --git a/docs/api/qiskit-ibm-runtime/dev/options-models-post-selection-options.mdx b/docs/api/qiskit-ibm-runtime/dev/options-models-post-selection-options.mdx
index 0e684b6afa1..5b9e3a8cfc7 100644
--- a/docs/api/qiskit-ibm-runtime/dev/options-models-post-selection-options.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/options-models-post-selection-options.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.options_models.PostSelectionOptions
# PostSelectionOptions
-
+
Bases: `object`
Options for post selecting results.
@@ -53,8 +53,6 @@ python_api_name: qiskit_ibm_runtime.options_models.PostSelectionOptions
both of the bits failed to flip. Keep every other shot.
See the dosctrings of `PostSelector` and `PostSelector.compute_mask()` for more details.
-
- Defaults to `node`.
### x\_pulse\_type
diff --git a/docs/api/qiskit-ibm-runtime/dev/qiskit-runtime-service.mdx b/docs/api/qiskit-ibm-runtime/dev/qiskit-runtime-service.mdx
index a2453cac36a..1ef5986a4f3 100644
--- a/docs/api/qiskit-ibm-runtime/dev/qiskit-runtime-service.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/qiskit-runtime-service.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
# QiskitRuntimeService
-
+
Bases: `object`
Class for interacting with the Qiskit Runtime service.
@@ -117,7 +117,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### active\_instance
-
+
Return the crn of the current active instance.
**Return type**
@@ -236,7 +236,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### delete\_job
-
+
Delete a runtime job.
Note that this operation cannot be reversed.
@@ -257,7 +257,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### instances
-
+
Return a list of instances available for the active account.
Return a list that contains a series of dictionaries with the following instance identifiers per instance: “crn”, “plan”, “name”.
@@ -273,7 +273,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### job
-
+
Retrieve a runtime job.
**Parameters**
@@ -296,7 +296,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### jobs
-
+
Retrieve all runtime jobs, subject to optional filtering.
**Parameters**
@@ -328,7 +328,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### least\_busy
-
+
Return the least busy available backend.
**Parameters**
@@ -418,7 +418,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService
### usage
-
+
Return usage information for the current active instance.
**Returns**
diff --git a/docs/api/qiskit-ibm-runtime/dev/runtime-job-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/runtime-job-v2.mdx
index 95de3aef69d..f251f22e907 100644
--- a/docs/api/qiskit-ibm-runtime/dev/runtime-job-v2.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/runtime-job-v2.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
# RuntimeJobV2
-
+
Bases: [`BasePrimitiveJob`](/docs/api/qiskit/qiskit.primitives.BasePrimitiveJob)\[[`PrimitiveResult`](/docs/api/qiskit/qiskit.primitives.PrimitiveResult), `Literal`\[‘INITIALIZING’, ‘QUEUED’, ‘RUNNING’, ‘CANCELLED’, ‘DONE’, ‘ERROR’]], `BaseRuntimeJob`
Representation of a runtime V2 primitive execution.
@@ -20,7 +20,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
* **job\_id** (*str*) – Job ID.
* **program\_id** (*str*) – ID of the program this job is for.
* **creation\_date** (*str | None*) – Job creation date, in UTC.
- * **result\_decoder** (*type\[ResultDecoder] | Sequence\[type\[ResultDecoder]] | None*) – A `ResultDecoder` subclass used to decode job results.
+ * **result\_decoder** (*type\[ResultDecoder] | Sequence\[type\[ResultDecoder]] | None*) – A `ResultDecoder` subclass used to decode job results, or a list of such subclasses. If more than one decoder is specified, they will be called in chain, with the output of the `n-th` decoder as the input of the `n+1-th` decoder. If not specified, the default `ResultDecoder` is used.
* **image** (*str | None*) – Runtime image used for this job: image\_name:tag.
* **service** ([*qiskit\_runtime\_service.QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – Runtime service.
* **session\_id** (*str | None*) – Job ID of the first job in a runtime session.
@@ -142,7 +142,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### backend
-
+
Return the backend where this job was executed. Retrieve data again if backend is None.
**Raises**
@@ -160,7 +160,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### cancel
-
+
Cancel the job.
**Raises**
@@ -175,7 +175,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### cancelled
-
+
Return whether the job has been cancelled.
**Return type**
@@ -185,7 +185,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### done
-
+
Return whether the job has successfully run.
**Return type**
@@ -195,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### error\_message
-
+
Returns the reason if the job failed.
**Returns**
@@ -209,7 +209,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### errored
-
+
Return whether the job has failed.
**Return type**
@@ -219,7 +219,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### in\_final\_state
-
+
Return whether the job is in a final job state such as `DONE` or `ERROR`.
**Return type**
@@ -239,7 +239,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### logs
-
+
Return job logs.
@@ -261,7 +261,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### metrics
-
+
Return job metrics.
**Returns**
@@ -283,7 +283,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### properties
-
+
Return the backend properties for this job.
**Parameters**
@@ -301,14 +301,14 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### result
-
+
Return the results of the job.
**Parameters**
* **timeout** (*float | None*) – Number of seconds to wait for job.
- * **decoder** (*type\[ResultDecoder] | None*) – A `ResultDecoder` subclass used to decode job results.
+ * **decoder** (*type\[ResultDecoder] | Sequence\[type\[ResultDecoder]] | None*) – A `ResultDecoder` subclass used to decode job results, or a list of such subclasses. If more than one decoder is specified, they will be called in chain, with the output of the `n-th` decoder as the input of the `n+1-th` decoder.
* **poll\_interval** (*float | None*) –
@@ -334,7 +334,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### running
-
+
Return whether the job is actively running.
**Return type**
@@ -344,7 +344,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### status
-
+
Return the status of the job.
**Returns**
@@ -358,7 +358,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### update\_tags
-
+
Update the tags associated with this job.
**Parameters**
@@ -380,7 +380,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### usage
-
+
Return job usage in seconds.
By default, the job usage returned is `0` until the usage calculation is completed. Accumulated intermediate usage can be returned by the method by using the `partial` flag.
@@ -400,7 +400,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeJobV2
### wait\_for\_final\_state
-
+
Poll for the job status from the API until the status is in a final state.
**Parameters**
diff --git a/docs/api/qiskit-ibm-runtime/dev/sampler-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/sampler-v2.mdx
index 34b780c00a1..2a8e2425157 100644
--- a/docs/api/qiskit-ibm-runtime/dev/sampler-v2.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/sampler-v2.mdx
@@ -59,7 +59,7 @@ python_api_name: qiskit_ibm_runtime.SamplerV2
### backend
-
+
Return the backend the primitive query will be run on.
**Return type**
diff --git a/docs/api/qiskit-ibm-runtime/dev/session.mdx b/docs/api/qiskit-ibm-runtime/dev/session.mdx
index c4dad2483ca..5cb638cff5a 100644
--- a/docs/api/qiskit-ibm-runtime/dev/session.mdx
+++ b/docs/api/qiskit-ibm-runtime/dev/session.mdx
@@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.Session
# Session
-
+
Bases: `object`
Class for creating a Qiskit Runtime session.
@@ -82,7 +82,7 @@ python_api_name: qiskit_ibm_runtime.Session
### backend
-
+
Return backend for this session.
**Returns**
@@ -96,7 +96,7 @@ python_api_name: qiskit_ibm_runtime.Session
### cancel
-
+
Cancel all pending jobs in a session.
**Return type**
@@ -106,7 +106,7 @@ python_api_name: qiskit_ibm_runtime.Session
### close
-
+
Close the session so new jobs will no longer be accepted.
Close the session so new jobs will no longer be accepted, but existing queued or running jobs will run to completion. The session will be terminated once there are no more pending jobs.
@@ -118,7 +118,7 @@ python_api_name: qiskit_ibm_runtime.Session
### details
-
+
Return session details.
**Returns**
@@ -147,7 +147,7 @@ python_api_name: qiskit_ibm_runtime.Session
### from\_id
-
+
Construct a Session object with a given `session_id`.
For example:
@@ -184,7 +184,7 @@ python_api_name: qiskit_ibm_runtime.Session
### status
-
+
Return current session status.
**Returns**
@@ -204,7 +204,7 @@ python_api_name: qiskit_ibm_runtime.Session
### usage
-
+
Return session usage in seconds.
Session usage is the time from when the first job starts until the session goes inactive, is closed, or when its last job completes, whichever happens last.
diff --git a/docs/api/qiskit/dev/capi.mdx b/docs/api/qiskit/dev/capi.mdx
index ec86360e39f..eec30d6c569 100644
--- a/docs/api/qiskit/dev/capi.mdx
+++ b/docs/api/qiskit/dev/capi.mdx
@@ -77,7 +77,7 @@ The Python package [`qiskit`](index#module-qiskit "qiskit") contains all of the
## Native bindings to the C API
-Additionally, this module contains [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes) bindings to all Qiskit C API types and functions. These are available as module attributes on [`qiskit.capi`](#module-qiskit.capi "qiskit.capi") with the same name as they have in the C API. For example, `qiskit.capi.qk_circuit_new` corresponds to [`qk_circuit_new()`](/docs/api/qiskit-c/qk-circuit#qk_circuit_new "qk_circuit_new").
+Additionally, this module contains [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes) bindings to all Qiskit C API types and functions. These are available as module attributes on [`qiskit.capi`](#module-qiskit.capi "qiskit.capi") with the same name as they have in the C API. For example, `qiskit.capi.qk_circuit_new` corresponds to [`qk_circuit_new()`](cdoc/qk-circuit#c.qk_circuit_new "qk_circuit_new").
### qiskit.capi.LIB
@@ -101,5 +101,5 @@ In places where the C API has an enumeration, this module declares a Python [`en
All the public library functions in the Qiskit C API are fully typed, and re-exported in the module root with the same name as they have in C. You can also access the functions from [`LIB`](#qiskit.capi.LIB "qiskit.capi.LIB"), if you prefer.
-Note that header-only functions, such as [`qk_import()`](/docs/api/qiskit-c/config#qk_import "qk_import"), are not exported because they are not part of the C API library object.
+Note that header-only functions, such as [`qk_import()`](cdoc/config#c.qk_import "qk_import"), are not exported because they are not part of the C API library object.
diff --git a/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx b/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx
index 76d1353f120..a0c96727417 100644
--- a/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx
+++ b/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx
@@ -12,7 +12,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
# [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class
-
+
Bases: [`object`](https://docs.python.org/3/library/functions.html#object)
Core Qiskit representation of a quantum circuit.
@@ -594,7 +594,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### \_\_init\_\_
-
+
Default constructor of [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
**Parameters**
@@ -646,7 +646,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### copy
-
+
Copy the circuit.
**Parameters**
@@ -666,7 +666,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### copy\_empty\_like
-
+
Return a copy of self with the same structure but empty.
That structure includes:
@@ -713,7 +713,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### from\_instructions
-
+
Construct a circuit from an iterable of [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s.
**Parameters**
@@ -738,7 +738,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### from\_qasm\_file
-
+
Read an OpenQASM 2.0 program from a file and convert to an instance of [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
**Parameters**
@@ -760,7 +760,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
### from\_qasm\_str
-
+
Convert a string containing an OpenQASM 2.0 program to a [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
**Parameters**
@@ -802,7 +802,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_bits
-
+
Add Bits to the circuit.
@@ -822,7 +822,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_register
-
+
Add registers.
@@ -842,7 +842,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_var
-
+
Add a classical variable with automatic storage and scope to this circuit.
The variable is considered to have been “declared” at the beginning of the circuit, but it only becomes initialized at the point of the circuit that you call this method, so it can depend on variables defined before it.
@@ -912,7 +912,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_input
-
+
Register a variable as an input to the circuit.
**Parameters**
@@ -936,7 +936,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_stretch
-
+
Declares a new stretch scoped to this circuit.
**Parameters**
@@ -974,7 +974,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_uninitialized\_var
-
+
Add a variable with no initializer.
In most cases, you should use [`add_var()`](#qiskit.circuit.QuantumCircuit.add_var "qiskit.circuit.QuantumCircuit.add_var") to initialize the variable. To use this function, you must already hold a [`Var`](circuit_classical#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") instance, as the use of the function typically only makes sense in copying contexts.
@@ -992,7 +992,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### add\_capture
-
+
Add an identifier to the circuit that it should capture from a scope it will be contained within.
This method requires a [`Var`](circuit_classical#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") or [`Stretch`](circuit_classical#qiskit.circuit.classical.expr.Stretch "qiskit.circuit.classical.expr.Stretch") node to enforce that you’ve got a handle to an identifier, because you will need to declare the same identifier using the same object in the outer circuit.
@@ -1014,7 +1014,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### find\_bit
-
+
Find locations in the circuit which can be used to reference a given [`Bit`](circuit#qiskit.circuit.Bit "qiskit.circuit.Bit").
In particular, this function can find the integer index of a qubit, which corresponds to its hardware index for a transpiled circuit.
@@ -1073,7 +1073,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### has\_register
-
+
Test if this circuit has the register r.
**Parameters**
@@ -1103,7 +1103,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### assign\_parameters
-
+
Assign parameters to new parameters or values.
If `parameters` is passed as a dictionary, the keys should be [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances in the current circuit. The values of the dictionary can either be numeric values or new parameter objects.
@@ -1183,7 +1183,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### has\_parameter
-
+
Check whether a parameter object exists in this circuit.
**Parameters**
@@ -1211,7 +1211,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### get\_parameter
-
+
Retrieve a compile-time parameter that is accessible in this circuit scope by name.
**Parameters**
@@ -1287,7 +1287,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### get\_var
-
+
Retrieve a variable that is accessible in this circuit scope by name.
**Parameters**
@@ -1337,7 +1337,7 @@ python_api_name: qiskit.circuit.QuantumCircuit
#### get\_stretch
-
+