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 - + Retrieve a stretch that is accessible in this circuit scope by name. **Parameters** @@ -1381,7 +1381,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### get\_identifier - + Retrieve an identifier that is accessible in this circuit scope by name. This currently includes both real-time classical variables and stretches. @@ -1416,7 +1416,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### has\_var - + Check whether a variable is accessible in this scope. **Parameters** @@ -1444,7 +1444,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### has\_stretch - + Check whether a stretch is accessible in this scope. **Parameters** @@ -1468,7 +1468,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### has\_identifier - + Check whether an identifier is accessible in this scope. **Parameters** @@ -1506,7 +1506,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_vars - + Get an iterable over all real-time classical variables in scope within this circuit. This method will iterate over all variables in scope. For more fine-grained iterators, see [`iter_declared_vars()`](#qiskit.circuit.QuantumCircuit.iter_declared_vars "qiskit.circuit.QuantumCircuit.iter_declared_vars"), [`iter_input_vars()`](#qiskit.circuit.QuantumCircuit.iter_input_vars "qiskit.circuit.QuantumCircuit.iter_input_vars") and [`iter_captured_vars()`](#qiskit.circuit.QuantumCircuit.iter_captured_vars "qiskit.circuit.QuantumCircuit.iter_captured_vars"). @@ -1518,7 +1518,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_stretches - + Get an iterable over all stretches in scope within this circuit. This method will iterate over all stretches in scope. For more fine-grained iterators, see [`iter_declared_stretches()`](#qiskit.circuit.QuantumCircuit.iter_declared_stretches "qiskit.circuit.QuantumCircuit.iter_declared_stretches") and [`iter_captured_stretches()`](#qiskit.circuit.QuantumCircuit.iter_captured_stretches "qiskit.circuit.QuantumCircuit.iter_captured_stretches"). @@ -1530,7 +1530,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_input\_vars - + Get an iterable over all real-time classical variables that are declared as inputs to this circuit scope. This excludes locally declared variables (see [`iter_declared_vars()`](#qiskit.circuit.QuantumCircuit.iter_declared_vars "qiskit.circuit.QuantumCircuit.iter_declared_vars")) and captured variables (see [`iter_captured_vars()`](#qiskit.circuit.QuantumCircuit.iter_captured_vars "qiskit.circuit.QuantumCircuit.iter_captured_vars")). **Return type** @@ -1540,7 +1540,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_captured\_vars - + Get an iterable over all real-time classical variables that are captured by this circuit scope from a containing scope. This excludes input variables (see [`iter_input_vars()`](#qiskit.circuit.QuantumCircuit.iter_input_vars "qiskit.circuit.QuantumCircuit.iter_input_vars")) and locally declared variables (see [`iter_declared_vars()`](#qiskit.circuit.QuantumCircuit.iter_declared_vars "qiskit.circuit.QuantumCircuit.iter_declared_vars")). **Return type** @@ -1550,7 +1550,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_captured\_stretches - + Get an iterable over stretches that are captured by this circuit scope from a containing scope. This excludes locally declared stretches (see [`iter_declared_stretches()`](#qiskit.circuit.QuantumCircuit.iter_declared_stretches "qiskit.circuit.QuantumCircuit.iter_declared_stretches")). **Return type** @@ -1560,7 +1560,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_declared\_vars - + Get an iterable over all real-time classical variables that are declared with automatic storage duration in this scope. This excludes input variables (see [`iter_input_vars()`](#qiskit.circuit.QuantumCircuit.iter_input_vars "qiskit.circuit.QuantumCircuit.iter_input_vars")) and captured variables (see [`iter_captured_vars()`](#qiskit.circuit.QuantumCircuit.iter_captured_vars "qiskit.circuit.QuantumCircuit.iter_captured_vars")). **Return type** @@ -1570,7 +1570,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iter\_declared\_stretches - + Get an iterable over all stretches that are declared in this scope. This excludes captured stretches (see [`iter_captured_stretches()`](#qiskit.circuit.QuantumCircuit.iter_captured_stretches "qiskit.circuit.QuantumCircuit.iter_captured_stretches")). **Return type** @@ -1613,7 +1613,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### append - + Append one or more instructions to the end of the circuit, modifying the circuit in place. The `qargs` and `cargs` will be expanded and broadcast according to the rules of the given [`Instruction`](qiskit.circuit.Instruction "qiskit.circuit.Instruction"), and any non-[`Bit`](circuit#qiskit.circuit.Bit "qiskit.circuit.Bit") specifiers (such as integer indices) will be resolved into the relevant instances. @@ -1644,7 +1644,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### \_append - + Append an instruction to the end of the circuit, modifying the circuit in place. @@ -1688,7 +1688,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### compose - + Apply the instructions from one circuit onto specified qubits and/or clbits on another. @@ -1770,7 +1770,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### tensor - + Tensor `self` with `other`. Remember that in the little-endian convention the leftmost operation will be at the bottom of the circuit. See also [the docs](/docs/guides/construct-circuits) for more information. @@ -1919,7 +1919,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### barrier - + Apply `Barrier`. If `qargs` is empty, applies to all qubits in the circuit. **Parameters** @@ -1938,7 +1938,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ccx - + Apply [`CCXGate`](qiskit.circuit.library.CCXGate "qiskit.circuit.library.CCXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -1961,7 +1961,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ccz - + Apply [`CCZGate`](qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -1985,7 +1985,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ch - + Apply [`CHGate`](qiskit.circuit.library.CHGate "qiskit.circuit.library.CHGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2008,7 +2008,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cp - + Apply [`CPhaseGate`](qiskit.circuit.library.CPhaseGate "qiskit.circuit.library.CPhaseGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2032,7 +2032,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### crx - + Apply [`CRXGate`](qiskit.circuit.library.CRXGate "qiskit.circuit.library.CRXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2056,7 +2056,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cry - + Apply [`CRYGate`](qiskit.circuit.library.CRYGate "qiskit.circuit.library.CRYGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2080,7 +2080,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### crz - + Apply [`CRZGate`](qiskit.circuit.library.CRZGate "qiskit.circuit.library.CRZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2104,7 +2104,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cs - + Apply [`CSGate`](qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2127,7 +2127,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### csdg - + Apply [`CSdgGate`](qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2150,7 +2150,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cswap - + Apply [`CSwapGate`](qiskit.circuit.library.CSwapGate "qiskit.circuit.library.CSwapGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2174,7 +2174,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### csx - + Apply [`CSXGate`](qiskit.circuit.library.CSXGate "qiskit.circuit.library.CSXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2197,7 +2197,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cu - + Apply [`CUGate`](qiskit.circuit.library.CUGate "qiskit.circuit.library.CUGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2224,7 +2224,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cx - + Apply [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2247,7 +2247,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cy - + Apply [`CYGate`](qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2270,7 +2270,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### cz - + Apply [`CZGate`](qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2293,7 +2293,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### dcx - + Apply [`DCXGate`](qiskit.circuit.library.DCXGate "qiskit.circuit.library.DCXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2314,7 +2314,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### delay - + Apply [`Delay`](circuit#qiskit.circuit.Delay "qiskit.circuit.Delay"). If qarg is `None`, applies to all qubits. When applying to multiple qubits, delays with the same duration will be created. **Parameters** @@ -2338,7 +2338,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ecr - + Apply [`ECRGate`](qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2359,7 +2359,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### h - + Apply [`HGate`](qiskit.circuit.library.HGate "qiskit.circuit.library.HGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2379,7 +2379,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### id - + Apply [`IGate`](qiskit.circuit.library.IGate "qiskit.circuit.library.IGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2399,7 +2399,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### initialize - + Initialize qubits in a specific state. Qubit initialization is done by first resetting the qubits to $|0\rangle$ followed by calling [`StatePreparation`](qiskit.circuit.library.StatePreparation "qiskit.circuit.library.StatePreparation") class to prepare the qubits in a specified state. Both these steps are included in the [`Initialize`](qiskit.circuit.library.Initialize "qiskit.circuit.library.Initialize") instruction. @@ -2488,7 +2488,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### iswap - + Apply [`iSwapGate`](qiskit.circuit.library.iSwapGate "qiskit.circuit.library.iSwapGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2509,7 +2509,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### mcp - + Apply [`MCPhaseGate`](qiskit.circuit.library.MCPhaseGate "qiskit.circuit.library.MCPhaseGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2532,7 +2532,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### mcrx - + Apply Multiple-Controlled X rotation gate **Parameters** @@ -2545,7 +2545,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### mcry - + Apply Multiple-Controlled Y rotation gate **Parameters** @@ -2560,7 +2560,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### mcrz - + Apply Multiple-Controlled Z rotation gate **Parameters** @@ -2573,7 +2573,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### mcx - + Apply [`MCXGate`](qiskit.circuit.library.MCXGate "qiskit.circuit.library.MCXGate"). The multi-cX gate can be implemented using different techniques, which use different numbers of ancilla qubits and have varying circuit depth. These modes are: @@ -2613,7 +2613,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### measure - + Measure a quantum bit (`qubit`) in the Z basis into a classical bit (`cbit`). When a quantum state is measured, a qubit is projected in the computational (Pauli Z) basis to either $\lvert 0 \rangle$ or $\lvert 1 \rangle$. The classical bit `cbit` indicates the result of that projection as a `0` or a `1` respectively. This operation is non-reversible. @@ -2689,7 +2689,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ms - + Apply [`MSGate`](qiskit.circuit.library.MSGate "qiskit.circuit.library.MSGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2710,7 +2710,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### p - + Apply [`PhaseGate`](qiskit.circuit.library.PhaseGate "qiskit.circuit.library.PhaseGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2731,7 +2731,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### pauli - + Apply [`PauliGate`](qiskit.circuit.library.PauliGate "qiskit.circuit.library.PauliGate"). **Parameters** @@ -2750,7 +2750,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### prepare\_state - + Prepare qubits in a specific state. This class implements a state preparing unitary. Unlike [`initialize()`](#qiskit.circuit.QuantumCircuit.initialize "qiskit.circuit.QuantumCircuit.initialize") it does not reset the qubits first. @@ -2845,7 +2845,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### r - + Apply [`RGate`](qiskit.circuit.library.RGate "qiskit.circuit.library.RGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2867,7 +2867,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rcccx - + Apply [`RC3XGate`](qiskit.circuit.library.RC3XGate "qiskit.circuit.library.RC3XGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2890,7 +2890,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rccx - + Apply [`RCCXGate`](qiskit.circuit.library.RCCXGate "qiskit.circuit.library.RCCXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2912,7 +2912,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### reset - + Reset the quantum bit(s) to their default state. **Parameters** @@ -2930,7 +2930,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rv - + Apply [`RVGate`](qiskit.circuit.library.RVGate "qiskit.circuit.library.RVGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2955,7 +2955,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rx - + Apply [`RXGate`](qiskit.circuit.library.RXGate "qiskit.circuit.library.RXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2977,7 +2977,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rxx - + Apply [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -2999,7 +2999,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ry - + Apply [`RYGate`](qiskit.circuit.library.RYGate "qiskit.circuit.library.RYGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3021,7 +3021,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### ryy - + Apply [`RYYGate`](qiskit.circuit.library.RYYGate "qiskit.circuit.library.RYYGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3043,7 +3043,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rz - + Apply [`RZGate`](qiskit.circuit.library.RZGate "qiskit.circuit.library.RZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3064,7 +3064,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rzx - + Apply [`RZXGate`](qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3086,7 +3086,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### rzz - + Apply [`RZZGate`](qiskit.circuit.library.RZZGate "qiskit.circuit.library.RZZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3108,7 +3108,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### s - + Apply [`SGate`](qiskit.circuit.library.SGate "qiskit.circuit.library.SGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3128,7 +3128,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### sdg - + Apply [`SdgGate`](qiskit.circuit.library.SdgGate "qiskit.circuit.library.SdgGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3148,7 +3148,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### store - + Store the result of the given real-time classical expression `rvalue` in the memory location defined by `lvalue`. Typically `lvalue` will be a [`Var`](circuit_classical#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") node and `rvalue` will be some [`Expr`](circuit_classical#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr") to write into it, but anything that [`expr.lift()`](circuit_classical#qiskit.circuit.classical.expr.lift "qiskit.circuit.classical.expr.lift") can raise to an [`Expr`](circuit_classical#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr") is permissible in both places, and it will be called on them. @@ -3175,7 +3175,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### swap - + Apply [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3196,7 +3196,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### sx - + Apply [`SXGate`](qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3216,7 +3216,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### sxdg - + Apply [`SXdgGate`](qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3236,7 +3236,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### t - + Apply [`TGate`](qiskit.circuit.library.TGate "qiskit.circuit.library.TGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3256,7 +3256,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### tdg - + Apply [`TdgGate`](qiskit.circuit.library.TdgGate "qiskit.circuit.library.TdgGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3276,7 +3276,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### u - + Apply [`UGate`](qiskit.circuit.library.UGate "qiskit.circuit.library.UGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3299,7 +3299,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### unitary - + Apply unitary gate specified by `obj` to `qubits`. **Parameters** @@ -3333,7 +3333,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### x - + Apply [`XGate`](qiskit.circuit.library.XGate "qiskit.circuit.library.XGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3354,7 +3354,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### y - + Apply [`YGate`](qiskit.circuit.library.YGate "qiskit.circuit.library.YGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3374,7 +3374,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### z - + Apply [`ZGate`](qiskit.circuit.library.ZGate "qiskit.circuit.library.ZGate"). For the full matrix form of this gate, see the underlying gate documentation. @@ -3423,7 +3423,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### box - + Create a `box` of operations on this circuit that are treated atomically in the greater context. A “box” is a control-flow construct that is entered unconditionally. The contents of the box behave somewhat as if the start and end of the box were barriers (see [`barrier()`](#qiskit.circuit.QuantumCircuit.barrier "qiskit.circuit.QuantumCircuit.barrier")), except it is permissible to commute operations “all the way” through the box. The box is also an explicit scope for the purposes of variables, stretches and compiler passes. @@ -3487,7 +3487,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### break\_loop - + Apply [`BreakLoopOp`](qiskit.circuit.BreakLoopOp "qiskit.circuit.BreakLoopOp"). @@ -3509,7 +3509,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### continue\_loop - + Apply [`ContinueLoopOp`](qiskit.circuit.ContinueLoopOp "qiskit.circuit.ContinueLoopOp"). @@ -3531,7 +3531,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### for\_loop - + Create a `for` loop on this circuit. There are two forms for calling this function. If called with all its arguments (with the possible exception of `label`), it will create a [`ForLoopOp`](qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") with the given `body`. If `body` (and `qubits` and `clbits`) are *not* passed, then this acts as a context manager, which, when entered, provides a loop variable (unless one is given, in which case it will be reused) and will automatically build a [`ForLoopOp`](qiskit.circuit.ForLoopOp "qiskit.circuit.ForLoopOp") when the scope finishes. In this form, you do not need to keep track of the qubits or clbits you are using, because the scope will handle it for you. @@ -3583,7 +3583,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### if\_else - + Apply [`IfElseOp`](qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp"). @@ -3627,7 +3627,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### if\_test - + Create an `if` statement on this circuit. There are two forms for calling this function. If called with all its arguments (with the possible exception of `label`), it will create a [`IfElseOp`](qiskit.circuit.IfElseOp "qiskit.circuit.IfElseOp") with the given `true_body`, and there will be no branch for the `false` condition (see also the [`if_else()`](#qiskit.circuit.QuantumCircuit.if_else "qiskit.circuit.QuantumCircuit.if_else") method). However, if `true_body` (and `qubits` and `clbits`) are *not* passed, then this acts as a context manager, which can be used to build `if` statements. The return value of the `with` statement is a chainable context manager, which can be used to create subsequent `else` blocks. In this form, you do not need to keep track of the qubits or clbits you are using, because the scope will handle it for you. @@ -3681,7 +3681,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### switch - + Create a `switch`/`case` structure on this circuit. There are two forms for calling this function. If called with all its arguments (with the possible exception of `label`), it will create a [`SwitchCaseOp`](qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") with the given case structure. If `cases` (and `qubits` and `clbits`) are *not* passed, then this acts as a context manager, which will automatically build a [`SwitchCaseOp`](qiskit.circuit.SwitchCaseOp "qiskit.circuit.SwitchCaseOp") when the scope finishes. In this form, you do not need to keep track of the qubits or clbits you are using, because the scope will handle it for you. @@ -3728,7 +3728,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### while\_loop - + Create a `while` loop on this circuit. There are two forms for calling this function. If called with all its arguments (with the possible exception of `label`), it will create a `WhileLoopOp` with the given `body`. If `body` (and `qubits` and `clbits`) are *not* passed, then this acts as a context manager, which will automatically build a `WhileLoopOp` when the scope finishes. In this form, you do not need to keep track of the qubits or clbits you are using, because the scope will handle it for you. @@ -3769,7 +3769,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### noop - + Mark the given qubit(s) as used within the current scope, without adding an operation. This has no effect (other than raising an exception on invalid input) when called in the top scope of a [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). Within a control-flow builder, this causes the qubit to be “used” by the control-flow block, if it wouldn’t already be used, without adding any additional operations on it. @@ -3801,7 +3801,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### has\_control\_flow\_op - + Checks whether the circuit has an instance of [`ControlFlowOp`](qiskit.circuit.ControlFlowOp "qiskit.circuit.ControlFlowOp") present amongst its operations. **Return type** @@ -3815,7 +3815,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### to\_instruction - + Create an [`Instruction`](qiskit.circuit.Instruction "qiskit.circuit.Instruction") out of this circuit. @@ -3842,7 +3842,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### to\_gate - + Create a [`Gate`](qiskit.circuit.Gate "qiskit.circuit.Gate") out of this circuit. The circuit must act only on qubits and contain only unitary operations. @@ -3869,7 +3869,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### to\_dag - + Convert this circuit to a [`DAGCircuit`](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"). This is a simple wrapper around [`circuit_to_dag()`](converters#qiskit.converters.circuit_to_dag "qiskit.converters.circuit_to_dag"). @@ -3893,7 +3893,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### measure\_active - + Adds measurement to all non-idle qubits. Creates a new ClassicalRegister with a size equal to the number of non-idle qubits being measured. Returns a new circuit with measurements if inplace=False. @@ -3913,7 +3913,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### measure\_all - + Adds measurement to all qubits. By default, adds new classical bits in a [`ClassicalRegister`](circuit#qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister") to store these measurements. If `add_bits=False`, the results of the measurements will instead be stored in the already existing classical bits, with qubit `n` being measured into classical bit `n`. @@ -3942,7 +3942,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### clear - + Clear all instructions in self. Clearing the circuits will keep the metadata. @@ -3960,7 +3960,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### remove\_final\_measurements - + Removes final measurements and barriers on all qubits if they are present. Deletes the classical registers that were used to store the values from these measurements that become idle as a result of this operation, and deletes classical bits that are referenced only by removed registers, or that aren’t referenced at all but have become idle as a result of this operation. Measurements and barriers are considered final if they are followed by no other operations (aside from other measurements or barriers.) @@ -4065,7 +4065,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### count\_ops - + Count each operation kind in the circuit. **Returns** @@ -4079,7 +4079,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### depth - + Return circuit depth (i.e., length of critical path). The depth of a quantum circuit is a measure of how many “layers” of quantum gates, executed in parallel, it takes to complete the computation defined by the circuit. Because quantum gates take time to implement, the depth of a circuit roughly corresponds to the amount of time it takes the quantum computer to execute the circuit. @@ -4123,7 +4123,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### get\_instructions - + Get instructions matching name. **Parameters** @@ -4141,7 +4141,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### num\_connected\_components - + How many non-entangled subcircuits can the circuit be factored to. **Parameters** @@ -4159,7 +4159,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### num\_nonlocal\_gates - + Return number of non-local gates (i.e. involving 2+ qubits). Conditional nonlocal gates are also included. @@ -4171,7 +4171,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### num\_tensor\_factors - + Computes the number of tensor factors in the unitary (quantum) part of the circuit only. **Notes** @@ -4185,7 +4185,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### num\_unitary\_factors - + Computes the number of tensor factors in the unitary (quantum) part of the circuit only. **Return type** @@ -4195,7 +4195,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### size - + Returns total number of instructions in circuit. **Parameters** @@ -4213,7 +4213,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### width - + Return number of qubits plus clbits in circuit. **Returns** @@ -4231,7 +4231,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### estimate\_duration - + Estimate the duration of a scheduled circuit This method computes the estimate of the circuit duration by finding the longest duration path in the circuit based on the durations provided by a given target. This method only works for simple circuits that have no control flow or other classical feed-forward operations. @@ -4256,7 +4256,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### qubit\_duration - + Return the duration between the start and stop time of the first and last instructions, excluding delays, over the supplied qubits. Its time unit is `self.unit`. **Parameters** @@ -4274,7 +4274,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### qubit\_start\_time - + Return the start time of the first instruction, excluding delays, over the supplied qubits. Its time unit is `self.unit`. Return 0 if there are no instructions over qubits @@ -4299,7 +4299,7 @@ python_api_name: qiskit.circuit.QuantumCircuit #### qubit\_stop\_time - + Return the stop time of the last instruction, excluding delays, over the supplied qubits. Its time unit is `self.unit`. Return 0 if there are no instructions over qubits @@ -4336,7 +4336,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### ensure\_physical - + Put this circuit into canonical physical form, with the given number of qubits, if it is not already. Several Qiskit transpiler passes only make sense when applied to circuits defined in terms of physical qubits. If you have manually constructed a circuit where the qubit indices correspond to physical qubits, use this function to ensure that the metadata of the circuit matches the canonical physical form. This means replacing the qubit data with a single owning register called `"q"`, and (optionally) setting the [`layout`](#qiskit.circuit.QuantumCircuit.layout "qiskit.circuit.QuantumCircuit.layout") field of the circuit to link these physical qubits with the original virtual ones. @@ -4364,13 +4364,47 @@ python_api_name: qiskit.circuit.QuantumCircuit [bool](https://docs.python.org/3/library/functions.html#bool) + ### 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: + + **..math::** + + **label** + + estimated circuit fidelity + + prod\_\{g in text\{gates}} bigl(1 - operatorname\{error}(g)bigr) + + where $\operatorname{error}(g)$ is the error rate in the target for the instruction $g$ from the circuit in the target. If the circuit is not physical, meaning any instruction in the circuit (as in operation and qargs) is not found in the target, this will return `None`. 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. + + **Parameters** + + **target** ([*Target*](qiskit.transpiler.Target "qiskit.transpiler.Target")) – The [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") instance that the circuit will be executed on and used to get the error rates for the instructions in the circuit. + + **Returns** + + The estimated fidelity of executing the circuit on the given target. If any instruction in the circuit is not present in target + + **Raises** + + [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If the circuit contains any control flow operations. + + **Return type** + + [float](https://docs.python.org/3/library/functions.html#float) | None + + ## Instruction-like methods [`QuantumCircuit`](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") also contains a small number of methods that are very [`Instruction`](qiskit.circuit.Instruction "qiskit.circuit.Instruction")-like in detail. You may well find better integration and more API support if you first convert your circuit to an [`Instruction`](qiskit.circuit.Instruction "qiskit.circuit.Instruction") ([`to_instruction()`](#qiskit.circuit.QuantumCircuit.to_instruction "qiskit.circuit.QuantumCircuit.to_instruction")) or [`Gate`](qiskit.circuit.Gate "qiskit.circuit.Gate") ([`to_gate()`](#qiskit.circuit.QuantumCircuit.to_gate "qiskit.circuit.QuantumCircuit.to_gate")) as appropriate, then call the corresponding method. ### control - + Return the controlled version of this circuit. The original circuit is converted into a gate, and the resulting circuit contains the controlled version of this gate. This controlled gate is implemented as [`ControlledGate`](qiskit.circuit.ControlledGate "qiskit.circuit.ControlledGate") when `annotated` is `False`, and as [`AnnotatedOperation`](qiskit.circuit.AnnotatedOperation "qiskit.circuit.AnnotatedOperation") when `annotated` is `True`. @@ -4401,7 +4435,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### inverse - + Invert (take adjoint of) this circuit. This is done by recursively inverting all gates. @@ -4447,7 +4481,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### power - + Raise this circuit to the power of `power`. If `power` is a positive integer and both `matrix_power` and `annotated` are `False`, this implementation defaults to calling `repeat`. Otherwise, the circuit is converted into a gate, and a new circuit, containing this gate raised to the given power, is returned. The gate raised to the given power is implemented either as a unitary gate if `annotated` is `False` or as an annotated operation if `annotated` is `True`. @@ -4473,7 +4507,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### repeat - + Repeat this circuit `reps` times. **Parameters** @@ -4492,7 +4526,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### reverse\_ops - + Reverse the circuit by reversing the order of instructions. This is done by recursively reversing all instructions. It does not invert (adjoint) any gate. @@ -4540,7 +4574,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### draw - + Draw the quantum circuit. Use the output parameter to choose the drawing format: **`text`** @@ -4656,7 +4690,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### decompose - + Call a decomposition pass on this circuit, to decompose one level (shallow decompose). **Parameters** @@ -4675,7 +4709,7 @@ python_api_name: qiskit.circuit.QuantumCircuit ### reverse\_bits - + Return a circuit with the opposite order of wires. The circuit is “vertically” flipped. If a circuit is defined over multiple registers, the resulting circuit will have the same registers but with their order flipped. diff --git a/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitBasisDecomposer.mdx b/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitBasisDecomposer.mdx index 9dfb6f5b7ae..a8af782b691 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitBasisDecomposer.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitBasisDecomposer.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.synthesis.TwoQubitBasisDecomposer # TwoQubitBasisDecomposer - + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) A class for decomposing 2-qubit unitaries into minimal number of uses of a 2-qubit basis gate. @@ -22,7 +22,7 @@ python_api_name: qiskit.synthesis.TwoQubitBasisDecomposer ### \_\_call\_\_ - + Decompose a two-qubit `unitary` over fixed basis and $SU(2)$ using the best approximation given that each basis application has a finite `basis_fidelity`. **Parameters** @@ -50,7 +50,7 @@ python_api_name: qiskit.synthesis.TwoQubitBasisDecomposer ### decomp0 - + Decompose target $\sim U_d(x, y, z)$ with $0$ uses of the basis gate. Result $U_r$ has trace: $$ @@ -63,7 +63,7 @@ $$ ### decomp1 - + Decompose target $\sim U_d(x, y, z)$ with $1$ use of the basis gate $\sim U_d(a, b, c)$. Result $U_r$ has trace: $$ @@ -76,7 +76,7 @@ $$ ### decomp2\_supercontrolled - + Decompose target $\sim U_d(x, y, z)$ with $2$ uses of the basis gate. For supercontrolled basis $\sim U_d(\pi/4, b, 0)$, all b, result $U_r$ has trace @@ -90,19 +90,19 @@ $$ ### decomp3\_supercontrolled - + Decompose target with $3$ uses of the basis. This is an exact decomposition for supercontrolled basis $\sim U_d(\pi/4, b, 0)$, all b, and any target. No guarantees for non-supercontrolled basis. ### num\_basis\_gates - + Computes the number of basis gates needed in a decomposition of input unitary ### traces - + Give the expected traces $\Big\vert\text{Tr}(U \cdot U_\text{target}^{\dag})\Big\vert$ for a different number of basis gates. diff --git a/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitControlledUDecomposer.mdx b/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitControlledUDecomposer.mdx index 54ae0edf8b0..45a1d1af712 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitControlledUDecomposer.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.TwoQubitControlledUDecomposer.mdx @@ -8,12 +8,66 @@ python_api_name: qiskit.synthesis.TwoQubitControlledUDecomposer # TwoQubitControlledUDecomposer - + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) - Decompose two-qubit unitary in terms of a desired $U \sim U_d(\alpha, 0, 0) \sim \text{Ctrl-U}$ gate that is locally equivalent to an [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). + Decompose a general two-qubit unitary in terms of a target two-qubit gate, that is locally equivalent to an [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). - Initialize the KAK decomposition. + **Synthesis algorithm** + + Any two-qubit unitary $U$ can be written, through its canonical (Weyl) decomposition (see [`TwoQubitWeylDecomposition`](qiskit.synthesis.TwoQubitWeylDecomposition "qiskit.synthesis.TwoQubitWeylDecomposition")), as a Weyl gate $U_d(a, b, c)$ surrounded by four single-qubit unitary gates: + + ```text + ┌─────┐┌───────┐┌─────┐ + q_0: ┤ c2r ├┤0 ├┤ c1r ├ + ├─────┤│ Weyl │├─────┤ + q_1: ┤ c2l ├┤1 ├┤ c1l ├ + └─────┘└───────┘└─────┘ + ``` + + The Weyl gate factorizes into a product of three two-qubit rotations, $U_d(a, b, c) = R_{XX}(a)\, R_{YY}(b)\, R_{ZZ}(c)$: + + ```text + ┌─────────┐┌─────────┐ + q_0: ┤0 ├┤0 ├─■────── + │ Rxx(a) ││ Ryy(b) │ │ZZ(c) + q_1: ┤1 ├┤1 ├─■────── + └─────────┘└─────────┘ + ``` + + The $R_{YY}$ and $R_{ZZ}$ rotations are then mapped onto $R_{XX}$ rotations using single-qubit basis changes. With $R_{YY}(b) = (S^\dagger \otimes S^\dagger)\, R_{XX}(b)\, (S \otimes S)$: + + ```text + ┌─────┐┌─────────┐┌───┐ + q_0: ┤ Sdg ├┤0 ├┤ S ├ + ├─────┤│ Rxx(b) │├───┤ + q_1: ┤ Sdg ├┤1 ├┤ S ├ + └─────┘└─────────┘└───┘ + ``` + + and $R_{ZZ}(c) = (H \otimes H)\, R_{XX}(c)\, (H \otimes H)$: + + ```text + ┌───┐┌─────────┐┌───┐ + q_0: ┤ H ├┤0 ├┤ H ├ + ├───┤│ Rxx(c) │├───┤ + q_1: ┤ H ├┤1 ├┤ H ├ + └───┘└─────────┘└───┘ + ``` + + Finally, each $R_{XX}$ rotation is realized with the user-supplied gate that is locally equivalent to [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate") (the `rxx_equivalent_gate`), wrapped by the single-qubit gates that account for the local equivalence and for any scaling of the rotation angle. After every rotation is expanded, all single-qubit gates that fall between two consecutive two-qubit gates are multiplied together and consolidated, so the synthesized circuit uses at most three applications of `rxx_equivalent_gate` and at most eight single-qubit unitary gates: + + ```text + ┌─────┐┌───────────┐┌─────┐┌───────────┐┌─────┐┌───────────┐┌─────┐ + q_0: ┤ d2r ├┤0 ├┤ d1r ├┤0 ├┤ e1r ├┤0 ├┤ f1r ├ + ├─────┤│ Equiv(a) │├─────┤│ Equiv(b) │├─────┤│ Equiv(c) │├─────┤ + q_1: ┤ d2l ├┤1 ├┤ d1l ├┤1 ├┤ e1l ├┤1 ├┤ f1l ├ + └─────┘└───────────┘└─────┘└───────────┘└─────┘└───────────┘└─────┘ + ``` + + Here `Equiv(a)`, `Equiv(b)` and `Equiv(c)` are the user-supplied `rxx_equivalent_gate` (the gate locally equivalent to [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate")) realizing the $R_{XX}(a)$, $R_{XX}(b)$ and $R_{XX}(c)$ rotations, and the remaining boxes are the consolidated single-qubit unitary gates. + + The number of two-qubit gates actually emitted depends on the Weyl parameters of the target: rotations with a vanishing angle are dropped, so unitaries that are closer to a single or two instances of [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate") use one or two applications of `rxx_equivalent_gate` respectively instead of three. A target close to the identity will use no applications of it. **Parameters** @@ -23,5 +77,28 @@ python_api_name: qiskit.synthesis.TwoQubitControlledUDecomposer **Raises** [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If the gate is not locally equivalent to an [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). + + ### \_\_call\_\_ + + + Decompose a two-qubit `unitary` using the [`TwoQubitControlledUDecomposer`](#qiskit.synthesis.TwoQubitControlledUDecomposer "qiskit.synthesis.TwoQubitControlledUDecomposer"). + + **Parameters** + + * **unitary** ([*Operator*](qiskit.quantum_info.Operator "qiskit.quantum_info.operators.operator.Operator") *|*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – $4 \times 4$ unitary to synthesize. + * **approximate** – Currently not used by this decomposer; accepted for signature compatibility with the other two-qubit decomposers. Reserved for future use. + * **use\_dag** – Currently not used by this decomposer; accepted for signature compatibility with the other two-qubit decomposers. Reserved for future use. + * **atol** – Absolute tolerance for checking angles of the single-qubit unitaries when simplifying the returned circuit \[Default: 1e-12]. + + **Returns** + + Synthesized quantum circuit. + + **Return type** + + [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") + + Note: atol is passed to [`OneQubitEulerDecomposer`](qiskit.synthesis.OneQubitEulerDecomposer "qiskit.synthesis.OneQubitEulerDecomposer"). + diff --git a/docs/api/qiskit/dev/synthesis.mdx b/docs/api/qiskit/dev/synthesis.mdx index 6c5d4dff027..2a02cf10138 100644 --- a/docs/api/qiskit/dev/synthesis.mdx +++ b/docs/api/qiskit/dev/synthesis.mdx @@ -887,12 +887,12 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ## Two-Qubit Synthesis -| | | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`TwoQubitBasisDecomposer`](qiskit.synthesis.TwoQubitBasisDecomposer "qiskit.synthesis.TwoQubitBasisDecomposer")(gate\[, ...]) | A class for decomposing 2-qubit unitaries into minimal number of uses of a 2-qubit basis gate. | -| [`XXDecomposer`](qiskit.synthesis.XXDecomposer "qiskit.synthesis.XXDecomposer")(\[basis\_fidelity, euler\_basis, ...]) | A class for optimal decomposition of 2-qubit unitaries into 2-qubit basis gates of `XX` type (i.e., each locally equivalent to $CAN(\alpha, 0, 0)$ for a possibly varying $\alpha$). | -| [`TwoQubitWeylDecomposition`](qiskit.synthesis.TwoQubitWeylDecomposition "qiskit.synthesis.TwoQubitWeylDecomposition")(unitary\_matrix\[, ...]) | Two-qubit Weyl decomposition. | -| [`TwoQubitControlledUDecomposer`](qiskit.synthesis.TwoQubitControlledUDecomposer "qiskit.synthesis.TwoQubitControlledUDecomposer")(...\[, euler\_basis]) | Decompose two-qubit unitary in terms of a desired $U \sim U_d(\alpha, 0, 0) \sim \text{Ctrl-U}$ gate that is locally equivalent to an [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). | +| | | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [`TwoQubitBasisDecomposer`](qiskit.synthesis.TwoQubitBasisDecomposer "qiskit.synthesis.TwoQubitBasisDecomposer")(gate\[, ...]) | A class for decomposing 2-qubit unitaries into minimal number of uses of a 2-qubit basis gate. | +| [`XXDecomposer`](qiskit.synthesis.XXDecomposer "qiskit.synthesis.XXDecomposer")(\[basis\_fidelity, euler\_basis, ...]) | A class for optimal decomposition of 2-qubit unitaries into 2-qubit basis gates of `XX` type (i.e., each locally equivalent to $CAN(\alpha, 0, 0)$ for a possibly varying $\alpha$). | +| [`TwoQubitWeylDecomposition`](qiskit.synthesis.TwoQubitWeylDecomposition "qiskit.synthesis.TwoQubitWeylDecomposition")(unitary\_matrix\[, ...]) | Two-qubit Weyl decomposition. | +| [`TwoQubitControlledUDecomposer`](qiskit.synthesis.TwoQubitControlledUDecomposer "qiskit.synthesis.TwoQubitControlledUDecomposer")(...\[, euler\_basis]) | Decompose a general two-qubit unitary in terms of a target two-qubit gate, that is locally equivalent to an [`RXXGate`](qiskit.circuit.library.RXXGate "qiskit.circuit.library.RXXGate"). | ### two\_qubit\_cnot\_decompose diff --git a/public/docs/api/qiskit-c/dev/objects.inv b/public/docs/api/qiskit-c/dev/objects.inv index e6506617e12..b23c8596635 100644 Binary files a/public/docs/api/qiskit-c/dev/objects.inv and b/public/docs/api/qiskit-c/dev/objects.inv differ diff --git a/public/docs/api/qiskit/dev/objects.inv b/public/docs/api/qiskit/dev/objects.inv index 3febf2809e6..45862c2fad1 100644 Binary files a/public/docs/api/qiskit/dev/objects.inv and b/public/docs/api/qiskit/dev/objects.inv differ diff --git a/public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-3.avif b/public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-3.avif index b99b2d140d8..d9b3c5a2dea 100644 Binary files a/public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-3.avif and b/public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-3.avif differ diff --git a/public/docs/images/api/qiskit-ibm-runtime/dev/twirling_strategy_options.avif b/public/docs/images/api/qiskit-ibm-runtime/dev/twirling_strategy_options.avif index 283ac7ba511..17e05858938 100644 Binary files a/public/docs/images/api/qiskit-ibm-runtime/dev/twirling_strategy_options.avif and b/public/docs/images/api/qiskit-ibm-runtime/dev/twirling_strategy_options.avif differ diff --git a/public/docs/images/api/qiskit/dev/circuit_random-1.avif b/public/docs/images/api/qiskit/dev/circuit_random-1.avif index fa827c9f086..9b361886fb9 100644 Binary files a/public/docs/images/api/qiskit/dev/circuit_random-1.avif and b/public/docs/images/api/qiskit/dev/circuit_random-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/circuit_random-3.avif b/public/docs/images/api/qiskit/dev/circuit_random-3.avif index c590678f311..192920f40eb 100644 Binary files a/public/docs/images/api/qiskit/dev/circuit_random-3.avif and b/public/docs/images/api/qiskit/dev/circuit_random-3.avif differ diff --git a/public/docs/images/api/qiskit/dev/providers_fake_provider-1_01.avif b/public/docs/images/api/qiskit/dev/providers_fake_provider-1_01.avif index ce6fca04bf3..93be4dfbe8d 100644 Binary files a/public/docs/images/api/qiskit/dev/providers_fake_provider-1_01.avif and b/public/docs/images/api/qiskit/dev/providers_fake_provider-1_01.avif differ diff --git a/public/docs/images/api/qiskit/dev/providers_fake_provider-1_02.avif b/public/docs/images/api/qiskit/dev/providers_fake_provider-1_02.avif index e7384cadfa5..718c75a618b 100644 Binary files a/public/docs/images/api/qiskit/dev/providers_fake_provider-1_02.avif and b/public/docs/images/api/qiskit/dev/providers_fake_provider-1_02.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-1.avif index d219b7337dd..8c9da9a8e24 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-2.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-2.avif index a078b00ac8e..915489e4a6d 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-2.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-ControlledGate-2.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_00.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_00.avif index ee5ad8b9916..1bc891bf251 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_00.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_00.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_00.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_00.avif index 2a370bb75c0..dd812d35786 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_00.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_00.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_01.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_01.avif index e94269d1377..c4980a62b96 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_01.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-15_01.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_00.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_00.avif index 0e913b0a237..7cc97a1c8b7 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_00.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_00.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_01.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_01.avif index d856a0765d1..be3446bee28 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_01.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-16_01.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-31.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-31.avif index 5d4d968932b..19d4dad4f4e 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-31.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-QuantumCircuit-31.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-1.avif index 3763a3545d2..44f22ca73e4 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-2.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-2.avif index dc97633a944..2110ea979ed 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-2.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-AndGate-2.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-BitwiseXorGate-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-BitwiseXorGate-1.avif index 965d0dea294..801e2f476b3 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-BitwiseXorGate-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-BitwiseXorGate-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProductGate-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProductGate-1.avif index e8cfe06323c..8ee416511b5 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProductGate-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProductGate-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-1.avif index 0383de9b6c2..99c04874ff5 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-2.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-2.avif index 8f86d5b9a51..1ae58413310 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-2.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-OrGate-2.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PermutationGate-2.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PermutationGate-2.avif index 53f2a26322b..9d16ba8b5a9 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PermutationGate-2.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PermutationGate-2.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PhaseEstimation-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PhaseEstimation-1.avif index 2f8d621ec62..f9eab1c16ce 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PhaseEstimation-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-PhaseEstimation-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-random_iqp-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-random_iqp-1.avif index 8ecd319530d..af1643425a6 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-random_iqp-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-random_iqp-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-unitary_overlap-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-unitary_overlap-1.avif index fed2e1bcce6..e3a5c3de799 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-unitary_overlap-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-unitary_overlap-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-quantum_info-Statevector-1.avif b/public/docs/images/api/qiskit/dev/qiskit-quantum_info-Statevector-1.avif index 780e0e90fb6..4dedea7fc96 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-quantum_info-Statevector-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-quantum_info-Statevector-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-FilterOpNodes-1.avif b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-FilterOpNodes-1.avif index 53dcdf6b756..1af6b9c509e 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-FilterOpNodes-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-FilterOpNodes-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-RemoveBarriers-1.avif b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-RemoveBarriers-1.avif index 998956edf29..197ac6d6d65 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-RemoveBarriers-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-RemoveBarriers-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-WrapAngles-1.avif b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-WrapAngles-1.avif index 1a8d106e760..9f06636f2a2 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-WrapAngles-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-transpiler-passes-WrapAngles-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-circuit_drawer-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-circuit_drawer-1.avif index e0de157652f..38c2bbe076f 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-circuit_drawer-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-circuit_drawer-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_circuit_layout-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_circuit_layout-1.avif index e3411243116..5509f2e11ef 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_circuit_layout-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_circuit_layout-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_error_map-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_error_map-1.avif index fa63347bd9c..f5a24b2a5e1 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_error_map-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_error_map-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_01.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_01.avif index e40a3540ffe..8ce9e99a628 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_01.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_01.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_02.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_02.avif index 181cf3627db..33835b40273 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_02.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_histogram-1_02.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_hinton-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_hinton-1.avif index 1e6edaa5c94..695f05b643b 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_hinton-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_hinton-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_paulivec-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_paulivec-1.avif index 921af44857d..3cf4e7ec645 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_paulivec-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-plot_state_paulivec-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-1.avif index 3c93919a24b..d56001b49d4 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-2.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-2.avif index 05d10c6bf0e..cba076d9744 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-2.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-2.avif differ diff --git a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-3.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-3.avif index 2cab7e33f33..8e675f02f35 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-3.avif and b/public/docs/images/api/qiskit/dev/qiskit-visualization-timeline_drawer-3.avif differ diff --git a/public/docs/images/api/qiskit/dev/transpiler-10.avif b/public/docs/images/api/qiskit/dev/transpiler-10.avif index 0670e0df1d5..b14c9953aec 100644 Binary files a/public/docs/images/api/qiskit/dev/transpiler-10.avif and b/public/docs/images/api/qiskit/dev/transpiler-10.avif differ diff --git a/public/docs/images/api/qiskit/dev/transpiler-9.avif b/public/docs/images/api/qiskit/dev/transpiler-9.avif index 4cbb69bc5f1..264e5bf035a 100644 Binary files a/public/docs/images/api/qiskit/dev/transpiler-9.avif and b/public/docs/images/api/qiskit/dev/transpiler-9.avif differ diff --git a/public/docs/images/api/qiskit/dev/visualization-1.avif b/public/docs/images/api/qiskit/dev/visualization-1.avif index efb302865c6..165ad42859b 100644 Binary files a/public/docs/images/api/qiskit/dev/visualization-1.avif and b/public/docs/images/api/qiskit/dev/visualization-1.avif differ diff --git a/public/docs/images/api/qiskit/dev/visualization-3.avif b/public/docs/images/api/qiskit/dev/visualization-3.avif index ee8a6cde889..90cf0714043 100644 Binary files a/public/docs/images/api/qiskit/dev/visualization-3.avif and b/public/docs/images/api/qiskit/dev/visualization-3.avif differ diff --git a/scripts/config/api-html-artifacts.json b/scripts/config/api-html-artifacts.json index 9df4a3b4038..8ca7cb5c61b 100644 --- a/scripts/config/api-html-artifacts.json +++ b/scripts/config/api-html-artifacts.json @@ -1,6 +1,6 @@ { "qiskit": { - "dev": "https://api.github.com/repos/Qiskit/qiskit/actions/artifacts/7515755077/zip", + "dev": "https://api.github.com/repos/Qiskit/qiskit/actions/artifacts/7572589957/zip", "2.4": "https://ibm.box.com/shared/static/8dug8a79f1xdohccyasfaazxn0tejzg9.zip", "2.3": "https://ibm.box.com/shared/static/hu6gvj4857vb5sew5k98rr9yd7pxasqy.zip", "2.2": "https://ibm.box.com/shared/static/c1lktwwwo9zu4z5wxqg1xs9fj57oeoco.zip", @@ -36,7 +36,7 @@ "0.19": "https://ibm.box.com/shared/static/wjoea4x5tnxd0l4lgo2v3kxnx6btxvvl.zip" }, "qiskit-ibm-runtime": { - "dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/7502979684/zip", + "dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/7559021202/zip", "0.47": "https://ibm.box.com/shared/static/68x7u8qpr72id254w6hnjbgo7317hwjk.zip", "0.46": "https://ibm.box.com/shared/static/p2jntzpdwqa75i75d0sm5ltzbaaw5ksa.zip", "0.45": "https://ibm.box.com/shared/static/5o5rt86cc2ehvxmslleecat3iyob8igu.zip",