diff --git a/docs/api/qiskit-c/dev/_toc.json b/docs/api/qiskit-c/dev/_toc.json index 60616db84ce..c27c9338bbb 100644 --- a/docs/api/qiskit-c/dev/_toc.json +++ b/docs/api/qiskit-c/dev/_toc.json @@ -21,6 +21,10 @@ "title": "QkComplex64", "url": "/docs/api/qiskit-c/dev/qk-complex-64" }, + { + "title": "QkElidePermutationsResult", + "url": "/docs/api/qiskit-c/dev/qk-elide-permutations-result" + }, { "title": "QkExitCode", "url": "/docs/api/qiskit-c/dev/qk-exit-code" diff --git a/docs/api/qiskit-c/dev/index.mdx b/docs/api/qiskit-c/dev/index.mdx index 36a50cf31b4..93c921914f1 100644 --- a/docs/api/qiskit-c/dev/index.mdx +++ b/docs/api/qiskit-c/dev/index.mdx @@ -34,8 +34,9 @@ As this interface is still new in Qiskit it should be considered experimental an Using the transpiler from the C API is intended to only cover circuits created solely via the C API. If you are in a hybrid mode where you’re using the C API with Python you should invoke the transpiler via the Python [`qiskit.transpiler`](/docs/api/qiskit/dev/transpiler#module-qiskit.transpiler "qiskit.transpiler") module instead; the functionality is the same Rust internals they just offer different entrypoints. The C API for transpilation makes assumptions about the input only using constructs exposed to the C Quantum Circuit API and you will potentially get incomplete results transpiling circuits from Python via the C API. -* [Transpiler Passes](qk-transpiler-passes) -* [QkVF2LayoutResult](qk-vf-2-layout-result) * [QkTarget](qk-target) * [QkTargetEntry](qk-target-entry) +* [Transpiler Passes](qk-transpiler-passes) +* [QkVF2LayoutResult](qk-vf-2-layout-result) +* [QkElidePermutationsResult](qk-elide-permutations-result) diff --git a/docs/api/qiskit-c/dev/qk-elide-permutations-result.mdx b/docs/api/qiskit-c/dev/qk-elide-permutations-result.mdx new file mode 100644 index 00000000000..76889e89fea --- /dev/null +++ b/docs/api/qiskit-c/dev/qk-elide-permutations-result.mdx @@ -0,0 +1,102 @@ +--- +title: QkElidePermutationsResult (dev version) +description: API reference for QkElidePermutationsResult in the dev version of qiskit-c +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: QkElidePermutationsResult +--- + +# QkElidePermutationsResult + +```c +typedef struct QkElidePermutationsResult QkElidePermutationsResult +``` + +When running the `qk_transpiler_pass_standalone_elide_permutations` function it returns a modified circuit and a permutation array as a QkElidePermutationsResult object. This object contains the outcome of the transpiler pass, whether the pass was able to elide any gates or not, and what the results of that elision were. + +## Functions + +### qk\_elide\_permutations\_result\_elided\_gates + + + Check whether the elide permutations was able to elide anything + + + + #### Safety + + + + Behavior is undefined if `result` is not a valid, non-null pointer to a `QkElidePermutationsResult`. + + **Parameters** + + **result** – a pointer to the result + + **Returns** + + `true` if the `qk_transpiler_pass_standalone_elide_permutations()` run elided any gates + + +### qk\_elide\_permutations\_result\_circuit + + + Get the circuit from the elide permutations result + + + + #### Safety + + + + Behavior is undefined if `result` is not a valid, non-null pointer to a `QkElidePermutationsResult`. The pointer to the returned circuit is owned by the result object, it should not be passed to `qk_circuit_free()` as it will be freed by `qk_elide_permutations_result_free()`. + + **Parameters** + + **result** – a pointer to the result of the pass. It must have elided gates as checked by `qk_elide_permutations_result_elided_gates()` + + **Returns** + + A pointer to the circuit with the permutation gates elided + + +### qk\_elide\_permutations\_result\_permutation + + + Get the permutation array for the elided gates + + + + #### Safety + + + + Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkElidePermutationsResult`. Also qubit must be a valid qubit for the circuit and there must be a result found. The pointer to the permutation array is owned by the result object, it should not be passed to `free()` as it will be freed by `qk_elide_permutations_result_free()` when that is called. + + **Parameters** + + **result** – a pointer to the result of the pass. It must have elided gates as checked by `qk_elide_permutations_result_elided_gates()` + + **Returns** + + A pointer to the permutation array caused by the swap elision performed by the pass. This array has a length equal to the number of qubits of the circuit returned by `qk_elide_permutations_result_elided_gates()` (or the circuit passed into `qk_transpiler_pass_standalone_elide_permutations()`). The permutation array maps the virtual qubit in the original circuit at each index to its new output position after all the elision performed by the pass. For example, and array of `[2, 1, 0]` means that qubit 0 is now in qubit 2 on the output of the circuit and qubit 2’s is now at 0 (qubit 1 remains unchanged) + + +### qk\_elide\_permutations\_result\_free + + + Free a `QkElidePermutationsResult` object + + + + #### Safety + + + + Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkElidePermutationsResult`. + + **Parameters** + + **result** – a pointer to the result object to free + + diff --git a/docs/api/qiskit-c/dev/qk-target-entry.mdx b/docs/api/qiskit-c/dev/qk-target-entry.mdx index e233cb11fd8..3d77526ba84 100644 --- a/docs/api/qiskit-c/dev/qk-target-entry.mdx +++ b/docs/api/qiskit-c/dev/qk-target-entry.mdx @@ -36,9 +36,9 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); ### qk\_target\_entry\_new - Creates an entry to the `QkTarget` based on a `QkGate` instance with no parameters. + Creates an entry to the `QkTarget` based on a `QkGate` instance. - + #### Example @@ -46,13 +46,9 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); QkTargetEntry *entry = qk_target_entry_new(QkGate_H); ``` - - If the instance of `QkGate` uses fixed parameters, use `qk_target_entry_new_fixed`. Regular parameters are not currently supported. - - **Parameters** - **operation** – The `QkGate` whose properties this target entry defines. + **operation** – The `QkGate` whose properties this target entry defines. If the `QkGate` takes parameters (which can be checked with `qk_gate_num_params`) it will be added as a an instruction on the target which accepts any parameter value. If the gate only accepts a fixed parameter value you can use `qk_target_entry_new_fixed` instead. **Returns** @@ -64,7 +60,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Creates a new entry for adding a measurement instruction to a `QkTarget`. - + #### Example @@ -92,7 +88,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Creates a new entry for adding a reset instruction to a `QkTarget`. - + #### Example @@ -120,7 +116,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Creates an entry to the `QkTarget` based on a `QkGate` instance with no parameters. - + #### Example @@ -129,11 +125,11 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); QkTargetEntry *entry = qk_target_entry_new(QkGate_CRX, crx_params); ``` - + #### Safety - + The `params` type is expected to be a pointer to an array of `double` where the length matches the the expectations of the `QkGate`. If the array is insufficently 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. @@ -156,7 +152,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Retrieves the number of properties stored in the target entry. - + #### Example @@ -166,11 +162,11 @@ qk_target_entry_add(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. @@ -188,7 +184,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Frees the entry. - + #### Example @@ -197,11 +193,11 @@ qk_target_entry_add(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. @@ -219,7 +215,7 @@ qk_target_entry_add(entry, NULL, 0, NAN, 0.003); Adds an instruction property instance based on its assigned qargs. - + #### Example @@ -229,11 +225,11 @@ qk_target_entry_add(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. diff --git a/docs/api/qiskit-c/dev/qk-target.mdx b/docs/api/qiskit-c/dev/qk-target.mdx index 775df13638d..27445c67e16 100644 --- a/docs/api/qiskit-c/dev/qk-target.mdx +++ b/docs/api/qiskit-c/dev/qk-target.mdx @@ -48,7 +48,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 @@ -70,7 +70,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the number of qubits of this `QkTarget`. - + #### Example @@ -79,11 +79,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`. @@ -101,7 +101,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the dt value of this `QkTarget`. - + #### Example @@ -111,11 +111,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`. @@ -133,7 +133,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the granularity value of this `QkTarget`. - + #### Example @@ -143,11 +143,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`. @@ -165,7 +165,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the `min_length` value of this `QkTarget`. - + #### Example @@ -175,11 +175,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`. @@ -197,7 +197,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the `pulse_alignment` value of this `QkTarget`. - + #### Example @@ -207,11 +207,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`. @@ -229,7 +229,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the `acquire_alignment` value of this `QkTarget`. - + #### Example @@ -239,11 +239,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`. @@ -261,7 +261,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Sets the dt value of this `QkTarget`. - + #### Example @@ -270,11 +270,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`. @@ -293,7 +293,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Sets the `granularity` value of this `QkTarget`. - + #### Example @@ -303,11 +303,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`. @@ -326,7 +326,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Sets the `min_length` value of this `QkTarget`. - + #### Example @@ -336,11 +336,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`. @@ -359,7 +359,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the `pulse_alignment` value of this `QkTarget`. - + #### Example @@ -369,11 +369,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`. @@ -392,19 +392,19 @@ The Target C API currently only supports additions of `QkGate` instances with ei Sets the `acquire_alignment` value of this `QkTarget`. - + #### Example - + QkTarget \*target = qk\_target\_new(5); // The value defaults to 0 qk\_target\_set\_acquire\_alignment(target, 5); - + #### Safety - + Behavior is undefined if `QkTarget` is not a valid, non-null pointer to a `QkTarget`. @@ -423,7 +423,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Creates a copy of the `QkTarget`. - + #### Example @@ -437,11 +437,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`. @@ -459,7 +459,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Free the `QkTarget`. - + #### Example @@ -468,11 +468,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`. @@ -486,7 +486,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Adds a gate to the `QkTarget` through a `QkTargetEntry`. - + #### Example @@ -498,11 +498,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`. @@ -523,7 +523,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Modifies the properties of a gate in the `QkTarget`. - + #### Example @@ -538,11 +538,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`. @@ -567,7 +567,7 @@ The Target C API currently only supports additions of `QkGate` instances with ei Returns the number of instructions tracked by a `QkTarget`. - + #### Example @@ -579,11 +579,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`. diff --git a/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx b/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx index c562042800d..dee4aae95f4 100644 --- a/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx +++ b/docs/api/qiskit-c/dev/qk-transpiler-passes.mdx @@ -18,6 +18,108 @@ The Qiskit C API provides functions that execute transpiler passes in a standalo ## Functions +### qk\_transpiler\_pass\_standalone\_elide\_permutations + + + Run the ElidePermutations transpiler pass on a circuit. + + The ElidePermutations transpiler pass removes any permutation operations from a pre-layout circuit. + + 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 circuit and when a Swap gate is encountered it permutes the virtual qubits in the circuit and removes the swap gate. This will effectively remove any swap gates in the cirucit prior to running layout. This optimization is not valid after a layout has been set and should not be run in this case. + + + + #### Example + + ```c + QkCircuit *qc = qk_circuit_new(4, 0); + for (uint32_t i = 0; i < qk_circuit_num_qubits(qc) - 1; i++) { + uint32_t qargs[2] = {i, i + 1}; + for (uint32_t j = 0; j + + #### Safety + + + + Behavior is undefined if `circuit` is not a valid, non-null pointer to a `QkCircuit`. + + **Parameters** + + **circuit** – A pointer to the circuit to run ElidePermutations on + + **Returns** + + QkElidePermutationsResult object that contains the results of the pass + + +### qk\_transpiler\_pass\_standalone\_remove\_identity\_equivalent + + + Run the RemoveIdentityEquivalent transpiler pass on a circuit. + + Removes gates whose effect is close to an identity operation up to a global phase and up to the specified tolerance. Parameterized gates are not considered by this pass. + + For a cutoff fidelity $f$, this pass removes gates whose average gate fidelity with respect to the identity is below $f$. Concretely, a gate $G$ is removed if $\bar F < f$ where + +$$ + +bar{F} = \frac{1 + d F_{\text{process}}}{1 + d},\ + +F_{\text{process}} = \frac{|\mathrm{Tr}(G)|^2}{d^2} + +$$ + + where $d = 2^n$ is the dimension of the gate for $n$ qubits. + + + + #### Example + + ```c + QkTarget *target = qk_target_new(5) + QkTargetEntry *cx_entry = qk_target_entry_new(QkGate_CX); + for (uint32_t i = 0; i < current_num_qubits - 1; i++) { + uint32_t qargs[2] = {i, i + 1}; + double inst_error = 0.0090393 * (current_num_qubits - i); + double inst_duration = 0.020039; + qk_target_entry_add_property(cx_entry, qargs, 2, inst_duration, inst_error); + } + QkExitCode result_cx = qk_target_add_instruction(target, cx_entry); + QkCircuit *qc = qk_circuit_new(4, 0); + for (uint32_t i = 0; i < qk_circuit_num_qubits(qc) - 1; i++) { + uint32_t qargs[2] = {i, i + 1}; + for (uint32_t j = 0; j + + #### Safety + + + + Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`. + + **Parameters** + + * **circuit** – A pointer to the circuit to run RemoveIdentityEquivalent on. This circuit pointed to will be updated with the modified circuit if the pass is able to remove any gates. + * **target** – The target for the RemoveIdentityEquivalent pass. If `approximation_degree` is set to `NAN` the tolerance for determining whether an operation is equivalent to identity will be set to the reported error rate in the target. Otherwise the `target` is not used as the tolerance is independent of the target. + * **approximation\_degree** – The degree to approximate for the equivalence check. This can be a floating point value between 0 and 1, or `NAN`. If the value is 1 this does not approximate above the floating point precision. For a value \< 1 this is used as a scaling factor for the cutoff fidelity. If the value is `NAN` this approximates up to the fidelity for the gate specified in `target`. + + ### qk\_transpiler\_pass\_standalone\_vf2\_layout @@ -29,7 +131,7 @@ The Qiskit C API provides functions that execute transpiler passes in a standalo By default, this pass will construct a heuristic scoring map based on the error rates in the provided `target` argument. The function will continue searching for layouts and use the heuristic scoring to return the layout which will run with the best estimated fidelity. - + #### Example @@ -54,11 +156,11 @@ The Qiskit C API provides functions that execute transpiler passes in a standalo qk_vf2_layout_result_free(layout_result); ``` - + #### Safety - + Behavior is undefined if `circuit` or `target` is not a valid, non-null pointer to a `QkCircuit` and `QkTarget`. diff --git a/docs/api/qiskit-c/dev/qk-vf-2-layout-result.mdx b/docs/api/qiskit-c/dev/qk-vf-2-layout-result.mdx index 49b4838ca84..add6e944ab4 100644 --- a/docs/api/qiskit-c/dev/qk-vf-2-layout-result.mdx +++ b/docs/api/qiskit-c/dev/qk-vf-2-layout-result.mdx @@ -21,11 +21,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns Check whether a result was found. - + #### Safety - + Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2LayoutResult`. @@ -43,11 +43,11 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns Get the number of virtual qubits in the layout. - + #### Safety - + Behavior is undefined if `layout` is not a valid, non-null pointer to a `QkVF2LayoutResult`. The result must have a layout found. @@ -65,11 +65,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`. Also qubit must be a valid qubit for the circuit and there must be a result found. @@ -88,7 +88,7 @@ When running the `qk_transpiler_pass_standalone_vf2_layout` function it returns Free a `QkVF2LayoutResult` object - + #### Example @@ -96,11 +96,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/execution-span-double-slice-span.mdx b/docs/api/qiskit-ibm-runtime/dev/execution-span-double-slice-span.mdx index 659ec9a74c5..a40284d933b 100644 --- a/docs/api/qiskit-ibm-runtime/dev/execution-span-double-slice-span.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/execution-span-double-slice-span.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan # DoubleSliceSpan - + Bases: [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.execution_span.ExecutionSpan") An [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.ExecutionSpan") for data stored in a sliceable format. @@ -53,7 +53,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan ### contains\_pub - + Return whether the pub with the given index has data with dependence on this span. **Parameters** @@ -71,7 +71,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan ### filter\_by\_pub - + Return a new span whose slices are filtered to the provided pub indices. For example, if this span contains slice information for pubs with indices 1, 3, 4 and `[1, 4]` is provided, then the span returned by this method will contain slice information for only those two indices, but be identical otherwise. @@ -91,7 +91,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan ### mask - + Return an array-valued mask specifying which parts of a pub result depend on this span. **Parameters** @@ -102,6 +102,10 @@ python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan An array with the same shape as the pub data. + **Raises** + + **KeyError** – if the pub is not included in the span + **Return type** [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.3)")\[*Any*, [*dtype*](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype "(in NumPy v2.3)")\[[*bool*](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool "(in NumPy v2.3)")]] diff --git a/docs/api/qiskit-ibm-runtime/dev/execution-span-execution-span.mdx b/docs/api/qiskit-ibm-runtime/dev/execution-span-execution-span.mdx index 8337b23d430..feec9309710 100644 --- a/docs/api/qiskit-ibm-runtime/dev/execution-span-execution-span.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/execution-span-execution-span.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.ExecutionSpan # ExecutionSpan - + Bases: `ABC` Abstract parent for classes that store an execution time span for a subset of job data. @@ -66,7 +66,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.ExecutionSpan ### contains\_pub - + Return whether the pub with the given index has data with dependence on this span. **Parameters** @@ -84,7 +84,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.ExecutionSpan ### filter\_by\_pub - + Return a new span whose slices are filtered to the provided pub indices. For example, if this span contains slice information for pubs with indices 1, 3, 4 and `[1, 4]` is provided, then the span returned by this method will contain slice information for only those two indices, but be identical otherwise. @@ -104,7 +104,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.ExecutionSpan ### mask - + Return an array-valued mask specifying which parts of a pub result depend on this span. **Parameters** @@ -115,6 +115,10 @@ python_api_name: qiskit_ibm_runtime.execution_span.ExecutionSpan An array with the same shape as the pub data. + **Raises** + + **KeyError** – if the pub is not included in the span + **Return type** [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.3)")\[*Any*, [*dtype*](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype "(in NumPy v2.3)")\[[*bool*](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool "(in NumPy v2.3)")]] diff --git a/docs/api/qiskit-ibm-runtime/dev/execution-span-slice-span.mdx b/docs/api/qiskit-ibm-runtime/dev/execution-span-slice-span.mdx index 0abc0fd67c7..ba38b3d53cb 100644 --- a/docs/api/qiskit-ibm-runtime/dev/execution-span-slice-span.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/execution-span-slice-span.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.SliceSpan # SliceSpan - + Bases: [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.execution_span.ExecutionSpan") An [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.ExecutionSpan") for data stored in a sliceable format. @@ -53,7 +53,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.SliceSpan ### contains\_pub - + Return whether the pub with the given index has data with dependence on this span. **Parameters** @@ -71,7 +71,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.SliceSpan ### filter\_by\_pub - + Return a new span whose slices are filtered to the provided pub indices. For example, if this span contains slice information for pubs with indices 1, 3, 4 and `[1, 4]` is provided, then the span returned by this method will contain slice information for only those two indices, but be identical otherwise. @@ -91,7 +91,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.SliceSpan ### mask - + Return an array-valued mask specifying which parts of a pub result depend on this span. **Parameters** @@ -102,6 +102,10 @@ python_api_name: qiskit_ibm_runtime.execution_span.SliceSpan An array with the same shape as the pub data. + **Raises** + + **KeyError** – if the pub is not included in the span + **Return type** [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.3)")\[*Any*, [*dtype*](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype "(in NumPy v2.3)")\[[*bool*](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool "(in NumPy v2.3)")]] diff --git a/docs/api/qiskit-ibm-runtime/dev/execution-span-twirled-slice-span.mdx b/docs/api/qiskit-ibm-runtime/dev/execution-span-twirled-slice-span.mdx index f8f7e2d55b3..3b6cc71807d 100644 --- a/docs/api/qiskit-ibm-runtime/dev/execution-span-twirled-slice-span.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/execution-span-twirled-slice-span.mdx @@ -8,12 +8,12 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan # TwirledSliceSpan - + Bases: [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.execution_span.ExecutionSpan") An [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.ExecutionSpan") for data stored in a sliceable format when twirling. - This type of execution span references pub result data that came from a twirled sampler experiment which was executed by either prepending or appending an axis to paramater values to account for twirling. Concretely, `data_slices` is a map from pub slices to tuples `(twirled_shape, at_front, shape_slice, shots_slice)` where + This type of execution span references pub result data that came from a twirled sampler experiment which was executed by either prepending or appending an axis to parameter values to account for twirling. Concretely, `data_slices` is a map from pub slices to tuples `(twirled_shape, at_front, shape_slice, shots_slice)` where * `twirled_shape` is the shape tuple including a twirling axis, and where the last axis is shots per randomization, * `at_front` is whether `num_randomizations` is at the front of the tuple, as opposed to right before the `shots` axis at the end, @@ -24,7 +24,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan * **start** (*datetime*) – The start time of the span, in UTC. * **stop** (*datetime*) – The stop time of the span, in UTC. - * **data\_slices** (*dict\[int, tuple\[ShapeType, bool, slice, slice]]*) – A map from pub indices to length-4 tuples described above. + * **data\_slices** (*Mapping\[int, tuple\[ShapeType, bool, slice, slice]]*) – A map from pub indices to length-4 tuples described above. ## Attributes @@ -58,7 +58,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan ### contains\_pub - + Return whether the pub with the given index has data with dependence on this span. **Parameters** @@ -76,7 +76,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan ### filter\_by\_pub - + Return a new span whose slices are filtered to the provided pub indices. For example, if this span contains slice information for pubs with indices 1, 3, 4 and `[1, 4]` is provided, then the span returned by this method will contain slice information for only those two indices, but be identical otherwise. @@ -96,7 +96,7 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan ### mask - + Return an array-valued mask specifying which parts of a pub result depend on this span. **Parameters** @@ -107,6 +107,10 @@ python_api_name: qiskit_ibm_runtime.execution_span.TwirledSliceSpan An array with the same shape as the pub data. + **Raises** + + **KeyError** – if the pub is not included in the span + **Return type** [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.3)")\[*Any*, [*dtype*](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype "(in NumPy v2.3)")\[[*bool*](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool "(in NumPy v2.3)")]] diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-algiers.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-algiers.mdx index 833c02a3d17..b3bc9b497f0 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-algiers.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-algiers.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers # FakeAlgiers - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlgiers ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-almaden-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-almaden-v2.mdx index 46c46f3bafd..00da1b5bde2 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-almaden-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-almaden-v2.mdx @@ -41,10 +41,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -191,7 +187,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -209,7 +205,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 ### configuration - + Return the backend configuration. **Return type** @@ -217,27 +213,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -279,7 +257,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -292,7 +270,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -306,7 +285,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -347,7 +326,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAlmadenV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-armonk-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-armonk-v2.mdx index 1d792739f85..433e8592558 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-armonk-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-armonk-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 # FakeArmonkV2 - + Bases: `FakeBackendV2` A fake 1 qubit backend. @@ -35,10 +35,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -185,7 +181,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -203,7 +199,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 ### configuration - + Return the backend configuration. **Return type** @@ -211,27 +207,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -273,7 +251,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -286,7 +264,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -300,7 +279,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -341,7 +320,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeArmonkV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-athens-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-athens-v2.mdx index 7b336533326..9222a99ee80 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-athens-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-athens-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 # FakeAthensV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAthensV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-auckland.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-auckland.mdx index e380ceb6be5..3c71ab59909 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-auckland.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-auckland.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland # FakeAuckland - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeAuckland ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-belem-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-belem-v2.mdx index 31a05bfff4c..48d19afae84 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-belem-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-belem-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 # FakeBelemV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBelemV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-boeblingen-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-boeblingen-v2.mdx index a75e9c1774f..b508752133e 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-boeblingen-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-boeblingen-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 # FakeBoeblingenV2 - + Bases: `FakeBackendV2` A fake Boeblingen V2 backend. @@ -41,10 +41,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -191,7 +187,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -209,7 +205,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 ### configuration - + Return the backend configuration. **Return type** @@ -217,27 +213,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -279,7 +257,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -292,7 +270,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -306,7 +285,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -347,7 +326,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBoeblingenV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-bogota-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-bogota-v2.mdx index a901473ff4e..a4784842cf9 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-bogota-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-bogota-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 # FakeBogotaV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBogotaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brisbane.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brisbane.mdx index deda2c8baf2..8e478255e28 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brisbane.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brisbane.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane # FakeBrisbane - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrisbane ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brooklyn-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brooklyn-v2.mdx index 3a30c520cee..9e02870b8b3 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brooklyn-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-brooklyn-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 # FakeBrooklynV2 - + Bases: `FakeBackendV2` A fake Brooklyn V2 backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBrooklynV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-burlington-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-burlington-v2.mdx index 8777d55254d..36329f4bcf6 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-burlington-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-burlington-v2.mdx @@ -37,10 +37,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -187,7 +183,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -205,7 +201,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 ### configuration - + Return the backend configuration. **Return type** @@ -213,27 +209,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -275,7 +253,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -288,7 +266,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -302,7 +281,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -343,7 +322,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeBurlingtonV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cairo-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cairo-v2.mdx index 82d001430ec..ae0e51136b4 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cairo-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cairo-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 # FakeCairoV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCairoV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cambridge-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cambridge-v2.mdx index 7ef60ed0ddc..f36cd5bb425 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cambridge-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cambridge-v2.mdx @@ -43,10 +43,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -193,7 +189,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -211,7 +207,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 ### configuration - + Return the backend configuration. **Return type** @@ -219,27 +215,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -281,7 +259,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -294,7 +272,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -308,7 +287,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -349,7 +328,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCambridgeV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-casablanca-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-casablanca-v2.mdx index 978f335f135..42f07f6f171 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-casablanca-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-casablanca-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 # FakeCasablancaV2 - + Bases: `FakeBackendV2` A fake 7 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCasablancaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cusco.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cusco.mdx index e65c7acfc60..8cc557943d2 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cusco.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-cusco.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco # FakeCusco - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeCusco ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-essex-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-essex-v2.mdx index 160f6642cae..f453a74697b 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-essex-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-essex-v2.mdx @@ -39,10 +39,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -189,7 +185,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -207,7 +203,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 ### configuration - + Return the backend configuration. **Return type** @@ -215,27 +211,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -277,7 +255,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -290,7 +268,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -304,7 +283,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -345,7 +324,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeEssexV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fez.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fez.mdx index 91423d0db07..bb29bab450d 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fez.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fez.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez # FakeFez - + Bases: `FakeBackendV2` A fake 156 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFez ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fractional-backend.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fractional-backend.mdx index 11722d79070..04d98ac37fe 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fractional-backend.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-fractional-backend.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend # FakeFractionalBackend - + Bases: `FakeBackendV2` A fake 5 qubit backend with dynamic and fractional feature modeled based on FakeLima. @@ -38,10 +38,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -188,7 +184,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -206,7 +202,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend ### configuration - + Return the backend configuration. **Return type** @@ -214,27 +210,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -276,7 +254,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -289,7 +267,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -303,7 +282,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -344,7 +323,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeFractionalBackend ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-geneva.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-geneva.mdx index 17ab9bf8c5d..c861a1f9f3b 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-geneva.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-geneva.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva # FakeGeneva - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGeneva ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-guadalupe-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-guadalupe-v2.mdx index d96adaa3664..e9e18acdbe1 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-guadalupe-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-guadalupe-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 # FakeGuadalupeV2 - + Bases: `FakeBackendV2` A fake 16 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeGuadalupeV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-hanoi-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-hanoi-v2.mdx index 167cfb54a70..4498590f1af 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-hanoi-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-hanoi-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 # FakeHanoiV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeHanoiV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-jakarta-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-jakarta-v2.mdx index 32369bf232e..552b2f927f7 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-jakarta-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-jakarta-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 # FakeJakartaV2 - + Bases: `FakeBackendV2` A fake 7 qubit V2 backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJakartaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-johannesburg-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-johannesburg-v2.mdx index d2c94d0edd5..3bb07024ae0 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-johannesburg-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-johannesburg-v2.mdx @@ -41,10 +41,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -191,7 +187,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -209,7 +205,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 ### configuration - + Return the backend configuration. **Return type** @@ -217,27 +213,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -279,7 +257,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -292,7 +270,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -306,7 +285,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -347,7 +326,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeJohannesburgV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kawasaki.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kawasaki.mdx index 1bb8306a054..ccbbdfeed2e 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kawasaki.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kawasaki.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki # FakeKawasaki - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKawasaki ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kolkata-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kolkata-v2.mdx index 8329eb4db98..014e9404c35 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kolkata-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kolkata-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 # FakeKolkataV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKolkataV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyiv.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyiv.mdx index 2a489054f19..046d4a931c1 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyiv.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyiv.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv # FakeKyiv - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyiv ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyoto.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyoto.mdx index ab982092ab2..4e5dae5bda7 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyoto.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-kyoto.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto # FakeKyoto - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeKyoto ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lagos-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lagos-v2.mdx index 8b97bed77f9..39dde54d524 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lagos-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lagos-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 # FakeLagosV2 - + Bases: `FakeBackendV2` A fake 7 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLagosV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lima-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lima-v2.mdx index eed7b06a817..258e8db9bcb 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lima-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-lima-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 # FakeLimaV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLimaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-london-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-london-v2.mdx index 25a6195c0e5..802230cb627 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-london-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-london-v2.mdx @@ -39,10 +39,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -189,7 +185,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -207,7 +203,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 ### configuration - + Return the backend configuration. **Return type** @@ -215,27 +211,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -277,7 +255,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -290,7 +268,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -304,7 +283,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -345,7 +324,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeLondonV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manhattan-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manhattan-v2.mdx index ee2d652e3f1..2cfd6637503 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manhattan-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manhattan-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 # FakeManhattanV2 - + Bases: `FakeBackendV2` A fake Manhattan backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManhattanV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manila-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manila-v2.mdx index eba13d875ff..33b310388b0 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manila-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-manila-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 # FakeManilaV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeManilaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-marrakesh.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-marrakesh.mdx index d6720a2b927..f3a3719b277 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-marrakesh.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-marrakesh.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh # FakeMarrakesh - + Bases: `FakeBackendV2` A fake 156 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMarrakesh ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-melbourne-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-melbourne-v2.mdx index 470d7a65fcc..e5648b6f857 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-melbourne-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-melbourne-v2.mdx @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMelbourneV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-montreal-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-montreal-v2.mdx index 6b54d87a5d5..4f552623e34 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-montreal-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-montreal-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 # FakeMontrealV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMontrealV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-mumbai-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-mumbai-v2.mdx index 85140f64429..f5cbeaec1eb 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-mumbai-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-mumbai-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 # FakeMumbaiV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeMumbaiV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-nairobi-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-nairobi-v2.mdx index a7fc300e9ce..a86798c3031 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-nairobi-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-nairobi-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 # FakeNairobiV2 - + Bases: `FakeBackendV2` A fake 7 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeNairobiV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-osaka.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-osaka.mdx index 5090c03dda9..a56fbba5cf7 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-osaka.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-osaka.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka # FakeOsaka - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOsaka ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-oslo.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-oslo.mdx index 23b59c2aede..fa4f07d594b 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-oslo.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-oslo.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo # FakeOslo - + Bases: `FakeBackendV2` A fake 7 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOslo ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-ourense-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-ourense-v2.mdx index 813a3f090d4..599775003a5 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-ourense-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-ourense-v2.mdx @@ -37,10 +37,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -187,7 +183,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -205,7 +201,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 ### configuration - + Return the backend configuration. **Return type** @@ -213,27 +209,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -275,7 +253,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -288,7 +266,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -302,7 +281,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -343,7 +322,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeOurenseV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-paris-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-paris-v2.mdx index 1ef58fbf916..cef17606c9c 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-paris-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-paris-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 # FakeParisV2 - + Bases: `FakeBackendV2` A fake Paris backend. @@ -43,10 +43,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -193,7 +189,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -211,7 +207,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 ### configuration - + Return the backend configuration. **Return type** @@ -219,27 +215,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -281,7 +259,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -294,7 +272,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -308,7 +287,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -349,7 +328,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeParisV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-peekskill.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-peekskill.mdx index 1fd91ed4be8..17fda667e20 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-peekskill.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-peekskill.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill # FakePeekskill - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePeekskill ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-perth.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-perth.mdx index de36a70105c..50f4dc63ebe 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-perth.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-perth.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth # FakePerth - + Bases: `FakeBackendV2` A fake 7 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePerth ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-poughkeepsie-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-poughkeepsie-v2.mdx index 88fdab56315..ba7fa264da1 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-poughkeepsie-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-poughkeepsie-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 # FakePoughkeepsieV2 - + Bases: `FakeBackendV2` A fake Poughkeepsie backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePoughkeepsieV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-prague.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-prague.mdx index 82ab8ea9429..0903960ea01 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-prague.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-prague.mdx @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakePrague ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quebec.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quebec.mdx index fbacfcf8def..edf796099e0 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quebec.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quebec.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec # FakeQuebec - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuebec ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quito-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quito-v2.mdx index 932c6dafaf2..75cb6bf5e36 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quito-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-quito-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 # FakeQuitoV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeQuitoV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rochester-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rochester-v2.mdx index dd755fae780..b6b1c7abde3 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rochester-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rochester-v2.mdx @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRochesterV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rome-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rome-v2.mdx index bd86aff7bdf..11949615116 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rome-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-rome-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 # FakeRomeV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeRomeV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-santiago-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-santiago-v2.mdx index 2186a6df85a..2a71e032ac6 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-santiago-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-santiago-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 # FakeSantiagoV2 - + Bases: `FakeBackendV2` A fake Santiago backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSantiagoV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sherbrooke.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sherbrooke.mdx index 3aa44c2fe01..6af8cdcc330 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sherbrooke.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sherbrooke.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke # FakeSherbrooke - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSherbrooke ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-singapore-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-singapore-v2.mdx index fb6dfc95524..f5d882fd8e9 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-singapore-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-singapore-v2.mdx @@ -41,10 +41,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -191,7 +187,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -209,7 +205,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 ### configuration - + Return the backend configuration. **Return type** @@ -217,27 +213,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -279,7 +257,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -292,7 +270,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -306,7 +285,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -347,7 +326,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSingaporeV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sydney-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sydney-v2.mdx index 7336b292c9d..857fb852e54 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sydney-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-sydney-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 # FakeSydneyV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeSydneyV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-torino.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-torino.mdx index e3564280a66..4d99a9d2dfb 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-torino.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-torino.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino # FakeTorino - + Bases: `FakeBackendV2` A fake 133 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorino ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-toronto-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-toronto-v2.mdx index 84ed49be7b2..97489d2eb92 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-toronto-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-toronto-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 # FakeTorontoV2 - + Bases: `FakeBackendV2` A fake 27 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeTorontoV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-valencia-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-valencia-v2.mdx index 3acd6913217..01841a79f8d 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-valencia-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-valencia-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 # FakeValenciaV2 - + Bases: `FakeBackendV2` A fake 5 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeValenciaV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-vigo-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-vigo-v2.mdx index 242fc942ae9..1b48a593821 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-vigo-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-vigo-v2.mdx @@ -37,10 +37,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -187,7 +183,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -205,7 +201,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 ### configuration - + Return the backend configuration. **Return type** @@ -213,27 +209,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -275,7 +253,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -288,7 +266,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -302,7 +281,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -343,7 +322,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeVigoV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-washington-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-washington-v2.mdx index ad914424523..2d6d0e7f2c6 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-washington-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-washington-v2.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 # FakeWashingtonV2 - + Bases: `FakeBackendV2` A fake 127 qubit backend. @@ -31,10 +31,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -181,7 +177,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -199,7 +195,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 ### configuration - + Return the backend configuration. **Return type** @@ -207,27 +203,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -269,7 +247,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -282,7 +260,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -296,7 +275,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -337,7 +316,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeWashingtonV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-yorktown-v2.mdx b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-yorktown-v2.mdx index c4337ba74a6..b8dd8f1ab29 100644 --- a/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-yorktown-v2.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/fake-provider-fake-yorktown-v2.mdx @@ -39,10 +39,6 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v2.1)") object - ### defs\_filename - - - ### dirname @@ -189,7 +185,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -207,7 +203,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 ### configuration - + Return the backend configuration. **Return type** @@ -215,27 +211,9 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED)Return the pulse defaults for the backend - - **Parameters** - - **refresh** (*bool*) – If `True`, re-retrieve the backend defaults from the local file. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* - - ### properties - + Return the backend properties **Parameters** @@ -277,7 +255,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 ### refresh - + Update the data files from its real counterpart This method pulls the latest backend data files from their real counterpart and overwrites the corresponding files in the local installation: @@ -290,7 +268,8 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 **Parameters** - **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **service** ([*QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) – A `QiskitRuntimeService` instance + * **use\_fractional\_gates** (*bool*) – Set True to allow for the backends to include fractional gates. **Raises** @@ -304,7 +283,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 ### run - + Run on the fake backend using a simulator. This method runs circuit jobs (an individual or a list of QuantumCircuit) using BasicSimulator or Aer simulator and returns a [`Job`](/docs/api/qiskit/qiskit.providers.Job "(in Qiskit v2.1)") object. @@ -345,7 +324,7 @@ python_api_name: qiskit_ibm_runtime.fake_provider.FakeYorktownV2 ### status - + Return the backend status. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/ibm-backend.mdx b/docs/api/qiskit-ibm-runtime/dev/ibm-backend.mdx index 5218b4a27e1..9bffe71c65e 100644 --- a/docs/api/qiskit-ibm-runtime/dev/ibm-backend.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/ibm-backend.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend # IBMBackend - + Bases: [`BackendV2`](/docs/api/qiskit/qiskit.providers.BackendV2 "(in Qiskit v2.1)") Backend class interfacing with an IBM Quantum backend. @@ -296,7 +296,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### \_\_call\_\_ - + Call self as a function. **Return type** @@ -306,7 +306,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### check\_faulty - + Check if the input circuit uses faulty qubits or edges. **Parameters** @@ -324,7 +324,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### configuration - + Return the backend configuration. Backend configuration contains fixed information about the backend, such as its name, number of qubits, basis gates, coupling map, quantum volume, etc. @@ -352,29 +352,9 @@ python_api_name: qiskit_ibm_runtime.IBMBackend *QasmBackendConfiguration* - ### defaults - - - (DEPRECATED) Return the pulse defaults for the backend. - - The schema for default pulse configuration can be found in [Qiskit/ibm-quantum-schemas/default\_pulse\_configuration](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/default_pulse_configuration_schema.json). - - **Parameters** - - **refresh** (*bool*) – If `True`, re-query the server for the backend pulse defaults. Otherwise, return a cached version. - - **Returns** - - The backend pulse defaults or `None` if the backend does not support pulse. - - **Return type** - - *PulseDefaults* | None - - ### get\_translation\_stage\_plugin - + Return the default translation stage plugin name for IBM backends. **Return type** @@ -384,7 +364,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### properties - + Return the backend properties, subject to optional filtering. This data describes qubits properties (such as T1 and T2), gates properties (such as gate length and error), and other general properties of the backend. @@ -436,7 +416,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### refresh - + Retrieve the newest backend configuration and refresh the current backend target. **Return type** @@ -446,7 +426,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### run - + **Raises** **IBMBackendError** – The run() method is no longer supported. @@ -474,7 +454,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### status - + Return the backend status. @@ -496,7 +476,7 @@ python_api_name: qiskit_ibm_runtime.IBMBackend ### target\_history - + A [`qiskit.transpiler.Target`](/docs/api/qiskit/qiskit.transpiler.Target "(in Qiskit v2.1)") object for the backend. **Returns** 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 c0d61f96cd0..a71df9f09b0 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. @@ -87,6 +87,16 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService *Dict*\[str, str] | None + ### active\_instance + + + Return the crn of the current active instance. + + **Return type** + + str + + ### backend @@ -174,7 +184,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### check\_pending\_jobs - + (DEPRECATED) Check the number of pending jobs and wait for the oldest pending job if the maximum number of pending jobs has been reached. **Return type** @@ -204,7 +214,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### delete\_job - + (DEPRECATED) Delete a runtime job. Note that this operation cannot be reversed. @@ -225,7 +235,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### instances - + **Return a list that contains a series of dictionaries with the** following instance identifiers per instance: “crn”, “plan”, “name”. @@ -264,7 +274,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### jobs - + Retrieve all runtime jobs, subject to optional filtering. **Parameters** @@ -274,7 +284,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService * **backend\_name** (*str | None*) – Name of the backend to retrieve jobs from. * **pending** (*bool | None*) – Filter by job pending state. If `True`, ‘QUEUED’ and ‘RUNNING’ jobs are included. If `False`, ‘DONE’, ‘CANCELLED’ and ‘ERROR’ jobs are included. * **program\_id** (*str | None*) – Filter by Program ID. - * **instance** (*str | None*) – (DEPRECATED) This is parameter is no longer supported on the new IBM Quantum Platform. It will be removed in a future release. + * **instance** (*str | None*) – Filter by IBM Cloud instance crn. * **job\_tags** (*List\[str] | None*) – Filter by tags assigned to jobs. Matched jobs are associated with all tags. * **session\_id** (*str | None*) – Filter by session id. All jobs in the session will be returned in desceding order of the job creation date. * **created\_after** (*datetime | None*) – Filter by the given start date, in local time. This is used to find jobs whose creation dates are after (greater than or equal to) this local date/time. @@ -296,7 +306,7 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### least\_busy - + Return the least busy available backend. **Parameters** @@ -382,8 +392,8 @@ python_api_name: qiskit_ibm_runtime.QiskitRuntimeService ### usage - - For the ibm\_quantum channel return monthly open plan usage information. For the ibm\_cloud and ibm\_quantum\_platform channels return usage information for the current active instance. + + Return usage information for the current active instance. **Returns** diff --git a/docs/api/qiskit-ibm-runtime/dev/runtime-decoder.mdx b/docs/api/qiskit-ibm-runtime/dev/runtime-decoder.mdx index 10b71575692..bcfd494705f 100644 --- a/docs/api/qiskit-ibm-runtime/dev/runtime-decoder.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/runtime-decoder.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeDecoder # RuntimeDecoder - + Bases: `JSONDecoder` JSON Decoder used by runtime service. @@ -40,7 +40,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeDecoder ### object\_hook - + Called to decode object. **Parameters** diff --git a/docs/api/qiskit-ibm-runtime/dev/runtime-encoder.mdx b/docs/api/qiskit-ibm-runtime/dev/runtime-encoder.mdx index 3151e7c3f81..2af82f45282 100644 --- a/docs/api/qiskit-ibm-runtime/dev/runtime-encoder.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/runtime-encoder.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeEncoder # RuntimeEncoder - + Bases: `JSONEncoder` JSON Encoder used by runtime service. @@ -45,7 +45,7 @@ python_api_name: qiskit_ibm_runtime.RuntimeEncoder ### default - + Implement this method in a subclass such that it returns a serializable object for `o`, or calls the base implementation (to raise a `TypeError`). For example, to support arbitrary iterators, you could implement default like this: diff --git a/docs/api/qiskit-ibm-runtime/dev/transpiler-passes-fold-rzz-angle.mdx b/docs/api/qiskit-ibm-runtime/dev/transpiler-passes-fold-rzz-angle.mdx index 612a499eaa6..0cd952f23ff 100644 --- a/docs/api/qiskit-ibm-runtime/dev/transpiler-passes-fold-rzz-angle.mdx +++ b/docs/api/qiskit-ibm-runtime/dev/transpiler-passes-fold-rzz-angle.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle # FoldRzzAngle - + Bases: [`TransformationPass`](/docs/api/qiskit/qiskit.transpiler.TransformationPass "(in Qiskit v2.1)") Fold Rzz gate angle into calibrated range of 0-pi/2 with local gate tweaks. @@ -92,7 +92,7 @@ python_api_name: qiskit_ibm_runtime.transpiler.passes.FoldRzzAngle ### run - + Run a pass on the DAGCircuit. This is implemented by the pass developer. **Parameters** diff --git a/docs/api/qiskit/dev/_toc.json b/docs/api/qiskit/dev/_toc.json index 3fb689da4e9..78da7478775 100644 --- a/docs/api/qiskit/dev/_toc.json +++ b/docs/api/qiskit/dev/_toc.json @@ -1460,6 +1460,10 @@ "title": "MCMTSynthesisVChain", "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain" }, + { + "title": "MCMTSynthesisXGate", + "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate" + }, { "title": "MCXSynthesis1CleanB95", "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95" @@ -1496,6 +1500,10 @@ "title": "MCXSynthesisNDirtyI15", "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15" }, + { + "title": "MCXSynthesisNoAuxHP24", + "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24" + }, { "title": "MCXSynthesisNoAuxV24", "url": "/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24" diff --git a/docs/api/qiskit/dev/circuit.mdx b/docs/api/qiskit/dev/circuit.mdx index 8ffab3cacfc..28dd623429c 100644 --- a/docs/api/qiskit/dev/circuit.mdx +++ b/docs/api/qiskit/dev/circuit.mdx @@ -583,10 +583,10 @@ A circuit can contain manual classical storage locations, represented internally Various parametric [`Instruction`](qiskit.circuit.Instruction "qiskit.circuit.Instruction") instances in Qiskit can be parametrized in ways that are designed to be resolved at compile time. These are characterized by the use of the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") and [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") classes. -| | | -| ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")(name, \*\[, uuid]) | A compile-time symbolic parameter. | -| [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")(symbol\_map, expr, \*\[, ...]) | ParameterExpression class to enable creating expressions of Parameters. | +| | | +| ------------------------------------------------------------------------------------------------ | ---------------------------------- | +| [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") | A compile-time symbolic parameter. | +| [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") | A parameter expression. | The main way that this differs from the `expr.Var` variables used in real-time classical computation is that [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") is a symbolic representation of a mathematical expression. The semantics of the expression are those of regular mathematics over the continuous real numbers (and, in limited cases, over the complex numbers). In contrast, [`Var`](circuit_classical#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") is a handle to a variable stored on a classical computer, such as a floating-point value or an fixed-width integer, which are always discrete. @@ -596,10 +596,10 @@ The “compile-time” part of these parameters means that you typically will wa You may want to use many parameters that are related to each other. To make this easier (and to avoid you needing to come up with many names), you can use the convenience constructor [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector"). The elements of the vector are all valid [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances, of a special subclass [`ParameterVectorElement`](qiskit.circuit.ParameterVectorElement "qiskit.circuit.ParameterVectorElement"). -| | | -| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector")(name\[, length]) | A container of many related [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. | -| [`ParameterVectorElement`](qiskit.circuit.ParameterVectorElement "qiskit.circuit.ParameterVectorElement")(vector, index\[, uuid]) | An element of a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector"). | +| | | +| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector")(name\[, length]) | A container of many related [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. | +| [`ParameterVectorElement`](qiskit.circuit.ParameterVectorElement "qiskit.circuit.ParameterVectorElement") | An element of a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector"). | diff --git a/docs/api/qiskit/dev/qasm3.mdx b/docs/api/qiskit/dev/qasm3.mdx index 638425987a6..947cdcc2873 100644 --- a/docs/api/qiskit/dev/qasm3.mdx +++ b/docs/api/qiskit/dev/qasm3.mdx @@ -94,7 +94,7 @@ Both of these exporter functions are single-use wrappers around the main [`Expor If `True`, then bits may be contained in more than one register. If so, the registers will be emitted using “alias” definitions, which might not be well supported by consumers of OpenQASM 3. Defaults to `False` or the value of `alias_classical_registers`. - New in version 0.25.0. + * **indent** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – the indentation string to use for each level within an indented block. Can be set to the empty string to disable indentation. @@ -249,7 +249,9 @@ Currently only two high-level functions are offered, as Qiskit support for impor [**QASM3ImporterError**](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") – if the OpenQASM 3 file is invalid, or cannot be represented by a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). - New in version 2.1: The `annotation_handlers` argument. This requires `qiskit_qasm3_import>=0.6.0`. + + The `annotation_handlers` argument. This requires `qiskit_qasm3_import>=0.6.0`. + ### loads @@ -274,7 +276,9 @@ Currently only two high-level functions are offered, as Qiskit support for impor [**QASM3ImporterError**](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") – if the OpenQASM 3 file is invalid, or cannot be represented by a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). - New in version 2.1: The `annotation_handlers` argument. This requires `qiskit_qasm3_import>=0.6.0`. + + The `annotation_handlers` argument. This requires `qiskit_qasm3_import>=0.6.0`. + Both of these two functions raise [`QASM3ImporterError`](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") on failure. diff --git a/docs/api/qiskit/dev/qiskit.circuit.AnnotatedOperation.mdx b/docs/api/qiskit/dev/qiskit.circuit.AnnotatedOperation.mdx index 19a18d6d0b8..8fe703046bb 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.AnnotatedOperation.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.AnnotatedOperation.mdx @@ -156,11 +156,11 @@ python_api_name: qiskit.circuit.AnnotatedOperation **Parameters** - **parameter** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + **parameter** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – **Return type** - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") + [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") diff --git a/docs/api/qiskit/dev/qiskit.circuit.Parameter.mdx b/docs/api/qiskit/dev/qiskit.circuit.Parameter.mdx index aba15f352b5..d707d2a7c2c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.Parameter.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.Parameter.mdx @@ -8,8 +8,8 @@ python_api_name: qiskit.circuit.Parameter # Parameter - - Bases: [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + + Bases: [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") A compile-time symbolic parameter. @@ -25,28 +25,23 @@ python_api_name: qiskit.circuit.Parameter from qiskit.circuit import QuantumCircuit, Parameter # create the parameter - phi = Parameter('phi') + phi = Parameter("phi") qc = QuantumCircuit(1) # parameterize the rotation qc.rx(phi, 0) - qc.draw('mpl') + qc.draw("mpl") # bind the parameters after circuit to create a bound circuit bc = qc.assign_parameters({phi: 3.14}) bc.measure_all() - bc.draw('mpl') + bc.draw("mpl") ``` ![Circuit diagram output by the previous code.](/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_00.avif) ![Circuit diagram output by the previous code.](/docs/images/api/qiskit/dev/qiskit-circuit-Parameter-1_01.avif) - **Parameters** - - * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – name of the `Parameter`, used for visual representation. This can be any Unicode string, e.g. “ϕ”. - * **uuid** (*UUID | None*) – For advanced usage only. Override the UUID of this parameter, in order to make it compare equal to some other parameter object. By default, two parameters with the same name do not compare equal to help catch shadowing bugs when two circuits containing the same named parameters are spurious combined. Setting the `uuid` field when creating two parameters to the same thing (along with the same name) allows them to be equal. This is useful during serialization and deserialization. - ## Attributes ### name @@ -58,7 +53,11 @@ python_api_name: qiskit.circuit.Parameter ### parameters - Returns a set of the unbound Parameters in the expression. + Get the parameters present in the expression. + + + Qiskit guarantees equality (via `==`) of parameters retrieved from an expression with the original [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects used to create this expression, but does **not guarantee** `is` comparisons to succeed. + ### uuid @@ -73,36 +72,36 @@ python_api_name: qiskit.circuit.Parameter ### abs - - Absolute of a ParameterExpression + + Take the absolute value of the expression. ### arccos - - Arccos of a ParameterExpression + + Arccosine of the expression. ### arcsin - - Arcsin of a ParameterExpression + + Arcsine of the expression. ### arctan - - Arctan of a ParameterExpression + + Arctangent of the expression. ### assign - + Assign one parameter to a value, which can either be numeric or another parameter expression. **Parameters** - * **parameter** ([*Parameter*](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – A parameter in this expression whose value will be updated. + * **parameter** – A parameter in this expression whose value will be updated. * **value** – The new value to bind to. **Returns** @@ -112,19 +111,19 @@ python_api_name: qiskit.circuit.Parameter ### bind - + Binds the provided set of parameters to their corresponding values. **Parameters** - * **parameter\_values** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – Mapping of Parameter instances to the numeric value to which they will be bound. - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – If `False`, raises an error if `parameter_values` contains Parameters in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + * **parameter\_values** – Mapping of [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances to the numeric value to which they will be bound. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_values` contains [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. **Raises** * [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – - * If parameter\_values contains Parameters outside those in self. - If a non-numeric value is passed in parameter\_values. + * If parameter\_values contains parameters outside those in self. - If a non-numeric value is passed in `parameter_values`. * [**ZeroDivisionError**](https://docs.python.org/3/library/exceptions.html#ZeroDivisionError "(in Python v3.13)") – @@ -132,128 +131,122 @@ python_api_name: qiskit.circuit.Parameter **Returns** - A new expression parameterized by any parameters which were not bound by parameter\_values. - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + A new expression parameterized by any parameters which were not bound by `parameter_values`. ### conjugate - - Return the conjugate. - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + + Return the complex conjugate of the expression. ### cos - - Cosine of a ParameterExpression + + Cosine of the expression. ### exp - - Exponential of a ParameterExpression + + Exponentiate the expression. ### gradient - - Get the derivative of a real parameter expression w\.r.t. a specified parameter. - - - This method assumes that the parameter expression represents a **real expression only**. Calling this method on a parameter expression that contains complex values, or binding complex values to parameters in the expression is undefined behavior. - + + Return derivative of this expression with respect to the input parameter. **Parameters** - **param** ([*Parameter*](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – Parameter w\.r.t. which we want to take the derivative + **param** – The parameter with respect to which the derivative is calculated. **Returns** - ParameterExpression representing the gradient of param\_expr w\.r.t. param or complex or float number - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + The derivative. ### is\_real - - Return whether the expression is real - + + Check whether the expression represents a real number. - ### log - - - Logarithm of a ParameterExpression + Note that this will return `None` if there are unbound parameters, in which case it cannot be determined whether the expression is real. - ### numeric + ### is\_symbol - - Return a Python number representing this object, using the most restrictive of [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)"), [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") and [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") that is valid for this object. + + Check if the expression corresponds to a plain symbol. - In general, an [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") is only returned if the expression only involved symbolic integers. If floating-point values were used during the evaluation, the return value will be a [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") regardless of whether the represented value is an integer. This is because floating-point values “infect” symbolic computations by their inexact nature, and symbolic libraries will use inexact floating-point semantics not exact real-number semantics when they are involved. If you want to assert that all floating-point calculations *were* carried out at infinite precision (i.e. [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") could represent every intermediate value exactly), you can use [`float.is_integer()`](https://docs.python.org/3/library/stdtypes.html#float.is_integer "(in Python v3.13)") to check if the return float represents an integer and cast it using [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") if so. This would be an unusual pattern; typically one requires this by only ever using explicitly [`Rational`](https://docs.python.org/3/library/numbers.html#numbers.Rational "(in Python v3.13)") objects while working with symbolic expressions. + **Returns** - This is more reliable and performant than using [`is_real()`](#qiskit.circuit.Parameter.is_real "qiskit.circuit.Parameter.is_real") followed by calling [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") or [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)"), as in some cases [`is_real()`](#qiskit.circuit.Parameter.is_real "qiskit.circuit.Parameter.is_real") needs to force a floating-point evaluation to determine an accurate result to work around bugs in the upstream symbolic libraries. + `True` is this expression corresponds to a symbol, `False` otherwise. + - **Returns** + ### log - A Python number representing the object. + + Take the natural logarithm of the expression. + - **Raises** + ### numeric - [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – if there are unbound parameters. + + Cast this expression to a numeric value. - **Return type** + **Parameters** - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + **strict** – If `True` (default) this function raises an error if there are any unbound symbols in the expression. If `False`, this allows casting if the expression represents a numeric value, regardless of unbound symbols. For example `(0 * Parameter("x"))` is 0 but has the symbol `x` present. ### sign - - Sign of a ParameterExpression + + Return the sign of the expression. ### sin - - Sine of a ParameterExpression + + Sine of the expression. ### subs - - Substitute self with the corresponding parameter in `parameter_map`. + + Returns a new expression with replacement parameters. **Parameters** - * **parameter\_map** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – + * **parameter\_map** – Mapping from [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in `self` to the [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") instances with which they should be replaced. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_map` contains [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + + **Raises** + + [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – + + * If parameter\_map contains parameters outside those in self. - If the replacement parameters in `parameter_map` would result in a name conflict in the generated expression. + + **Returns** + + A new expression with the specified parameters replaced. ### sympify - - Return symbolic expression as a raw Sympy object. + + Return a SymPy equivalent of this expression. - - This is for interoperability only. Qiskit will not accept or work with raw Sympy or Symegine expressions in its parameters, because they do not contain the tracking information used in circuit-parameter binding and assignment. - + **Returns** + + A SymPy equivalent of this expression. ### tan - - Tangent of a ParameterExpression + + Tangent of the expression. diff --git a/docs/api/qiskit/dev/qiskit.circuit.ParameterExpression.mdx b/docs/api/qiskit/dev/qiskit.circuit.ParameterExpression.mdx index 48746af5c4f..dbc13ec3b93 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.ParameterExpression.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.ParameterExpression.mdx @@ -8,88 +8,81 @@ python_api_name: qiskit.circuit.ParameterExpression # ParameterExpression - + Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)") - ParameterExpression class to enable creating expressions of Parameters. + A parameter expression. - Create a new [`ParameterExpression`](#qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"). - - Not intended to be called directly, but to be instantiated via operations on other [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") or [`ParameterExpression`](#qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") objects. The constructor of this object is **not** a public interface and should not ever be used directly. - - **Parameters** - - * **symbol\_map** (*Dict\[*[*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")*, \[*[*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression")*,* [*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")*, or* [*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – Mapping of [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances to the `sympy.Symbol` serving as their placeholder in expr. - * **expr** (*SymbolExpr or* [*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – Expression with Rust’s SymbolExprPy or string + This is backed by Qiskit’s symbolic expression engine and a cache for the parameters inside the expression. ## Attributes ### parameters - Returns a set of the unbound Parameters in the expression. + Get the parameters present in the expression. + + + Qiskit guarantees equality (via `==`) of parameters retrieved from an expression with the original [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects used to create this expression, but does **not guarantee** `is` comparisons to succeed. + ## Methods ### abs - - Absolute of a ParameterExpression + + Take the absolute value of the expression. ### arccos - - Arccos of a ParameterExpression + + Arccosine of the expression. ### arcsin - - Arcsin of a ParameterExpression + + Arcsine of the expression. ### arctan - - Arctan of a ParameterExpression + + Arctangent of the expression. ### assign - + Assign one parameter to a value, which can either be numeric or another parameter expression. **Parameters** - * **parameter** ([*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – A parameter in this expression whose value will be updated. - * **value** ([*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The new value to bind to. + * **parameter** – A parameter in this expression whose value will be updated. + * **value** – The new value to bind to. **Returns** A new expression parameterized by any parameters which were not bound by assignment. - - **Return type** - - [*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") ### bind - + Binds the provided set of parameters to their corresponding values. **Parameters** - * **parameter\_values** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – Mapping of Parameter instances to the numeric value to which they will be bound. - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – If `False`, raises an error if `parameter_values` contains Parameters in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + * **parameter\_values** – Mapping of [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances to the numeric value to which they will be bound. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_values` contains [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. **Raises** * [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – - * If parameter\_values contains Parameters outside those in self. - If a non-numeric value is passed in parameter\_values. + * If parameter\_values contains parameters outside those in self. - If a non-numeric value is passed in `parameter_values`. * [**ZeroDivisionError**](https://docs.python.org/3/library/exceptions.html#ZeroDivisionError "(in Python v3.13)") – @@ -97,142 +90,122 @@ python_api_name: qiskit.circuit.ParameterExpression **Returns** - A new expression parameterized by any parameters which were not bound by parameter\_values. - - **Return type** - - [*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + A new expression parameterized by any parameters which were not bound by `parameter_values`. ### conjugate - - Return the conjugate. - - **Return type** - - [*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + + Return the complex conjugate of the expression. ### cos - - Cosine of a ParameterExpression + + Cosine of the expression. ### exp - - Exponential of a ParameterExpression + + Exponentiate the expression. ### gradient - - Get the derivative of a real parameter expression w\.r.t. a specified parameter. - - - This method assumes that the parameter expression represents a **real expression only**. Calling this method on a parameter expression that contains complex values, or binding complex values to parameters in the expression is undefined behavior. - + + Return derivative of this expression with respect to the input parameter. **Parameters** - **param** ([*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – Parameter w\.r.t. which we want to take the derivative + **param** – The parameter with respect to which the derivative is calculated. **Returns** - ParameterExpression representing the gradient of param\_expr w\.r.t. param or complex or float number - - **Return type** - - [*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + The derivative. ### is\_real - - Return whether the expression is real - + + Check whether the expression represents a real number. - ### log - - - Logarithm of a ParameterExpression + Note that this will return `None` if there are unbound parameters, in which case it cannot be determined whether the expression is real. - ### numeric + ### is\_symbol - - Return a Python number representing this object, using the most restrictive of [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)"), [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") and [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") that is valid for this object. + + Check if the expression corresponds to a plain symbol. - In general, an [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") is only returned if the expression only involved symbolic integers. If floating-point values were used during the evaluation, the return value will be a [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") regardless of whether the represented value is an integer. This is because floating-point values “infect” symbolic computations by their inexact nature, and symbolic libraries will use inexact floating-point semantics not exact real-number semantics when they are involved. If you want to assert that all floating-point calculations *were* carried out at infinite precision (i.e. [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") could represent every intermediate value exactly), you can use [`float.is_integer()`](https://docs.python.org/3/library/stdtypes.html#float.is_integer "(in Python v3.13)") to check if the return float represents an integer and cast it using [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") if so. This would be an unusual pattern; typically one requires this by only ever using explicitly [`Rational`](https://docs.python.org/3/library/numbers.html#numbers.Rational "(in Python v3.13)") objects while working with symbolic expressions. + **Returns** - This is more reliable and performant than using [`is_real()`](#qiskit.circuit.ParameterExpression.is_real "qiskit.circuit.ParameterExpression.is_real") followed by calling [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") or [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)"), as in some cases [`is_real()`](#qiskit.circuit.ParameterExpression.is_real "qiskit.circuit.ParameterExpression.is_real") needs to force a floating-point evaluation to determine an accurate result to work around bugs in the upstream symbolic libraries. + `True` is this expression corresponds to a symbol, `False` otherwise. + - **Returns** + ### log - A Python number representing the object. + + Take the natural logarithm of the expression. + - **Raises** + ### numeric - [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – if there are unbound parameters. + + Cast this expression to a numeric value. - **Return type** + **Parameters** - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + **strict** – If `True` (default) this function raises an error if there are any unbound symbols in the expression. If `False`, this allows casting if the expression represents a numeric value, regardless of unbound symbols. For example `(0 * Parameter("x"))` is 0 but has the symbol `x` present. ### sign - - Sign of a ParameterExpression + + Return the sign of the expression. ### sin - - Sine of a ParameterExpression + + Sine of the expression. ### subs - - Returns a new Expression with replacement Parameters. + + Returns a new expression with replacement parameters. **Parameters** - * **parameter\_map** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – Mapping from Parameters in self to the ParameterExpression instances with which they should be replaced. - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – If `False`, raises an error if `parameter_map` contains Parameters in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + * **parameter\_map** – Mapping from [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in `self` to the [`ParameterExpression`](#qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") instances with which they should be replaced. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_map` contains [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. **Raises** [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – - * If parameter\_map contains Parameters outside those in self. - If the replacement Parameters in parameter\_map would result in a name conflict in the generated expression. + * If parameter\_map contains parameters outside those in self. - If the replacement parameters in `parameter_map` would result in a name conflict in the generated expression. **Returns** A new expression with the specified parameters replaced. - - **Return type** - - [*ParameterExpression*](#qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") ### sympify - - Return symbolic expression as a raw Sympy object. + + Return a SymPy equivalent of this expression. - - This is for interoperability only. Qiskit will not accept or work with raw Sympy or Symegine expressions in its parameters, because they do not contain the tracking information used in circuit-parameter binding and assignment. - + **Returns** + + A SymPy equivalent of this expression. ### tan - - Tangent of a ParameterExpression + + Tangent of the expression. diff --git a/docs/api/qiskit/dev/qiskit.circuit.ParameterVector.mdx b/docs/api/qiskit/dev/qiskit.circuit.ParameterVector.mdx index 2d99cac7af0..6b46981ab47 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.ParameterVector.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.ParameterVector.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.circuit.ParameterVector # ParameterVector - + Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)") A container of many related [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects. @@ -39,7 +39,7 @@ python_api_name: qiskit.circuit.ParameterVector ### index - + Find the index of a [`ParameterVectorElement`](qiskit.circuit.ParameterVectorElement "qiskit.circuit.ParameterVectorElement") within the list. It is typically much faster to use the [`ParameterVectorElement.index`](qiskit.circuit.ParameterVectorElement#index "qiskit.circuit.ParameterVectorElement.index") property. @@ -47,7 +47,7 @@ python_api_name: qiskit.circuit.ParameterVector ### resize - + Resize the parameter vector. If necessary, new elements are generated. Note that the UUID of each [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") element will be generated deterministically given the root UUID of the `ParameterVector` and the index of the element. In particular, if a `ParameterVector` is resized to be smaller and then later resized to be larger, the UUID of the later generated element at a given index will be the same as the UUID of the previous element at that index. This is to ensure that the parameter instances do not change. diff --git a/docs/api/qiskit/dev/qiskit.circuit.ParameterVectorElement.mdx b/docs/api/qiskit/dev/qiskit.circuit.ParameterVectorElement.mdx index a9ba9a9ac02..673ed1ad722 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.ParameterVectorElement.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.ParameterVectorElement.mdx @@ -8,8 +8,8 @@ python_api_name: qiskit.circuit.ParameterVectorElement # ParameterVectorElement - - Bases: [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.parameter.Parameter") + + Bases: [`Parameter`](qiskit.circuit.Parameter "qiskit._accelerate.circuit.Parameter") An element of a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector"). @@ -17,11 +17,6 @@ python_api_name: qiskit.circuit.ParameterVectorElement There is very little reason to ever construct this class directly. Objects of this type are automatically constructed efficiently as part of creating a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector"). - **Parameters** - - * **name** – name of the `Parameter`, used for visual representation. This can be any Unicode string, e.g. “ϕ”. - * **uuid** – For advanced usage only. Override the UUID of this parameter, in order to make it compare equal to some other parameter object. By default, two parameters with the same name do not compare equal to help catch shadowing bugs when two circuits containing the same named parameters are spurious combined. Setting the `uuid` field when creating two parameters to the same thing (along with the same name) allows them to be equal. This is useful during serialization and deserialization. - ## Attributes ### index @@ -39,7 +34,11 @@ python_api_name: qiskit.circuit.ParameterVectorElement ### parameters - Returns a set of the unbound Parameters in the expression. + Get the parameters present in the expression. + + + Qiskit guarantees equality (via `==`) of parameters retrieved from an expression with the original [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects used to create this expression, but does **not guarantee** `is` comparisons to succeed. + ### uuid @@ -60,36 +59,36 @@ python_api_name: qiskit.circuit.ParameterVectorElement ### abs - - Absolute of a ParameterExpression + + Take the absolute value of the expression. ### arccos - - Arccos of a ParameterExpression + + Arccosine of the expression. ### arcsin - - Arcsin of a ParameterExpression + + Arcsine of the expression. ### arctan - - Arctan of a ParameterExpression + + Arctangent of the expression. ### assign - + Assign one parameter to a value, which can either be numeric or another parameter expression. **Parameters** - * **parameter** ([*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – A parameter in this expression whose value will be updated. + * **parameter** – A parameter in this expression whose value will be updated. * **value** – The new value to bind to. **Returns** @@ -99,19 +98,19 @@ python_api_name: qiskit.circuit.ParameterVectorElement ### bind - + Binds the provided set of parameters to their corresponding values. **Parameters** - * **parameter\_values** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – Mapping of Parameter instances to the numeric value to which they will be bound. - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – If `False`, raises an error if `parameter_values` contains Parameters in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + * **parameter\_values** – Mapping of [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") instances to the numeric value to which they will be bound. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_values` contains [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. **Raises** * [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – - * If parameter\_values contains Parameters outside those in self. - If a non-numeric value is passed in parameter\_values. + * If parameter\_values contains parameters outside those in self. - If a non-numeric value is passed in `parameter_values`. * [**ZeroDivisionError**](https://docs.python.org/3/library/exceptions.html#ZeroDivisionError "(in Python v3.13)") – @@ -119,128 +118,122 @@ python_api_name: qiskit.circuit.ParameterVectorElement **Returns** - A new expression parameterized by any parameters which were not bound by parameter\_values. - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + A new expression parameterized by any parameters which were not bound by `parameter_values`. ### conjugate - - Return the conjugate. - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") + + Return the complex conjugate of the expression. ### cos - - Cosine of a ParameterExpression + + Cosine of the expression. ### exp - - Exponential of a ParameterExpression + + Exponentiate the expression. ### gradient - - Get the derivative of a real parameter expression w\.r.t. a specified parameter. - - - This method assumes that the parameter expression represents a **real expression only**. Calling this method on a parameter expression that contains complex values, or binding complex values to parameters in the expression is undefined behavior. - + + Return derivative of this expression with respect to the input parameter. **Parameters** - **param** ([*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – Parameter w\.r.t. which we want to take the derivative + **param** – The parameter with respect to which the derivative is calculated. **Returns** - ParameterExpression representing the gradient of param\_expr w\.r.t. param or complex or float number - - **Return type** - - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + The derivative. ### is\_real - - Return whether the expression is real - + + Check whether the expression represents a real number. - ### log - - - Logarithm of a ParameterExpression + Note that this will return `None` if there are unbound parameters, in which case it cannot be determined whether the expression is real. - ### numeric + ### is\_symbol - - Return a Python number representing this object, using the most restrictive of [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)"), [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") and [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") that is valid for this object. + + Check if the expression corresponds to a plain symbol. - In general, an [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") is only returned if the expression only involved symbolic integers. If floating-point values were used during the evaluation, the return value will be a [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") regardless of whether the represented value is an integer. This is because floating-point values “infect” symbolic computations by their inexact nature, and symbolic libraries will use inexact floating-point semantics not exact real-number semantics when they are involved. If you want to assert that all floating-point calculations *were* carried out at infinite precision (i.e. [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") could represent every intermediate value exactly), you can use [`float.is_integer()`](https://docs.python.org/3/library/stdtypes.html#float.is_integer "(in Python v3.13)") to check if the return float represents an integer and cast it using [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") if so. This would be an unusual pattern; typically one requires this by only ever using explicitly [`Rational`](https://docs.python.org/3/library/numbers.html#numbers.Rational "(in Python v3.13)") objects while working with symbolic expressions. + **Returns** - This is more reliable and performant than using [`is_real()`](#qiskit.circuit.ParameterVectorElement.is_real "qiskit.circuit.ParameterVectorElement.is_real") followed by calling [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") or [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)"), as in some cases [`is_real()`](#qiskit.circuit.ParameterVectorElement.is_real "qiskit.circuit.ParameterVectorElement.is_real") needs to force a floating-point evaluation to determine an accurate result to work around bugs in the upstream symbolic libraries. + `True` is this expression corresponds to a symbol, `False` otherwise. + - **Returns** + ### log - A Python number representing the object. + + Take the natural logarithm of the expression. + - **Raises** + ### numeric - [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – if there are unbound parameters. + + Cast this expression to a numeric value. - **Return type** + **Parameters** - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") | [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)") + **strict** – If `True` (default) this function raises an error if there are any unbound symbols in the expression. If `False`, this allows casting if the expression represents a numeric value, regardless of unbound symbols. For example `(0 * Parameter("x"))` is 0 but has the symbol `x` present. ### sign - - Sign of a ParameterExpression + + Return the sign of the expression. ### sin - - Sine of a ParameterExpression + + Sine of the expression. ### subs - - Substitute self with the corresponding parameter in `parameter_map`. + + Returns a new expression with replacement parameters. **Parameters** - * **parameter\_map** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) – - * **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – + * **parameter\_map** – Mapping from [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in `self` to the [`ParameterExpression`](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") instances with which they should be replaced. + * **allow\_unknown\_parameters** – If `False`, raises an error if `parameter_map` contains [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in the keys outside those present in the expression. If `True`, any such parameters are simply ignored. + + **Raises** + + [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – + + * If parameter\_map contains parameters outside those in self. - If the replacement parameters in `parameter_map` would result in a name conflict in the generated expression. + + **Returns** + + A new expression with the specified parameters replaced. ### sympify - - Return symbolic expression as a raw Sympy object. + + Return a SymPy equivalent of this expression. - - This is for interoperability only. Qiskit will not accept or work with raw Sympy or Symegine expressions in its parameters, because they do not contain the tracking information used in circuit-parameter binding and assignment. - + **Returns** + + A SymPy equivalent of this expression. ### tan - - Tangent of a ParameterExpression + + Tangent of the expression. diff --git a/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx b/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx index 2edf9171e79..e6977aac9f7 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.QuantumCircuit.mdx @@ -2513,7 +2513,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. * **q\_controls** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – The qubits used as the controls. * **q\_target** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit targeted by the gate. * **use\_basis\_gates** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – use p, u, cx basis gates. @@ -2541,7 +2541,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. + * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. * **q\_controls** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – The qubits used as the controls. * **q\_target** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit targeted by the gate. * **use\_basis\_gates** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – use p, u, cx basis gates. @@ -2672,7 +2672,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. * **qubits** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – The qubits to apply the gate to. **Returns** @@ -2693,7 +2693,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – THe angle of the rotation. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – THe angle of the rotation. * **qubit** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. **Returns** @@ -2828,8 +2828,8 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. - * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the axis of rotation in the x-y plane. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. + * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the axis of rotation in the x-y plane. * **qubit** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. **Returns** @@ -2915,9 +2915,9 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **vx** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – x-component of the rotation axis. - * **vy** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – y-component of the rotation axis. - * **vz** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – z-component of the rotation axis. + * **vx** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – x-component of the rotation axis. + * **vy** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – y-component of the rotation axis. + * **vz** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – z-component of the rotation axis. * **qubit** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. **Returns** @@ -2960,7 +2960,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The angle of the rotation. * **qubit1** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. * **qubit2** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. @@ -3004,7 +3004,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. * **qubit1** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. * **qubit2** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. @@ -3026,7 +3026,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. + * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. * **qubit** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. **Returns** @@ -3047,7 +3047,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. * **qubit1** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. * **qubit2** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. @@ -3069,7 +3069,7 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The rotation angle of the gate. * **qubit1** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. * **qubit2** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. @@ -3259,9 +3259,9 @@ python_api_name: qiskit.circuit.QuantumCircuit **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\theta$ rotation angle of the gate. - * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\phi$ rotation angle of the gate. - * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\lambda$ rotation angle of the gate. + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\theta$ rotation angle of the gate. + * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\phi$ rotation angle of the gate. + * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The $\lambda$ rotation angle of the gate. * **qubit** ([*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*QuantumRegister*](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *|*[*slice*](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") *|*[*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)")*\[*[*Qubit*](circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – The qubit(s) to apply the gate to. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.AND.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.AND.mdx index 65435a14287..5b11f3df579 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.AND.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.AND.mdx @@ -37,470 +37,6 @@ python_api_name: qiskit.circuit.library.AND ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.AND.unit "qiskit.circuit.library.AND.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.AND.num_input_vars "qiskit.circuit.library.AND.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.AND.num_input_vars "qiskit.circuit.library.AND.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.AND.num_vars "qiskit.circuit.library.AND.num_vars") + [`num_stretches()`](#qiskit.circuit.library.AND.num_stretches "qiskit.circuit.library.AND.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.AND.num_captured_vars "qiskit.circuit.library.AND.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.AND.duration "qiskit.circuit.library.AND.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.CDKMRippleCarryAdder.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.CDKMRippleCarryAdder.mdx index 603bd8f08d8..d94d3acd46e 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.CDKMRippleCarryAdder.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.CDKMRippleCarryAdder.mdx @@ -95,480 +95,6 @@ python_api_name: qiskit.circuit.library.CDKMRippleCarryAdder ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.CDKMRippleCarryAdder.unit "qiskit.circuit.library.CDKMRippleCarryAdder.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.CDKMRippleCarryAdder.num_input_vars "qiskit.circuit.library.CDKMRippleCarryAdder.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.CDKMRippleCarryAdder.num_input_vars "qiskit.circuit.library.CDKMRippleCarryAdder.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.CDKMRippleCarryAdder.num_vars "qiskit.circuit.library.CDKMRippleCarryAdder.num_vars") + [`num_stretches()`](#qiskit.circuit.library.CDKMRippleCarryAdder.num_stretches "qiskit.circuit.library.CDKMRippleCarryAdder.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.CDKMRippleCarryAdder.num_captured_vars "qiskit.circuit.library.CDKMRippleCarryAdder.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits, i.e. the number of bits in each input register. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.CDKMRippleCarryAdder.duration "qiskit.circuit.library.CDKMRippleCarryAdder.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.Diagonal.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.Diagonal.mdx index f860ab18ec2..ee89257896a 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.Diagonal.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.Diagonal.mdx @@ -27,470 +27,6 @@ python_api_name: qiskit.circuit.library.Diagonal ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.Diagonal.unit "qiskit.circuit.library.Diagonal.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.Diagonal.num_input_vars "qiskit.circuit.library.Diagonal.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.Diagonal.num_input_vars "qiskit.circuit.library.Diagonal.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.Diagonal.num_vars "qiskit.circuit.library.Diagonal.num_vars") + [`num_stretches()`](#qiskit.circuit.library.Diagonal.num_stretches "qiskit.circuit.library.Diagonal.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.Diagonal.num_captured_vars "qiskit.circuit.library.Diagonal.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.Diagonal.duration "qiskit.circuit.library.Diagonal.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.DraperQFTAdder.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.DraperQFTAdder.mdx index d8e573e94cd..b91c68d4610 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.DraperQFTAdder.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.DraperQFTAdder.mdx @@ -62,480 +62,6 @@ python_api_name: qiskit.circuit.library.DraperQFTAdder ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.DraperQFTAdder.unit "qiskit.circuit.library.DraperQFTAdder.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.DraperQFTAdder.num_input_vars "qiskit.circuit.library.DraperQFTAdder.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.DraperQFTAdder.num_input_vars "qiskit.circuit.library.DraperQFTAdder.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.DraperQFTAdder.num_vars "qiskit.circuit.library.DraperQFTAdder.num_vars") + [`num_stretches()`](#qiskit.circuit.library.DraperQFTAdder.num_stretches "qiskit.circuit.library.DraperQFTAdder.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.DraperQFTAdder.num_captured_vars "qiskit.circuit.library.DraperQFTAdder.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits, i.e. the number of bits in each input register. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.DraperQFTAdder.duration "qiskit.circuit.library.DraperQFTAdder.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.EfficientSU2.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.EfficientSU2.mdx index 72bbc5d77d2..21cdd3e3dd5 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.EfficientSU2.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.EfficientSU2.mdx @@ -86,476 +86,6 @@ python_api_name: qiskit.circuit.library.EfficientSU2 ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.EfficientSU2.unit "qiskit.circuit.library.EfficientSU2.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.EfficientSU2.num_input_vars "qiskit.circuit.library.EfficientSU2.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.EfficientSU2.num_input_vars "qiskit.circuit.library.EfficientSU2.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.EfficientSU2.num_vars "qiskit.circuit.library.EfficientSU2.num_vars") + [`num_stretches()`](#qiskit.circuit.library.EfficientSU2.num_stretches "qiskit.circuit.library.EfficientSU2.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.EfficientSU2.num_captured_vars "qiskit.circuit.library.EfficientSU2.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - ### parameter\_bounds @@ -566,120 +96,6 @@ python_api_name: qiskit.circuit.library.EfficientSU2 The parameter bounds. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.EfficientSU2.duration "qiskit.circuit.library.EfficientSU2.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.EvolvedOperatorAnsatz.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.EvolvedOperatorAnsatz.mdx index 4a35a836dea..def7d20e759 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.EvolvedOperatorAnsatz.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.EvolvedOperatorAnsatz.mdx @@ -26,90 +26,6 @@ python_api_name: qiskit.circuit.library.EvolvedOperatorAnsatz ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.EvolvedOperatorAnsatz.unit "qiskit.circuit.library.EvolvedOperatorAnsatz.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - ### evolution @@ -124,260 +40,6 @@ python_api_name: qiskit.circuit.library.EvolvedOperatorAnsatz [EvolutionSynthesis](qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis") - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.EvolvedOperatorAnsatz.num_input_vars "qiskit.circuit.library.EvolvedOperatorAnsatz.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.EvolvedOperatorAnsatz.num_input_vars "qiskit.circuit.library.EvolvedOperatorAnsatz.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.EvolvedOperatorAnsatz.num_vars "qiskit.circuit.library.EvolvedOperatorAnsatz.num_vars") + [`num_stretches()`](#qiskit.circuit.library.EvolvedOperatorAnsatz.num_stretches "qiskit.circuit.library.EvolvedOperatorAnsatz.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.EvolvedOperatorAnsatz.num_captured_vars "qiskit.circuit.library.EvolvedOperatorAnsatz.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - ### num\_qubits @@ -388,102 +50,6 @@ python_api_name: qiskit.circuit.library.EvolvedOperatorAnsatz The number of qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - ### operators @@ -498,152 +64,12 @@ python_api_name: qiskit.circuit.library.EvolvedOperatorAnsatz [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - ### preferred\_init\_points Getter of preferred initial points based on the given initial state. - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.EvolvedOperatorAnsatz.duration "qiskit.circuit.library.EvolvedOperatorAnsatz.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.ExactReciprocal.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.ExactReciprocal.mdx index 18c579ec719..4842d768488 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.ExactReciprocal.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.ExactReciprocal.mdx @@ -34,470 +34,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.ExactReciprocal.unit "qiskit.circuit.library.ExactReciprocal.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ExactReciprocal.num_input_vars "qiskit.circuit.library.ExactReciprocal.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ExactReciprocal.num_input_vars "qiskit.circuit.library.ExactReciprocal.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.ExactReciprocal.num_vars "qiskit.circuit.library.ExactReciprocal.num_vars") + [`num_stretches()`](#qiskit.circuit.library.ExactReciprocal.num_stretches "qiskit.circuit.library.ExactReciprocal.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.ExactReciprocal.num_captured_vars "qiskit.circuit.library.ExactReciprocal.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.ExactReciprocal.duration "qiskit.circuit.library.ExactReciprocal.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.ExcitationPreserving.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.ExcitationPreserving.mdx index 0f7cba29d51..973587bce3f 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.ExcitationPreserving.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.ExcitationPreserving.mdx @@ -104,476 +104,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.ExcitationPreserving.unit "qiskit.circuit.library.ExcitationPreserving.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ExcitationPreserving.num_input_vars "qiskit.circuit.library.ExcitationPreserving.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ExcitationPreserving.num_input_vars "qiskit.circuit.library.ExcitationPreserving.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.ExcitationPreserving.num_vars "qiskit.circuit.library.ExcitationPreserving.num_vars") + [`num_stretches()`](#qiskit.circuit.library.ExcitationPreserving.num_stretches "qiskit.circuit.library.ExcitationPreserving.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.ExcitationPreserving.num_captured_vars "qiskit.circuit.library.ExcitationPreserving.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - ### parameter\_bounds @@ -584,120 +114,6 @@ $$ The parameter bounds. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.ExcitationPreserving.duration "qiskit.circuit.library.ExcitationPreserving.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.FourierChecking.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.FourierChecking.mdx index 3813095acd4..cf2b6313799 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.FourierChecking.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.FourierChecking.mdx @@ -48,470 +48,6 @@ python_api_name: qiskit.circuit.library.FourierChecking ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.FourierChecking.unit "qiskit.circuit.library.FourierChecking.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.FourierChecking.num_input_vars "qiskit.circuit.library.FourierChecking.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.FourierChecking.num_input_vars "qiskit.circuit.library.FourierChecking.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.FourierChecking.num_vars "qiskit.circuit.library.FourierChecking.num_vars") + [`num_stretches()`](#qiskit.circuit.library.FourierChecking.num_stretches "qiskit.circuit.library.FourierChecking.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.FourierChecking.num_captured_vars "qiskit.circuit.library.FourierChecking.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.FourierChecking.duration "qiskit.circuit.library.FourierChecking.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.FunctionalPauliRotations.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.FunctionalPauliRotations.mdx index d81499a7f07..bfca6b9c59e 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.FunctionalPauliRotations.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.FunctionalPauliRotations.mdx @@ -23,12 +23,6 @@ python_api_name: qiskit.circuit.library.FunctionalPauliRotations ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - ### basis @@ -41,166 +35,6 @@ python_api_name: qiskit.circuit.library.FunctionalPauliRotations The kind of Pauli rotation used in controlled rotation. - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.FunctionalPauliRotations.unit "qiskit.circuit.library.FunctionalPauliRotations.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - ### num\_ancilla\_qubits @@ -211,112 +45,6 @@ python_api_name: qiskit.circuit.library.FunctionalPauliRotations The minimal number of ancillas required. - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.FunctionalPauliRotations.num_input_vars "qiskit.circuit.library.FunctionalPauliRotations.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.FunctionalPauliRotations.num_input_vars "qiskit.circuit.library.FunctionalPauliRotations.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.FunctionalPauliRotations.num_vars "qiskit.circuit.library.FunctionalPauliRotations.num_vars") + [`num_stretches()`](#qiskit.circuit.library.FunctionalPauliRotations.num_stretches "qiskit.circuit.library.FunctionalPauliRotations.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.FunctionalPauliRotations.num_captured_vars "qiskit.circuit.library.FunctionalPauliRotations.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - ### num\_state\_qubits @@ -327,186 +55,6 @@ python_api_name: qiskit.circuit.library.FunctionalPauliRotations The number of state qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.FunctionalPauliRotations.duration "qiskit.circuit.library.FunctionalPauliRotations.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GMS.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GMS.mdx index 84fc691f64b..0c4fcbba72c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GMS.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GMS.mdx @@ -57,470 +57,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GMS.unit "qiskit.circuit.library.GMS.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GMS.num_input_vars "qiskit.circuit.library.GMS.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GMS.num_input_vars "qiskit.circuit.library.GMS.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GMS.num_vars "qiskit.circuit.library.GMS.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GMS.num_stretches "qiskit.circuit.library.GMS.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GMS.num_captured_vars "qiskit.circuit.library.GMS.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GMS.duration "qiskit.circuit.library.GMS.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GR.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GR.mdx index cd3fc6aabb3..44261df1b6e 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GR.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GR.mdx @@ -47,470 +47,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GR.unit "qiskit.circuit.library.GR.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GR.num_input_vars "qiskit.circuit.library.GR.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GR.num_input_vars "qiskit.circuit.library.GR.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GR.num_vars "qiskit.circuit.library.GR.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GR.num_stretches "qiskit.circuit.library.GR.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GR.num_captured_vars "qiskit.circuit.library.GR.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GR.duration "qiskit.circuit.library.GR.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GRX.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GRX.mdx index e0783f3091a..4629773d338 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GRX.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GRX.mdx @@ -46,470 +46,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GRX.unit "qiskit.circuit.library.GRX.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRX.num_input_vars "qiskit.circuit.library.GRX.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRX.num_input_vars "qiskit.circuit.library.GRX.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GRX.num_vars "qiskit.circuit.library.GRX.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GRX.num_stretches "qiskit.circuit.library.GRX.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GRX.num_captured_vars "qiskit.circuit.library.GRX.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GRX.duration "qiskit.circuit.library.GRX.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GRY.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GRY.mdx index 4c340a60928..4ddf9298e44 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GRY.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GRY.mdx @@ -46,470 +46,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GRY.unit "qiskit.circuit.library.GRY.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRY.num_input_vars "qiskit.circuit.library.GRY.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRY.num_input_vars "qiskit.circuit.library.GRY.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GRY.num_vars "qiskit.circuit.library.GRY.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GRY.num_stretches "qiskit.circuit.library.GRY.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GRY.num_captured_vars "qiskit.circuit.library.GRY.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GRY.duration "qiskit.circuit.library.GRY.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GRZ.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GRZ.mdx index 79d9ca3adbb..88c4a00aae0 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GRZ.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GRZ.mdx @@ -46,470 +46,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GRZ.unit "qiskit.circuit.library.GRZ.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRZ.num_input_vars "qiskit.circuit.library.GRZ.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GRZ.num_input_vars "qiskit.circuit.library.GRZ.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GRZ.num_vars "qiskit.circuit.library.GRZ.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GRZ.num_stretches "qiskit.circuit.library.GRZ.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GRZ.num_captured_vars "qiskit.circuit.library.GRZ.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GRZ.duration "qiskit.circuit.library.GRZ.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GlobalPhaseGate.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GlobalPhaseGate.mdx index 653e3ad4942..c9dd88e8163 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GlobalPhaseGate.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GlobalPhaseGate.mdx @@ -28,7 +28,7 @@ $$ **Parameters** - * **phase** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The value of phase it takes. + * **phase** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – The value of phase it takes. * **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") *| None*) – An optional label for the gate. ## Attributes diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GraphState.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GraphState.mdx index 55c06216c80..93929118a0e 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GraphState.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GraphState.mdx @@ -55,470 +55,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GraphState.unit "qiskit.circuit.library.GraphState.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GraphState.num_input_vars "qiskit.circuit.library.GraphState.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GraphState.num_input_vars "qiskit.circuit.library.GraphState.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GraphState.num_vars "qiskit.circuit.library.GraphState.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GraphState.num_stretches "qiskit.circuit.library.GraphState.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GraphState.num_captured_vars "qiskit.circuit.library.GraphState.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GraphState.duration "qiskit.circuit.library.GraphState.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.GroverOperator.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.GroverOperator.mdx index 3a36833dec0..2f5eaf4a0e9 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.GroverOperator.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.GroverOperator.mdx @@ -170,466 +170,12 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.GroverOperator.unit "qiskit.circuit.library.GroverOperator.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GroverOperator.num_input_vars "qiskit.circuit.library.GroverOperator.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.GroverOperator.num_input_vars "qiskit.circuit.library.GroverOperator.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.GroverOperator.num_vars "qiskit.circuit.library.GroverOperator.num_vars") + [`num_stretches()`](#qiskit.circuit.library.GroverOperator.num_stretches "qiskit.circuit.library.GroverOperator.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.GroverOperator.num_captured_vars "qiskit.circuit.library.GroverOperator.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - ### oracle The oracle implementing a reflection about the bad state. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### reflection\_qubits @@ -642,16 +188,6 @@ $$ The subcircuit implementing the A operator or Hadamards. - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.GroverOperator.duration "qiskit.circuit.library.GroverOperator.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### zero\_reflection diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.HRSCumulativeMultiplier.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.HRSCumulativeMultiplier.mdx index d6786eb055e..c70b35611f3 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.HRSCumulativeMultiplier.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.HRSCumulativeMultiplier.mdx @@ -67,490 +67,6 @@ python_api_name: qiskit.circuit.library.HRSCumulativeMultiplier ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.HRSCumulativeMultiplier.unit "qiskit.circuit.library.HRSCumulativeMultiplier.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.HRSCumulativeMultiplier.num_input_vars "qiskit.circuit.library.HRSCumulativeMultiplier.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.HRSCumulativeMultiplier.num_input_vars "qiskit.circuit.library.HRSCumulativeMultiplier.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.HRSCumulativeMultiplier.num_vars "qiskit.circuit.library.HRSCumulativeMultiplier.num_vars") + [`num_stretches()`](#qiskit.circuit.library.HRSCumulativeMultiplier.num_stretches "qiskit.circuit.library.HRSCumulativeMultiplier.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.HRSCumulativeMultiplier.num_captured_vars "qiskit.circuit.library.HRSCumulativeMultiplier.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_result\_qubits - - - The number of result qubits to limit the output to. - - **Returns** - - The number of result qubits. - - - ### num\_state\_qubits - - - The number of state qubits, i.e. the number of bits in each input register. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.HRSCumulativeMultiplier.duration "qiskit.circuit.library.HRSCumulativeMultiplier.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.HiddenLinearFunction.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.HiddenLinearFunction.mdx index 9048b2c8cea..a2848d7777e 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.HiddenLinearFunction.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.HiddenLinearFunction.mdx @@ -57,470 +57,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.HiddenLinearFunction.unit "qiskit.circuit.library.HiddenLinearFunction.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.HiddenLinearFunction.num_input_vars "qiskit.circuit.library.HiddenLinearFunction.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.HiddenLinearFunction.num_input_vars "qiskit.circuit.library.HiddenLinearFunction.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.HiddenLinearFunction.num_vars "qiskit.circuit.library.HiddenLinearFunction.num_vars") + [`num_stretches()`](#qiskit.circuit.library.HiddenLinearFunction.num_stretches "qiskit.circuit.library.HiddenLinearFunction.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.HiddenLinearFunction.num_captured_vars "qiskit.circuit.library.HiddenLinearFunction.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.HiddenLinearFunction.duration "qiskit.circuit.library.HiddenLinearFunction.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.IQP.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.IQP.mdx index fe82e898c16..9f5ea6a5982 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.IQP.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.IQP.mdx @@ -45,470 +45,6 @@ python_api_name: qiskit.circuit.library.IQP ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.IQP.unit "qiskit.circuit.library.IQP.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.IQP.num_input_vars "qiskit.circuit.library.IQP.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.IQP.num_input_vars "qiskit.circuit.library.IQP.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.IQP.num_vars "qiskit.circuit.library.IQP.num_vars") + [`num_stretches()`](#qiskit.circuit.library.IQP.num_stretches "qiskit.circuit.library.IQP.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.IQP.num_captured_vars "qiskit.circuit.library.IQP.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.IQP.duration "qiskit.circuit.library.IQP.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.InnerProduct.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.InnerProduct.mdx index 100169fb628..f3828d82c6a 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.InnerProduct.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.InnerProduct.mdx @@ -56,470 +56,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.InnerProduct.unit "qiskit.circuit.library.InnerProduct.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.InnerProduct.num_input_vars "qiskit.circuit.library.InnerProduct.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.InnerProduct.num_input_vars "qiskit.circuit.library.InnerProduct.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.InnerProduct.num_vars "qiskit.circuit.library.InnerProduct.num_vars") + [`num_stretches()`](#qiskit.circuit.library.InnerProduct.num_stretches "qiskit.circuit.library.InnerProduct.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.InnerProduct.num_captured_vars "qiskit.circuit.library.InnerProduct.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.InnerProduct.duration "qiskit.circuit.library.InnerProduct.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.IntegerComparator.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.IntegerComparator.mdx index 5a212b3085c..dc88b1c2377 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.IntegerComparator.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.IntegerComparator.mdx @@ -32,70 +32,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.IntegerComparator.unit "qiskit.circuit.library.IntegerComparator.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### geq @@ -106,214 +42,6 @@ $$ True, if the comparator compares `>=`, False if `<`. - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.IntegerComparator.num_input_vars "qiskit.circuit.library.IntegerComparator.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.IntegerComparator.num_input_vars "qiskit.circuit.library.IntegerComparator.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.IntegerComparator.num_vars "qiskit.circuit.library.IntegerComparator.num_vars") + [`num_stretches()`](#qiskit.circuit.library.IntegerComparator.num_stretches "qiskit.circuit.library.IntegerComparator.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.IntegerComparator.num_captured_vars "qiskit.circuit.library.IntegerComparator.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - ### num\_state\_qubits @@ -324,186 +52,6 @@ $$ The number of state qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.IntegerComparator.duration "qiskit.circuit.library.IntegerComparator.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### value diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.LinearAmplitudeFunction.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.LinearAmplitudeFunction.mdx index 1f147cd2855..c4dc7792435 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.LinearAmplitudeFunction.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.LinearAmplitudeFunction.mdx @@ -71,470 +71,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.LinearAmplitudeFunction.unit "qiskit.circuit.library.LinearAmplitudeFunction.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.LinearAmplitudeFunction.num_input_vars "qiskit.circuit.library.LinearAmplitudeFunction.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.LinearAmplitudeFunction.num_input_vars "qiskit.circuit.library.LinearAmplitudeFunction.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.LinearAmplitudeFunction.num_vars "qiskit.circuit.library.LinearAmplitudeFunction.num_vars") + [`num_stretches()`](#qiskit.circuit.library.LinearAmplitudeFunction.num_stretches "qiskit.circuit.library.LinearAmplitudeFunction.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.LinearAmplitudeFunction.num_captured_vars "qiskit.circuit.library.LinearAmplitudeFunction.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.LinearAmplitudeFunction.duration "qiskit.circuit.library.LinearAmplitudeFunction.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.LinearPauliRotations.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.LinearPauliRotations.mdx index 953e2f363ee..e2d56408538 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.LinearPauliRotations.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.LinearPauliRotations.mdx @@ -46,326 +46,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### basis - - - The kind of Pauli rotation to be used. - - Set the basis to ‘X’, ‘Y’ or ‘Z’ for controlled-X, -Y, or -Z rotations respectively. - - **Returns** - - The kind of Pauli rotation used in controlled rotation. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.LinearPauliRotations.unit "qiskit.circuit.library.LinearPauliRotations.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancilla\_qubits - - - The minimum number of ancilla qubits in the circuit. - - **Returns** - - The minimal number of ancillas required. - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.LinearPauliRotations.num_input_vars "qiskit.circuit.library.LinearPauliRotations.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.LinearPauliRotations.num_input_vars "qiskit.circuit.library.LinearPauliRotations.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.LinearPauliRotations.num_vars "qiskit.circuit.library.LinearPauliRotations.num_vars") + [`num_stretches()`](#qiskit.circuit.library.LinearPauliRotations.num_stretches "qiskit.circuit.library.LinearPauliRotations.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.LinearPauliRotations.num_captured_vars "qiskit.circuit.library.LinearPauliRotations.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits representing the state $|x\rangle$. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - ### offset @@ -378,160 +58,6 @@ $$ The offset angle. - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### slope @@ -544,16 +70,6 @@ $$ The rotation angle common in all controlled rotations. - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.LinearPauliRotations.duration "qiskit.circuit.library.LinearPauliRotations.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.MCMT.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.MCMT.mdx index a6e87724a92..988513a9411 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.MCMT.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.MCMT.mdx @@ -49,476 +49,12 @@ python_api_name: qiskit.circuit.library.MCMT ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.MCMT.unit "qiskit.circuit.library.MCMT.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - ### num\_ancilla\_qubits Return the number of ancillas. - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.MCMT.num_input_vars "qiskit.circuit.library.MCMT.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.MCMT.num_input_vars "qiskit.circuit.library.MCMT.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.MCMT.num_vars "qiskit.circuit.library.MCMT.num_vars") + [`num_stretches()`](#qiskit.circuit.library.MCMT.num_stretches "qiskit.circuit.library.MCMT.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.MCMT.num_captured_vars "qiskit.circuit.library.MCMT.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.MCMT.duration "qiskit.circuit.library.MCMT.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.MCMTVChain.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.MCMTVChain.mdx index e5beb7f0384..0b3cb6a5f72 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.MCMTVChain.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.MCMTVChain.mdx @@ -66,476 +66,12 @@ python_api_name: qiskit.circuit.library.MCMTVChain * **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – * **num\_target\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.MCMTVChain.unit "qiskit.circuit.library.MCMTVChain.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - ### num\_ancilla\_qubits Return the number of ancilla qubits required. - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.MCMTVChain.num_input_vars "qiskit.circuit.library.MCMTVChain.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.MCMTVChain.num_input_vars "qiskit.circuit.library.MCMTVChain.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.MCMTVChain.num_vars "qiskit.circuit.library.MCMTVChain.num_vars") + [`num_stretches()`](#qiskit.circuit.library.MCMTVChain.num_stretches "qiskit.circuit.library.MCMTVChain.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.MCMTVChain.num_captured_vars "qiskit.circuit.library.MCMTVChain.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.MCMTVChain.duration "qiskit.circuit.library.MCMTVChain.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.MCXGrayCode.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.MCXGrayCode.mdx index 9a153468934..e83a4c872f6 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.MCXGrayCode.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.MCXGrayCode.mdx @@ -17,7 +17,7 @@ python_api_name: qiskit.circuit.library.MCXGrayCode Create new MCX gate. - ## Attributes + ## Methods **Parameters** @@ -25,121 +25,6 @@ python_api_name: qiskit.circuit.library.MCXGrayCode * **label** (*Optional\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – * **ctrl\_state** (*Optional\[Union\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*,* [*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – - ### base\_class - - - Get the base class of this instruction. This is guaranteed to be in the inheritance tree of `self`. - - The “base class” of an instruction is the lowest class in its inheritance tree that the object should be considered entirely compatible with for \_all\_ circuit applications. This typically means that the subclass is defined purely to offer some sort of programmer convenience over the base class, and the base class is the “true” class for a behavioral perspective. In particular, you should *not* override [`base_class`](#qiskit.circuit.library.MCXGrayCode.base_class "qiskit.circuit.library.MCXGrayCode.base_class") if you are defining a custom version of an instruction that will be implemented differently by hardware, such as an alternative measurement strategy, or a version of a parametrized gate with a particular set of parameters for the purposes of distinguishing it in a [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") from the full parametrized gate. - - This is often exactly equivalent to `type(obj)`, except in the case of singleton instances of standard-library instructions. These singleton instances are special subclasses of their base class, and this property will return that base. For example: - - ```python - >>> isinstance(XGate(), XGate) - True - >>> type(XGate()) is XGate - False - >>> XGate().base_class is XGate - True - ``` - - In general, you should not rely on the precise class of an instruction; within a given circuit, it is expected that `Instruction.name` should be a more suitable discriminator in most situations. - - - ### ctrl\_state - - - Return the control state of the gate as a decimal integer. - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. If the gate has open controls, as determined from [`ctrl_state`](#qiskit.circuit.library.MCXGrayCode.ctrl_state "qiskit.circuit.library.MCXGrayCode.ctrl_state"), the returned definition is conjugated with X without changing the internal `_definition`. - - - ### label - - - Return instruction label - - - ### mutable - - - Is this instance is a mutable unique instance or not. - - If this attribute is `False` the gate instance is a shared singleton and is not mutable. - - - ### name - - - Get name of gate. If the gate has open controls the gate name will become: - - > \ - - where \ is the gate name for the default case of closed control qubits and \ is the integer value of the control state for the gate. - - - ### num\_ancilla\_qubits - - - The number of ancilla qubits. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_ctrl\_qubits - - - Get number of control qubits. - - **Returns** - - The number of control qubits for the gate. - - **Return type** - - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - Get parameters from base\_gate. - - **Returns** - - List of gate parameters. - - **Return type** - - [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") - - **Raises** - - [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – Controlled gate does not define a base gate - - - ## Methods - ### inverse diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.MCXRecursive.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.MCXRecursive.mdx index 7134e9b7bd3..f559b53a12c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.MCXRecursive.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.MCXRecursive.mdx @@ -24,7 +24,7 @@ python_api_name: qiskit.circuit.library.MCXRecursive Create new MCX gate. - ## Attributes + ## Methods **Parameters** @@ -32,121 +32,6 @@ python_api_name: qiskit.circuit.library.MCXRecursive * **label** (*Optional\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – * **ctrl\_state** (*Optional\[Union\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*,* [*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – - ### base\_class - - - Get the base class of this instruction. This is guaranteed to be in the inheritance tree of `self`. - - The “base class” of an instruction is the lowest class in its inheritance tree that the object should be considered entirely compatible with for \_all\_ circuit applications. This typically means that the subclass is defined purely to offer some sort of programmer convenience over the base class, and the base class is the “true” class for a behavioral perspective. In particular, you should *not* override [`base_class`](#qiskit.circuit.library.MCXRecursive.base_class "qiskit.circuit.library.MCXRecursive.base_class") if you are defining a custom version of an instruction that will be implemented differently by hardware, such as an alternative measurement strategy, or a version of a parametrized gate with a particular set of parameters for the purposes of distinguishing it in a [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") from the full parametrized gate. - - This is often exactly equivalent to `type(obj)`, except in the case of singleton instances of standard-library instructions. These singleton instances are special subclasses of their base class, and this property will return that base. For example: - - ```python - >>> isinstance(XGate(), XGate) - True - >>> type(XGate()) is XGate - False - >>> XGate().base_class is XGate - True - ``` - - In general, you should not rely on the precise class of an instruction; within a given circuit, it is expected that `Instruction.name` should be a more suitable discriminator in most situations. - - - ### ctrl\_state - - - Return the control state of the gate as a decimal integer. - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. If the gate has open controls, as determined from [`ctrl_state`](#qiskit.circuit.library.MCXRecursive.ctrl_state "qiskit.circuit.library.MCXRecursive.ctrl_state"), the returned definition is conjugated with X without changing the internal `_definition`. - - - ### label - - - Return instruction label - - - ### mutable - - - Is this instance is a mutable unique instance or not. - - If this attribute is `False` the gate instance is a shared singleton and is not mutable. - - - ### name - - - Get name of gate. If the gate has open controls the gate name will become: - - > \ - - where \ is the gate name for the default case of closed control qubits and \ is the integer value of the control state for the gate. - - - ### num\_ancilla\_qubits - - - The number of ancilla qubits. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_ctrl\_qubits - - - Get number of control qubits. - - **Returns** - - The number of control qubits for the gate. - - **Return type** - - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - Get parameters from base\_gate. - - **Returns** - - List of gate parameters. - - **Return type** - - [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") - - **Raises** - - [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – Controlled gate does not define a base gate - - - ## Methods - ### get\_num\_ancilla\_qubits diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.MCXVChain.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.MCXVChain.mdx index 99d5942161e..230af85b12c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.MCXVChain.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.MCXVChain.mdx @@ -22,121 +22,6 @@ python_api_name: qiskit.circuit.library.MCXVChain * **label** (*Optional\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – * **ctrl\_state** (*Optional\[Union\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*,* [*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]]*) – - ## Attributes - - ### base\_class - - - Get the base class of this instruction. This is guaranteed to be in the inheritance tree of `self`. - - The “base class” of an instruction is the lowest class in its inheritance tree that the object should be considered entirely compatible with for \_all\_ circuit applications. This typically means that the subclass is defined purely to offer some sort of programmer convenience over the base class, and the base class is the “true” class for a behavioral perspective. In particular, you should *not* override [`base_class`](#qiskit.circuit.library.MCXVChain.base_class "qiskit.circuit.library.MCXVChain.base_class") if you are defining a custom version of an instruction that will be implemented differently by hardware, such as an alternative measurement strategy, or a version of a parametrized gate with a particular set of parameters for the purposes of distinguishing it in a [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") from the full parametrized gate. - - This is often exactly equivalent to `type(obj)`, except in the case of singleton instances of standard-library instructions. These singleton instances are special subclasses of their base class, and this property will return that base. For example: - - ```python - >>> isinstance(XGate(), XGate) - True - >>> type(XGate()) is XGate - False - >>> XGate().base_class is XGate - True - ``` - - In general, you should not rely on the precise class of an instruction; within a given circuit, it is expected that `Instruction.name` should be a more suitable discriminator in most situations. - - - ### ctrl\_state - - - Return the control state of the gate as a decimal integer. - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. If the gate has open controls, as determined from [`ctrl_state`](#qiskit.circuit.library.MCXVChain.ctrl_state "qiskit.circuit.library.MCXVChain.ctrl_state"), the returned definition is conjugated with X without changing the internal `_definition`. - - - ### label - - - Return instruction label - - - ### mutable - - - Is this instance is a mutable unique instance or not. - - If this attribute is `False` the gate instance is a shared singleton and is not mutable. - - - ### name - - - Get name of gate. If the gate has open controls the gate name will become: - - > \ - - where \ is the gate name for the default case of closed control qubits and \ is the integer value of the control state for the gate. - - - ### num\_ancilla\_qubits - - - The number of ancilla qubits. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_ctrl\_qubits - - - Get number of control qubits. - - **Returns** - - The number of control qubits for the gate. - - **Return type** - - [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - Get parameters from base\_gate. - - **Returns** - - List of gate parameters. - - **Return type** - - [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") - - **Raises** - - [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – Controlled gate does not define a base gate - - ## Methods ### get\_num\_ancilla\_qubits diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.NLocal.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.NLocal.mdx index e936d31198a..09ab12f24e1 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.NLocal.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.NLocal.mdx @@ -70,70 +70,6 @@ python_api_name: qiskit.circuit.library.NLocal ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.NLocal.unit "qiskit.circuit.library.NLocal.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### entanglement @@ -160,38 +96,6 @@ python_api_name: qiskit.circuit.library.NLocal Returns whether the circuit is wrapped in nested gates/instructions or flattened. - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - ### initial\_state @@ -212,170 +116,6 @@ python_api_name: qiskit.circuit.library.NLocal `True`, if barriers are inserted in between the layers, `False` if not. - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.NLocal.num_input_vars "qiskit.circuit.library.NLocal.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.NLocal.num_input_vars "qiskit.circuit.library.NLocal.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.NLocal.num_vars "qiskit.circuit.library.NLocal.num_vars") + [`num_stretches()`](#qiskit.circuit.library.NLocal.num_stretches "qiskit.circuit.library.NLocal.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.NLocal.num_captured_vars "qiskit.circuit.library.NLocal.num_captured_vars") must be zero. - - ### num\_layers @@ -386,12 +126,6 @@ python_api_name: qiskit.circuit.library.NLocal The number of layers in the circuit. - ### num\_parameters - - - The number of parameter objects in the circuit. - - ### num\_parameters\_settable @@ -418,102 +152,6 @@ python_api_name: qiskit.circuit.library.NLocal The number of qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - ### ordered\_parameters @@ -550,64 +188,6 @@ python_api_name: qiskit.circuit.library.NLocal A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - ### preferred\_init\_points @@ -618,22 +198,6 @@ python_api_name: qiskit.circuit.library.NLocal The initial values for the parameters, or None, if none have been set. - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### reps @@ -654,16 +218,6 @@ python_api_name: qiskit.circuit.library.NLocal The blocks in the rotation layers. - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.NLocal.duration "qiskit.circuit.library.NLocal.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.OR.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.OR.mdx index 5e20b9543ae..f14c0d5a1ac 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.OR.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.OR.mdx @@ -37,470 +37,6 @@ python_api_name: qiskit.circuit.library.OR ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.OR.unit "qiskit.circuit.library.OR.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.OR.num_input_vars "qiskit.circuit.library.OR.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.OR.num_input_vars "qiskit.circuit.library.OR.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.OR.num_vars "qiskit.circuit.library.OR.num_vars") + [`num_stretches()`](#qiskit.circuit.library.OR.num_stretches "qiskit.circuit.library.OR.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.OR.num_captured_vars "qiskit.circuit.library.OR.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.OR.duration "qiskit.circuit.library.OR.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PauliEvolutionGate.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PauliEvolutionGate.mdx index 67a0019f138..106f3447fd5 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PauliEvolutionGate.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PauliEvolutionGate.mdx @@ -396,11 +396,11 @@ $$ **Parameters** - **parameter** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + **parameter** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – **Return type** - [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") + [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") | [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PauliFeatureMap.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PauliFeatureMap.mdx index dad29e65872..398020a24ec 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PauliFeatureMap.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PauliFeatureMap.mdx @@ -126,80 +126,6 @@ $$ The Pauli rotation factor. - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PauliFeatureMap.unit "qiskit.circuit.library.PauliFeatureMap.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see [`get_entangler_map()`](#qiskit.circuit.library.PauliFeatureMap.get_entangler_map "qiskit.circuit.library.PauliFeatureMap.get_entangler_map") for more detail on how the format is interpreted. - - ### entanglement\_blocks @@ -220,450 +146,12 @@ $$ The feature dimension of this feature map. - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PauliFeatureMap.num_input_vars "qiskit.circuit.library.PauliFeatureMap.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PauliFeatureMap.num_input_vars "qiskit.circuit.library.PauliFeatureMap.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PauliFeatureMap.num_vars "qiskit.circuit.library.PauliFeatureMap.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PauliFeatureMap.num_stretches "qiskit.circuit.library.PauliFeatureMap.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PauliFeatureMap.num_captured_vars "qiskit.circuit.library.PauliFeatureMap.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - ### num\_parameters\_settable The number of distinct parameters. - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - ### paulis @@ -674,62 +162,6 @@ $$ The Pauli strings as list. - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PauliFeatureMap.duration "qiskit.circuit.library.PauliFeatureMap.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PauliTwoDesign.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PauliTwoDesign.mdx index a8d1a77245d..c9558f8c31f 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PauliTwoDesign.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PauliTwoDesign.mdx @@ -69,328 +69,6 @@ python_api_name: qiskit.circuit.library.PauliTwoDesign ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PauliTwoDesign.unit "qiskit.circuit.library.PauliTwoDesign.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PauliTwoDesign.num_input_vars "qiskit.circuit.library.PauliTwoDesign.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PauliTwoDesign.num_input_vars "qiskit.circuit.library.PauliTwoDesign.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PauliTwoDesign.num_vars "qiskit.circuit.library.PauliTwoDesign.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PauliTwoDesign.num_stretches "qiskit.circuit.library.PauliTwoDesign.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PauliTwoDesign.num_captured_vars "qiskit.circuit.library.PauliTwoDesign.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - ### num\_parameters\_settable @@ -401,262 +79,6 @@ python_api_name: qiskit.circuit.library.PauliTwoDesign The number of possibly distinct parameters. - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PauliTwoDesign.duration "qiskit.circuit.library.PauliTwoDesign.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.Permutation.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.Permutation.mdx index 7355d157e7c..39ae2848eac 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.Permutation.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.Permutation.mdx @@ -39,470 +39,6 @@ python_api_name: qiskit.circuit.library.Permutation ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.Permutation.unit "qiskit.circuit.library.Permutation.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.Permutation.num_input_vars "qiskit.circuit.library.Permutation.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.Permutation.num_input_vars "qiskit.circuit.library.Permutation.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.Permutation.num_vars "qiskit.circuit.library.Permutation.num_vars") + [`num_stretches()`](#qiskit.circuit.library.Permutation.num_stretches "qiskit.circuit.library.Permutation.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.Permutation.num_captured_vars "qiskit.circuit.library.Permutation.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.Permutation.duration "qiskit.circuit.library.Permutation.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PhaseEstimation.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PhaseEstimation.mdx index 4afb3afbcff..8f85c9985a0 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PhaseEstimation.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PhaseEstimation.mdx @@ -56,470 +56,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PhaseEstimation.unit "qiskit.circuit.library.PhaseEstimation.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PhaseEstimation.num_input_vars "qiskit.circuit.library.PhaseEstimation.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PhaseEstimation.num_input_vars "qiskit.circuit.library.PhaseEstimation.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PhaseEstimation.num_vars "qiskit.circuit.library.PhaseEstimation.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PhaseEstimation.num_stretches "qiskit.circuit.library.PhaseEstimation.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PhaseEstimation.num_captured_vars "qiskit.circuit.library.PhaseEstimation.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PhaseEstimation.duration "qiskit.circuit.library.PhaseEstimation.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PhaseOracle.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PhaseOracle.mdx index 2103c73670e..e0e267ddec7 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PhaseOracle.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PhaseOracle.mdx @@ -36,470 +36,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PhaseOracle.unit "qiskit.circuit.library.PhaseOracle.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PhaseOracle.num_input_vars "qiskit.circuit.library.PhaseOracle.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PhaseOracle.num_input_vars "qiskit.circuit.library.PhaseOracle.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PhaseOracle.num_vars "qiskit.circuit.library.PhaseOracle.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PhaseOracle.num_stretches "qiskit.circuit.library.PhaseOracle.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PhaseOracle.num_captured_vars "qiskit.circuit.library.PhaseOracle.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PhaseOracle.duration "qiskit.circuit.library.PhaseOracle.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseChebyshev.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseChebyshev.mdx index 822f77bc68d..e06280ca55b 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseChebyshev.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseChebyshev.mdx @@ -54,12 +54,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - ### breakpoints @@ -70,54 +64,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev The breakpoints for the piecewise approximation. - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - ### degree @@ -128,16 +74,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev The degree of the polynomials. - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PiecewiseChebyshev.unit "qiskit.circuit.library.PiecewiseChebyshev.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### f\_x @@ -148,214 +84,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev The function to be approximated. - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewiseChebyshev.num_input_vars "qiskit.circuit.library.PiecewiseChebyshev.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewiseChebyshev.num_input_vars "qiskit.circuit.library.PiecewiseChebyshev.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PiecewiseChebyshev.num_vars "qiskit.circuit.library.PiecewiseChebyshev.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PiecewiseChebyshev.num_stretches "qiskit.circuit.library.PiecewiseChebyshev.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PiecewiseChebyshev.num_captured_vars "qiskit.circuit.library.PiecewiseChebyshev.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - ### num\_state\_qubits @@ -366,160 +94,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev The number of state qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - ### polynomials @@ -534,32 +108,6 @@ python_api_name: qiskit.circuit.library.PiecewiseChebyshev [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – If the input function is not in the correct format. - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PiecewiseChebyshev.duration "qiskit.circuit.library.PiecewiseChebyshev.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseLinearPauliRotations.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseLinearPauliRotations.mdx index 7d36624ec8e..24de90c47c7 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseLinearPauliRotations.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewiseLinearPauliRotations.mdx @@ -37,24 +37,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### basis - - - The kind of Pauli rotation to be used. - - Set the basis to ‘X’, ‘Y’ or ‘Z’ for controlled-X, -Y, or -Z rotations respectively. - - **Returns** - - The kind of Pauli rotation used in controlled rotation. - - ### breakpoints @@ -63,34 +45,6 @@ $$ The function is linear in the intervals `[point_i, point_{i+1}]` where the last point implicitly is `2**(num_state_qubits + 1)`. - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - ### contains\_zero\_breakpoint @@ -101,116 +55,6 @@ $$ True, if 0 is the first breakpoint, otherwise False. - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.unit "qiskit.circuit.library.PiecewiseLinearPauliRotations.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - ### mapped\_offsets @@ -231,170 +75,6 @@ $$ The mapped slopes. - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancilla\_qubits - - - The minimum number of ancilla qubits in the circuit. - - **Returns** - - The minimal number of ancillas required. - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.num_input_vars "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.num_input_vars "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.num_vars "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.num_stretches "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.num_captured_vars "qiskit.circuit.library.PiecewiseLinearPauliRotations.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits representing the state $|x\rangle$. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - ### offsets @@ -403,160 +83,6 @@ $$ The function is linear in the intervals `[point_i, point_{i+1}]` where the last point implicitly is `2**(num_state_qubits + 1)`. - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### slopes @@ -565,16 +91,6 @@ $$ The function is linear in the intervals `[point_i, point_{i+1}]` where the last point implicitly is `2**(num_state_qubits + 1)`. - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PiecewiseLinearPauliRotations.duration "qiskit.circuit.library.PiecewiseLinearPauliRotations.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewisePolynomialPauliRotations.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewisePolynomialPauliRotations.mdx index bcfa8a35114..787d5d68e14 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PiecewisePolynomialPauliRotations.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PiecewisePolynomialPauliRotations.mdx @@ -83,24 +83,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### basis - - - The kind of Pauli rotation to be used. - - Set the basis to ‘X’, ‘Y’ or ‘Z’ for controlled-X, -Y, or -Z rotations respectively. - - **Returns** - - The kind of Pauli rotation used in controlled rotation. - - ### breakpoints @@ -113,34 +95,6 @@ $$ The list of breakpoints. - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - ### coeffs @@ -161,116 +115,6 @@ $$ True, if 0 is the first breakpoint, otherwise False. - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.unit "qiskit.circuit.library.PiecewisePolynomialPauliRotations.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - ### mapped\_coeffs @@ -281,334 +125,6 @@ $$ The mapped coefficients. - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancilla\_qubits - - - The minimum number of ancilla qubits in the circuit. - - **Returns** - - The minimal number of ancillas required. - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_input_vars "qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_input_vars "qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_vars "qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_stretches "qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_captured_vars "qiskit.circuit.library.PiecewisePolynomialPauliRotations.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits representing the state $|x\rangle$. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PiecewisePolynomialPauliRotations.duration "qiskit.circuit.library.PiecewisePolynomialPauliRotations.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.PolynomialPauliRotations.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.PolynomialPauliRotations.mdx index d4e22d3303d..01d4b44929a 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.PolynomialPauliRotations.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.PolynomialPauliRotations.mdx @@ -45,52 +45,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### basis - - - The kind of Pauli rotation to be used. - - Set the basis to ‘X’, ‘Y’ or ‘Z’ for controlled-X, -Y, or -Z rotations respectively. - - **Returns** - - The kind of Pauli rotation used in controlled rotation. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - ### coeffs @@ -109,26 +63,6 @@ $$ The coefficients of the polynomial. - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - ### degree @@ -139,424 +73,6 @@ $$ The degree of the polynomial. If the coefficients have not been set, return 0. - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.PolynomialPauliRotations.unit "qiskit.circuit.library.PolynomialPauliRotations.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancilla\_qubits - - - The minimum number of ancilla qubits in the circuit. - - **Returns** - - The minimal number of ancillas required. - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PolynomialPauliRotations.num_input_vars "qiskit.circuit.library.PolynomialPauliRotations.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.PolynomialPauliRotations.num_input_vars "qiskit.circuit.library.PolynomialPauliRotations.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.PolynomialPauliRotations.num_vars "qiskit.circuit.library.PolynomialPauliRotations.num_vars") + [`num_stretches()`](#qiskit.circuit.library.PolynomialPauliRotations.num_stretches "qiskit.circuit.library.PolynomialPauliRotations.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.PolynomialPauliRotations.num_captured_vars "qiskit.circuit.library.PolynomialPauliRotations.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits representing the state $|x\rangle$. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.PolynomialPauliRotations.duration "qiskit.circuit.library.PolynomialPauliRotations.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.QAOAAnsatz.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.QAOAAnsatz.mdx index bca79c21d6c..3eec7352e1d 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.QAOAAnsatz.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.QAOAAnsatz.mdx @@ -30,40 +30,6 @@ python_api_name: qiskit.circuit.library.QAOAAnsatz ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - ### cost\_operator @@ -78,194 +44,12 @@ python_api_name: qiskit.circuit.library.QAOAAnsatz BaseOperator or OperatorBase - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.QAOAAnsatz.unit "qiskit.circuit.library.QAOAAnsatz.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### evolution - - - The evolution converter used to compute the evolution. - - **Returns** - - The evolution converter used to compute the evolution. - - **Return type** - - [EvolutionSynthesis](qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis") - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - ### initial\_state Returns an optional initial state as a circuit - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - ### mixer\_operator @@ -280,232 +64,10 @@ python_api_name: qiskit.circuit.library.QAOAAnsatz BaseOperator or OperatorBase or [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"), optional - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QAOAAnsatz.num_input_vars "qiskit.circuit.library.QAOAAnsatz.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QAOAAnsatz.num_input_vars "qiskit.circuit.library.QAOAAnsatz.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.QAOAAnsatz.num_vars "qiskit.circuit.library.QAOAAnsatz.num_vars") + [`num_stretches()`](#qiskit.circuit.library.QAOAAnsatz.num_stretches "qiskit.circuit.library.QAOAAnsatz.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.QAOAAnsatz.num_captured_vars "qiskit.circuit.library.QAOAAnsatz.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - ### num\_qubits - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - ### operators @@ -522,32 +84,6 @@ python_api_name: qiskit.circuit.library.QAOAAnsatz List\[Union\[BaseOperator, OperatorBase, [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")]] - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - ### parameter\_bounds @@ -558,112 +94,12 @@ python_api_name: qiskit.circuit.library.QAOAAnsatz A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If None is returned, problem is fully unbounded. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - Getter of preferred initial points based on the given initial state. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### reps Returns the reps parameter, which determines the depth of the circuit. - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.QAOAAnsatz.duration "qiskit.circuit.library.QAOAAnsatz.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.QFT.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.QFT.mdx index 165038f1b72..eec5d96c198 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.QFT.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.QFT.mdx @@ -52,12 +52,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - ### approximation\_degree @@ -68,54 +62,6 @@ $$ The currently set approximation degree. - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - ### do\_swaps @@ -126,48 +72,6 @@ $$ True, if the final swaps are applied, False if not. - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.QFT.unit "qiskit.circuit.library.QFT.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - ### insert\_barriers @@ -178,176 +82,6 @@ $$ True, if barriers are inserted, False if not. - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QFT.num_input_vars "qiskit.circuit.library.QFT.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QFT.num_input_vars "qiskit.circuit.library.QFT.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.QFT.num_vars "qiskit.circuit.library.QFT.num_vars") + [`num_stretches()`](#qiskit.circuit.library.QFT.num_stretches "qiskit.circuit.library.QFT.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.QFT.num_captured_vars "qiskit.circuit.library.QFT.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - ### num\_qubits @@ -358,186 +92,6 @@ $$ The number of qubits in the circuit. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.QFT.duration "qiskit.circuit.library.QFT.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.QuadraticForm.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.QuadraticForm.mdx index fbe73d81371..cee3082e276 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.QuadraticForm.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.QuadraticForm.mdx @@ -58,470 +58,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.QuadraticForm.unit "qiskit.circuit.library.QuadraticForm.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QuadraticForm.num_input_vars "qiskit.circuit.library.QuadraticForm.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QuadraticForm.num_input_vars "qiskit.circuit.library.QuadraticForm.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.QuadraticForm.num_vars "qiskit.circuit.library.QuadraticForm.num_vars") + [`num_stretches()`](#qiskit.circuit.library.QuadraticForm.num_stretches "qiskit.circuit.library.QuadraticForm.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.QuadraticForm.num_captured_vars "qiskit.circuit.library.QuadraticForm.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.QuadraticForm.duration "qiskit.circuit.library.QuadraticForm.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.QuantumVolume.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.QuantumVolume.mdx index 13e5b8f0e29..4303ada6187 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.QuantumVolume.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.QuantumVolume.mdx @@ -45,470 +45,6 @@ python_api_name: qiskit.circuit.library.QuantumVolume ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.QuantumVolume.unit "qiskit.circuit.library.QuantumVolume.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QuantumVolume.num_input_vars "qiskit.circuit.library.QuantumVolume.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.QuantumVolume.num_input_vars "qiskit.circuit.library.QuantumVolume.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.QuantumVolume.num_vars "qiskit.circuit.library.QuantumVolume.num_vars") + [`num_stretches()`](#qiskit.circuit.library.QuantumVolume.num_stretches "qiskit.circuit.library.QuantumVolume.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.QuantumVolume.num_captured_vars "qiskit.circuit.library.QuantumVolume.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.QuantumVolume.duration "qiskit.circuit.library.QuantumVolume.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.RGQFTMultiplier.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.RGQFTMultiplier.mdx index c8bbad81a82..071473472ed 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.RGQFTMultiplier.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.RGQFTMultiplier.mdx @@ -46,490 +46,6 @@ python_api_name: qiskit.circuit.library.RGQFTMultiplier ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.RGQFTMultiplier.unit "qiskit.circuit.library.RGQFTMultiplier.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.RGQFTMultiplier.num_input_vars "qiskit.circuit.library.RGQFTMultiplier.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.RGQFTMultiplier.num_input_vars "qiskit.circuit.library.RGQFTMultiplier.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.RGQFTMultiplier.num_vars "qiskit.circuit.library.RGQFTMultiplier.num_vars") + [`num_stretches()`](#qiskit.circuit.library.RGQFTMultiplier.num_stretches "qiskit.circuit.library.RGQFTMultiplier.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.RGQFTMultiplier.num_captured_vars "qiskit.circuit.library.RGQFTMultiplier.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_result\_qubits - - - The number of result qubits to limit the output to. - - **Returns** - - The number of result qubits. - - - ### num\_state\_qubits - - - The number of state qubits, i.e. the number of bits in each input register. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.RGQFTMultiplier.duration "qiskit.circuit.library.RGQFTMultiplier.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.RGate.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.RGate.mdx index 31b414ef084..e9d94c9176b 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.RGate.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.RGate.mdx @@ -41,8 +41,8 @@ $$ **Parameters** - * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – - * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + * **theta** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – * **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") *| None*) – ### base\_class diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.RealAmplitudes.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.RealAmplitudes.mdx index df4773a2304..53afcb827d0 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.RealAmplitudes.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.RealAmplitudes.mdx @@ -125,476 +125,6 @@ python_api_name: qiskit.circuit.library.RealAmplitudes ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.RealAmplitudes.unit "qiskit.circuit.library.RealAmplitudes.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.RealAmplitudes.num_input_vars "qiskit.circuit.library.RealAmplitudes.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.RealAmplitudes.num_input_vars "qiskit.circuit.library.RealAmplitudes.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.RealAmplitudes.num_vars "qiskit.circuit.library.RealAmplitudes.num_vars") + [`num_stretches()`](#qiskit.circuit.library.RealAmplitudes.num_stretches "qiskit.circuit.library.RealAmplitudes.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.RealAmplitudes.num_captured_vars "qiskit.circuit.library.RealAmplitudes.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - ### parameter\_bounds @@ -605,120 +135,6 @@ python_api_name: qiskit.circuit.library.RealAmplitudes The parameter bounds. - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.RealAmplitudes.duration "qiskit.circuit.library.RealAmplitudes.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.TwoLocal.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.TwoLocal.mdx index 86876c87423..3060ea33d1c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.TwoLocal.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.TwoLocal.mdx @@ -132,600 +132,6 @@ python_api_name: qiskit.circuit.library.TwoLocal ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.TwoLocal.unit "qiskit.circuit.library.TwoLocal.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see [`get_entangler_map()`](#qiskit.circuit.library.TwoLocal.get_entangler_map "qiskit.circuit.library.TwoLocal.get_entangler_map") for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.TwoLocal.num_input_vars "qiskit.circuit.library.TwoLocal.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.TwoLocal.num_input_vars "qiskit.circuit.library.TwoLocal.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.TwoLocal.num_vars "qiskit.circuit.library.TwoLocal.num_vars") + [`num_stretches()`](#qiskit.circuit.library.TwoLocal.num_stretches "qiskit.circuit.library.TwoLocal.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.TwoLocal.num_captured_vars "qiskit.circuit.library.TwoLocal.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of total parameters that can be set to distinct values. - - This does not change when the parameters are bound or exchanged for same parameters, and therefore is different from `num_parameters` which counts the number of unique [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects currently in the circuit. - - **Returns** - - The number of parameters originally available in the circuit. - - - This quantity does not require the circuit to be built yet. - - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.TwoLocal.duration "qiskit.circuit.library.TwoLocal.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.U2Gate.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.U2Gate.mdx index 610a66e814d..66f903af11d 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.U2Gate.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.U2Gate.mdx @@ -77,8 +77,8 @@ $$ **Parameters** - * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – - * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + * **phi** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – + * **lam** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit._accelerate.circuit.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – * **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") *| None*) – ### base\_class diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.UnitaryOverlap.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.UnitaryOverlap.mdx index 109cfa73efa..a530ce3352c 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.UnitaryOverlap.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.UnitaryOverlap.mdx @@ -65,470 +65,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.UnitaryOverlap.unit "qiskit.circuit.library.UnitaryOverlap.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.UnitaryOverlap.num_input_vars "qiskit.circuit.library.UnitaryOverlap.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.UnitaryOverlap.num_input_vars "qiskit.circuit.library.UnitaryOverlap.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.UnitaryOverlap.num_vars "qiskit.circuit.library.UnitaryOverlap.num_vars") + [`num_stretches()`](#qiskit.circuit.library.UnitaryOverlap.num_stretches "qiskit.circuit.library.UnitaryOverlap.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.UnitaryOverlap.num_captured_vars "qiskit.circuit.library.UnitaryOverlap.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.UnitaryOverlap.duration "qiskit.circuit.library.UnitaryOverlap.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.VBERippleCarryAdder.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.VBERippleCarryAdder.mdx index 0f64025cb97..013b971df1a 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.VBERippleCarryAdder.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.VBERippleCarryAdder.mdx @@ -67,480 +67,6 @@ python_api_name: qiskit.circuit.library.VBERippleCarryAdder ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.VBERippleCarryAdder.unit "qiskit.circuit.library.VBERippleCarryAdder.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.VBERippleCarryAdder.num_input_vars "qiskit.circuit.library.VBERippleCarryAdder.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.VBERippleCarryAdder.num_input_vars "qiskit.circuit.library.VBERippleCarryAdder.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.VBERippleCarryAdder.num_vars "qiskit.circuit.library.VBERippleCarryAdder.num_vars") + [`num_stretches()`](#qiskit.circuit.library.VBERippleCarryAdder.num_stretches "qiskit.circuit.library.VBERippleCarryAdder.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.VBERippleCarryAdder.num_captured_vars "qiskit.circuit.library.VBERippleCarryAdder.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_state\_qubits - - - The number of state qubits, i.e. the number of bits in each input register. - - **Returns** - - The number of state qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.VBERippleCarryAdder.duration "qiskit.circuit.library.VBERippleCarryAdder.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.WeightedAdder.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.WeightedAdder.mdx index 0d99b8dbbc5..c0453165710 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.WeightedAdder.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.WeightedAdder.mdx @@ -64,214 +64,6 @@ $$ ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.WeightedAdder.unit "qiskit.circuit.library.WeightedAdder.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.WeightedAdder.num_input_vars "qiskit.circuit.library.WeightedAdder.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.WeightedAdder.num_input_vars "qiskit.circuit.library.WeightedAdder.num_input_vars") must be zero. - - ### num\_carry\_qubits @@ -284,26 +76,6 @@ $$ The number of carry qubits required to compute the sum. - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - ### num\_control\_qubits @@ -316,50 +88,6 @@ $$ The number of additional control qubits required (0 or 1). - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.WeightedAdder.num_vars "qiskit.circuit.library.WeightedAdder.num_vars") + [`num_stretches()`](#qiskit.circuit.library.WeightedAdder.num_stretches "qiskit.circuit.library.WeightedAdder.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.WeightedAdder.num_captured_vars "qiskit.circuit.library.WeightedAdder.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - ### num\_state\_qubits @@ -370,14 +98,6 @@ $$ The number of state qubits. - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - ### num\_sum\_qubits @@ -388,178 +108,6 @@ $$ The number of qubits needed to represent the weighted sum of the qubits. - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.WeightedAdder.duration "qiskit.circuit.library.WeightedAdder.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### weights diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.XOR.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.XOR.mdx index 608e7aae2b9..c3fe93a079a 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.XOR.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.XOR.mdx @@ -39,470 +39,6 @@ python_api_name: qiskit.circuit.library.XOR ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.XOR.unit "qiskit.circuit.library.XOR.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.XOR.num_input_vars "qiskit.circuit.library.XOR.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.XOR.num_input_vars "qiskit.circuit.library.XOR.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.XOR.num_vars "qiskit.circuit.library.XOR.num_vars") + [`num_stretches()`](#qiskit.circuit.library.XOR.num_stretches "qiskit.circuit.library.XOR.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.XOR.num_captured_vars "qiskit.circuit.library.XOR.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.XOR.duration "qiskit.circuit.library.XOR.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.ZFeatureMap.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.ZFeatureMap.mdx index b7621635d43..ffd8f9eba3f 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.ZFeatureMap.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.ZFeatureMap.mdx @@ -85,620 +85,6 @@ python_api_name: qiskit.circuit.library.ZFeatureMap ## Attributes - ### alpha - - - The Pauli rotation factor (alpha). - - **Returns** - - The Pauli rotation factor. - - - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.ZFeatureMap.unit "qiskit.circuit.library.ZFeatureMap.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### feature\_dimension - - - Returns the feature dimension (which is equal to the number of qubits). - - **Returns** - - The feature dimension of this feature map. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ZFeatureMap.num_input_vars "qiskit.circuit.library.ZFeatureMap.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ZFeatureMap.num_input_vars "qiskit.circuit.library.ZFeatureMap.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.ZFeatureMap.num_vars "qiskit.circuit.library.ZFeatureMap.num_vars") + [`num_stretches()`](#qiskit.circuit.library.ZFeatureMap.num_stretches "qiskit.circuit.library.ZFeatureMap.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.ZFeatureMap.num_captured_vars "qiskit.circuit.library.ZFeatureMap.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of distinct parameters. - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### paulis - - - The Pauli strings used in the entanglement of the qubits. - - **Returns** - - The Pauli strings as list. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.ZFeatureMap.duration "qiskit.circuit.library.ZFeatureMap.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.circuit.library.ZZFeatureMap.mdx b/docs/api/qiskit/dev/qiskit.circuit.library.ZZFeatureMap.mdx index 00db8e3c74e..5195f098140 100644 --- a/docs/api/qiskit/dev/qiskit.circuit.library.ZZFeatureMap.mdx +++ b/docs/api/qiskit/dev/qiskit.circuit.library.ZZFeatureMap.mdx @@ -106,620 +106,6 @@ python_api_name: qiskit.circuit.library.ZZFeatureMap ## Attributes - ### alpha - - - The Pauli rotation factor (alpha). - - **Returns** - - The Pauli rotation factor. - - - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Returns** - - a list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction")s for each instruction. - - **Return type** - - QuantumCircuitData - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.circuit.library.ZZFeatureMap.unit "qiskit.circuit.library.ZZFeatureMap.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### entanglement - - - Get the entanglement strategy. - - **Returns** - - The entanglement strategy, see `get_entangler_map()` for more detail on how the format is interpreted. - - - ### entanglement\_blocks - - - The blocks in the entanglement layers. - - **Returns** - - The blocks in the entanglement layers. - - - ### feature\_dimension - - - Returns the feature dimension (which is equal to the number of qubits). - - **Returns** - - The feature dimension of this feature map. - - - ### flatten - - - Returns whether the circuit is wrapped in nested gates/instructions or flattened. - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### initial\_state - - - Return the initial state that is added in front of the n-local circuit. - - **Returns** - - The initial state. - - - ### insert\_barriers - - - If barriers are inserted in between the layers or not. - - **Returns** - - `True`, if barriers are inserted in between the layers, `False` if not. - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ZZFeatureMap.num_input_vars "qiskit.circuit.library.ZZFeatureMap.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.circuit.library.ZZFeatureMap.num_input_vars "qiskit.circuit.library.ZZFeatureMap.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.circuit.library.ZZFeatureMap.num_vars "qiskit.circuit.library.ZZFeatureMap.num_vars") + [`num_stretches()`](#qiskit.circuit.library.ZZFeatureMap.num_stretches "qiskit.circuit.library.ZZFeatureMap.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.circuit.library.ZZFeatureMap.num_captured_vars "qiskit.circuit.library.ZZFeatureMap.num_captured_vars") must be zero. - - - ### num\_layers - - - Return the number of layers in the n-local circuit. - - **Returns** - - The number of layers in the circuit. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_parameters\_settable - - - The number of distinct parameters. - - - ### num\_qubits - - - Returns the number of qubits in this circuit. - - **Returns** - - The number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### ordered\_parameters - - - The parameters used in the underlying circuit. - - This includes float values and duplicates. - - **Examples** - - ```python - >>> # prepare circuit ... - >>> print(nlocal) - ┌───────┐┌──────────┐┌──────────┐┌──────────┐ - q_0: ┤ Ry(1) ├┤ Ry(θ[1]) ├┤ Ry(θ[1]) ├┤ Ry(θ[3]) ├ - └───────┘└──────────┘└──────────┘└──────────┘ - >>> nlocal.parameters - {Parameter(θ[1]), Parameter(θ[3])} - >>> nlocal.ordered_parameters - [1, Parameter(θ[1]), Parameter(θ[1]), Parameter(θ[3])] - ``` - - **Returns** - - The parameters objects used in the circuit. - - - ### parameter\_bounds - - - The parameter bounds for the unbound parameters in the circuit. - - **Returns** - - A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If `None` is returned, problem is fully unbounded. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### paulis - - - The Pauli strings used in the entanglement of the qubits. - - **Returns** - - The Pauli strings as list. - - - ### preferred\_init\_points - - - The initial points for the parameters. Can be stored as initial guess in optimization. - - **Returns** - - The initial values for the parameters, or None, if none have been set. - - - ### prefix - - - - ### qregs - - - A list of the quantum registers associated with the circuit. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### reps - - - The number of times rotation and entanglement block are repeated. - - **Returns** - - The number of repetitions. - - - ### rotation\_blocks - - - The blocks in the rotation layers. - - **Returns** - - The blocks in the rotation layers. - - - ### unit - - - The unit that [`duration`](#qiskit.circuit.library.ZZFeatureMap.duration "qiskit.circuit.library.ZZFeatureMap.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.passmanager.BasePassManager.mdx b/docs/api/qiskit/dev/qiskit.passmanager.BasePassManager.mdx index cf1a04e4a73..4de26e62585 100644 --- a/docs/api/qiskit/dev/qiskit.passmanager.BasePassManager.mdx +++ b/docs/api/qiskit/dev/qiskit.passmanager.BasePassManager.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.passmanager.BasePassManager # BasePassManager - + Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3.13)") Pass manager base class. @@ -80,7 +80,7 @@ python_api_name: qiskit.passmanager.BasePassManager ### run - + Run all the passes on the specified `in_programs`. **Parameters** @@ -130,7 +130,7 @@ python_api_name: qiskit.passmanager.BasePassManager ### to\_flow\_controller - + Linearize this manager into a single [`FlowControllerLinear`](qiskit.passmanager.FlowControllerLinear "qiskit.passmanager.FlowControllerLinear"), so that it can be nested inside another pass manager. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.ApproximateCircuit.mdx b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.ApproximateCircuit.mdx index b1371e8de29..e339a3c7520 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.ApproximateCircuit.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.ApproximateCircuit.mdx @@ -20,460 +20,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.ApproximateCircuit ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.unit "qiskit.synthesis.unitary.aqc.ApproximateCircuit.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_input_vars "qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_input_vars "qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_vars "qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_vars") + [`num_stretches()`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_stretches "qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_captured_vars "qiskit.synthesis.unitary.aqc.ApproximateCircuit.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### thetas @@ -484,16 +30,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.ApproximateCircuit a vector of parameters of this circuit. - ### unit - - - The unit that [`duration`](#qiskit.synthesis.unitary.aqc.ApproximateCircuit.duration "qiskit.synthesis.unitary.aqc.ApproximateCircuit.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.mdx b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.mdx index 6eb31007d0e..14e685a369b 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.mdx @@ -26,460 +26,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.CNOTUnitCircuit ## Attributes - ### ancillas - - - A list of `AncillaQubit`s in the order that they were added. You should not mutate this. - - - ### clbits - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - **Example** - - ```python - from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit - - qr1 = QuantumRegister(2) - qr2 = QuantumRegister(1) - cr1 = ClassicalRegister(2) - cr2 = ClassicalRegister(1) - qc = QuantumCircuit(qr1, qr2, cr1, cr2) - - print("List the qubits in this circuit:", qc.qubits) - print("List the classical bits in this circuit:", qc.clbits) - ``` - - ```text - List the qubits in this circuit: [Qubit(QuantumRegister(2, 'q0'), 0), - Qubit(QuantumRegister(2, 'q0'), 1), Qubit(QuantumRegister(1, 'q1'), 0)] - List the classical bits in this circuit: [Clbit(ClassicalRegister(2, 'c0'), 0), - Clbit(ClassicalRegister(2, 'c0'), 1), Clbit(ClassicalRegister(1, 'c1'), 0)] - ``` - - - ### cregs - - - A list of `Clbit`s in the order that they were added. You should not mutate this. - - - ### data - - - The circuit data (instructions and context). - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2) - qc.measure([0], [1]) - print(qc.data) - ``` - - ```text - [CircuitInstruction(operation=Instruction(name='measure', num_qubits=1, - num_clbits=1, params=[]), qubits=(Qubit(QuantumRegister(2, 'q'), 0),), - clbits=(Clbit(ClassicalRegister(2, 'c'), 1),))] - ``` - - **Returns** - - A list-like object containing the [`CircuitInstruction`](qiskit.circuit.CircuitInstruction "qiskit.circuit.CircuitInstruction") instances in the circuit. - - - ### duration - - - The total duration of the circuit, set by a scheduling transpiler pass. Its unit is specified by [`unit`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.unit "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.unit"). - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.duration` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - - ### global\_phase - - - The global phase of the current circuit scope in radians. - - **Example** - - ```python - from qiskit import QuantumCircuit - - circuit = QuantumCircuit(2) - circuit.h(0) - circuit.cx(0, 1) - print(circuit.global_phase) - ``` - - ```text - 0.0 - ``` - - ```python - from numpy import pi - - circuit.global_phase = pi/4 - print(circuit.global_phase) - ``` - - ```text - 0.7853981633974483 - ``` - - - ### instances - - - - ### layout - - - Return any associated layout information about the circuit. - - This attribute contains an optional [`TranspileLayout`](qiskit.transpiler.TranspileLayout "qiskit.transpiler.TranspileLayout") object. This is typically set on the output from [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`PassManager.run()`](qiskit.transpiler.PassManager#run "qiskit.transpiler.PassManager.run") to retain information about the permutations caused on the input circuit by transpilation. - - There are two types of permutations caused by the [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") function: an initial layout that permutes the qubits based on the selected physical qubits on the [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), and a final layout, which is an output permutation caused by [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted during routing. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - # Create circuit to test transpiler on - qc = QuantumCircuit(3, 3) - qc.h(0) - qc.cx(0, 1) - qc.swap(1, 2) - qc.cx(0, 1) - - # Add measurements to the circuit - qc.measure([0, 1, 2], [0, 1, 2]) - - # Specify the QPU to target - backend = GenericBackendV2(3) - - # Transpile the circuit - pass_manager = generate_preset_pass_manager( - optimization_level=1, backend=backend - ) - transpiled = pass_manager.run(qc) - - # Print the layout after transpilation - print(transpiled.layout.routing_permutation()) - ``` - - ```text - [0, 1, 2] - ``` - - - ### metadata - - - Arbitrary user-defined dictionary of metadata for the circuit. - - Qiskit will not examine the content of this mapping, but it will pass it through the transpiler and reattach it to the output, so you can track your own metadata. - - **Example** - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(2, 2, metadata={'experiment_type': 'Bell state experiment'}) - - print(qc.metadata) - ``` - - ```text - {'experiment_type': 'Bell state experiment'} - ``` - - - ### num\_ancillas - - - Return the number of ancilla qubits. - - **Example** - - ```python - from qiskit import QuantumCircuit, QuantumRegister, AncillaRegister - - # Create a 2-qubit quantum circuit - reg = QuantumRegister(2) - qc = QuantumCircuit(reg) - - # Create an ancilla register with 1 qubit - anc = AncillaRegister(1) - qc.add_register(anc) # Add the ancilla register to the circuit - - print("Number of ancilla qubits:", qc.num_ancillas) - ``` - - ```text - Number of ancilla qubits: 1 - ``` - - - ### num\_captured\_stretches - - - The number of stretches in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_stretches()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_input_vars "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_input_vars") must be zero. - - - ### num\_captured\_vars - - - The number of real-time classical variables in the circuit marked as captured from an enclosing scope. - - This is the length of the `iter_captured_vars()` iterable. If this is non-zero, [`num_input_vars`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_input_vars "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_input_vars") must be zero. - - - ### num\_clbits - - - Return number of classical bits. - - **Example** - - ```python - from qiskit import QuantumCircuit - - # Create a new circuit with two qubits and one classical bit - qc = QuantumCircuit(2, 1) - print("Number of classical bits:", qc.num_clbits) - ``` - - ```text - Number of classical bits: 1 - ``` - - - ### num\_declared\_stretches - - - The number of stretches in the circuit that are declared by this circuit scope, excluding captures. - - This is the length of the `iter_declared_stretches()` iterable. - - - ### num\_declared\_vars - - - The number of real-time classical variables in the circuit that are declared by this circuit scope, excluding inputs or captures. - - This is the length of the `iter_declared_vars()` iterable. - - - ### num\_identifiers - - - The number of real-time classical variables and stretches in the circuit. - - This is equal to [`num_vars()`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_vars "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_vars") + [`num_stretches()`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_stretches "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_stretches"). - - - ### num\_input\_vars - - - The number of real-time classical variables in the circuit marked as circuit inputs. - - This is the length of the `iter_input_vars()` iterable. If this is non-zero, [`num_captured_vars`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_captured_vars "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.num_captured_vars") must be zero. - - - ### num\_parameters - - - The number of parameter objects in the circuit. - - - ### num\_qubits - - - Return number of qubits. - - - ### num\_stretches - - - The number of stretches in the circuit. - - This is the length of the `iter_stretches()` iterable. - - - ### num\_vars - - - The number of real-time classical variables in the circuit. - - This is the length of the `iter_vars()` iterable. - - - ### op\_start\_times - - - Return a list of operation start times. - - - This attribute computes the estimate starting time of the operations in the scheduled circuit and only works for simple circuits that have no control flow or other classical feed-forward operations. - - - This attribute is enabled once one of scheduling analysis passes runs on the quantum circuit. - - **Example** - - ```python - from qiskit import QuantumCircuit - from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.transpiler import generate_preset_pass_manager - - qc = QuantumCircuit(2) - qc.h(0) - qc.cx(0, 1) - qc.measure_all() - - # Print the original circuit - print("Original circuit:") - print(qc) - - # Transpile the circuit with a specific basis gates list and print the resulting circuit - backend = GenericBackendV2(2, basis_gates=['u1', 'u2', 'u3', 'cx']) - pm = generate_preset_pass_manager( - optimization_level=1, backend=backend, scheduling_method="alap" - ) - transpiled_qc = pm.run(qc) - print("Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']:") - print(transpiled_qc) - - # Print the start times of each instruction in the transpiled circuit - print("Start times of instructions in the transpiled circuit:") - for instruction, start_time in zip(transpiled_qc.data, transpiled_qc.op_start_times): - print(f"{instruction.operation.name}: {start_time}") - ``` - - ```text - Original circuit: - ┌───┐ ░ ┌─┐ - q_0: ┤ H ├──■───░─┤M├─── - └───┘┌─┴─┐ ░ └╥┘┌─┐ - q_1: ─────┤ X ├─░──╫─┤M├ - └───┘ ░ ║ └╥┘ - meas: 2/══════════════╩══╩═ - 0 1 - - Transpiled circuit with basis gates ['u1', 'u2', 'u3', 'cx']: - ┌─────────┐ ░ ┌─────────────────┐┌─┐ - q_0 -> 0 ───┤ U2(0,π) ├──────■───░─┤ Delay(1255[dt]) ├┤M├ - ┌──┴─────────┴───┐┌─┴─┐ ░ └───────┬─┬───────┘└╥┘ - q_1 -> 1 ┤ Delay(196[dt]) ├┤ X ├─░─────────┤M├─────────╫─ - └────────────────┘└───┘ ░ └╥┘ ║ - meas: 2/═══════════════════════════════════╩══════════╩═ - 1 0 - - Start times of instructions in the transpiled circuit: - u2: 0 - delay: 0 - cx: 196 - barrier: 2098 - delay: 2098 - measure: 3353 - measure: 2098 - ``` - - **Returns** - - List of integers representing instruction estimated start times. The index corresponds to the index of instruction in `QuantumCircuit.data`. - - **Raises** - - [**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") – When circuit is not scheduled. - - - ### parameters - - - The parameters defined in the circuit. - - This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. - - **Examples** - - The snippet below shows that insertion order of parameters does not matter. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> a, b, elephant = Parameter("a"), Parameter("b"), Parameter("elephant") - >>> circuit = QuantumCircuit(1) - >>> circuit.rx(b, 0) - >>> circuit.rz(elephant, 0) - >>> circuit.ry(a, 0) - >>> circuit.parameters # sorted alphabetically! - ParameterView([Parameter(a), Parameter(b), Parameter(elephant)]) - ``` - - Bear in mind that alphabetical sorting might be unintuitive when it comes to numbers. The literal “10” comes before “2” in strict alphabetical sorting. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter - >>> angles = [Parameter("angle_1"), Parameter("angle_2"), Parameter("angle_10")] - >>> circuit = QuantumCircuit(1) - >>> circuit.u(*angles, 0) - >>> circuit.draw() - ┌─────────────────────────────┐ - q: ┤ U(angle_1,angle_2,angle_10) ├ - └─────────────────────────────┘ - >>> circuit.parameters - ParameterView([Parameter(angle_1), Parameter(angle_10), Parameter(angle_2)]) - ``` - - To respect numerical sorting, a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") can be used. - - ```python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) - ``` - - **Returns** - - The sorted [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit. - - - ### prefix - - - - ### qregs - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - - ### qubits - - - A list of `Qubit`s in the order that they were added. You should not mutate this. - - ### thetas @@ -490,16 +36,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.CNOTUnitCircuit Parameters of the rotation gates in this circuit. - ### unit - - - The unit that [`duration`](#qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.duration "qiskit.synthesis.unitary.aqc.CNOTUnitCircuit.duration") is specified in. - - - The property `qiskit.circuit.quantumcircuit.QuantumCircuit.unit` is deprecated as of Qiskit 1.3.0. It will be removed in Qiskit 3.0.0. - - - ### name diff --git a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitObjective.mdx b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitObjective.mdx index 58b8a981005..b2ef03dfe58 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitObjective.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.CNOTUnitObjective.mdx @@ -31,11 +31,5 @@ python_api_name: qiskit.synthesis.unitary.aqc.CNOTUnitObjective Returns: Number of parameters (angles) of rotation gates in this circuit. - - ### target\_matrix - - - Returns: a matrix being approximated - diff --git a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective.mdx b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective.mdx index 6a350ab41c2..99f96bf43e5 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective.mdx @@ -18,26 +18,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective * **num\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – number of qubits. * **cnots** (*np.ndarray*) – a CNOT structure to be used in the optimization procedure. - ## Attributes - - ### num\_cnots - - - Returns: A number of CNOT units to be used by the approximate circuit. - - - ### num\_thetas - - - Returns: Number of parameters (angles) of rotation gates in this circuit. - - - ### target\_matrix - - - Returns: a matrix being approximated - - ## Methods ### gradient diff --git a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.FastCNOTUnitObjective.mdx b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.FastCNOTUnitObjective.mdx index 61d4db11231..6f30f37f5df 100644 --- a/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.FastCNOTUnitObjective.mdx +++ b/docs/api/qiskit/dev/qiskit.synthesis.unitary.aqc.FastCNOTUnitObjective.mdx @@ -18,26 +18,6 @@ python_api_name: qiskit.synthesis.unitary.aqc.FastCNOTUnitObjective * **num\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – number of qubits. * **cnots** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.3)")) – a CNOT structure to be used in the optimization procedure. - ## Attributes - - ### num\_cnots - - - Returns: A number of CNOT units to be used by the approximate circuit. - - - ### num\_thetas - - - Returns: Number of parameters (angles) of rotation gates in this circuit. - - - ### target\_matrix - - - Returns: a matrix being approximated - - ## Methods ### gradient diff --git a/docs/api/qiskit/dev/qiskit.transpiler.PassManager.mdx b/docs/api/qiskit/dev/qiskit.transpiler.PassManager.mdx index 8ebe298ee86..a5594abc63b 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.PassManager.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.PassManager.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.PassManager # PassManager - + Bases: [`BasePassManager`](qiskit.passmanager.BasePassManager "qiskit.passmanager.passmanager.BasePassManager") Manager for a set of Passes and their scheduling during transpilation. @@ -24,7 +24,7 @@ python_api_name: qiskit.transpiler.PassManager ### append - + Append a Pass Set to the schedule of passes. **Parameters** @@ -42,7 +42,7 @@ python_api_name: qiskit.transpiler.PassManager ### draw - + Draw the pass manager. This function needs [pydot](https://github.com/erocarrera/pydot), which in turn needs [Graphviz](https://www.graphviz.org/) to be installed. @@ -86,7 +86,7 @@ python_api_name: qiskit.transpiler.PassManager ### replace - + Replace a particular pass in the scheduler. **Parameters** @@ -101,7 +101,7 @@ python_api_name: qiskit.transpiler.PassManager ### run - + Run all the passes on the specified `circuits`. **Parameters** @@ -140,6 +140,10 @@ python_api_name: qiskit.transpiler.PassManager ... ``` + + When running transpilation with multi-processing, the callback function is invoked within the context of each sub-process, independently of the parent process. + + * **num\_processes** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The maximum number of parallel processes to launch if parallel execution is enabled. This argument overrides `num_processes` in the user configuration file, and the `QISKIT_NUM_PROCS` environment variable. If set to `None` the system default or local user configuration will be used. * **property\_set** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*,* [*object*](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")*] | None*) – If given, the initial value to use as the [`PropertySet`](qiskit.passmanager.PropertySet "qiskit.passmanager.PropertySet") for the pass manager pipeline. This can be used to persist analysis from one run to another, in cases where you know the analysis is safe to share. Beware that some analysis will be specific to the input circuit and the particular [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), so you should take a lot of care when using this argument. @@ -155,7 +159,7 @@ python_api_name: qiskit.transpiler.PassManager ### to\_flow\_controller - + Linearize this manager into a single [`FlowControllerLinear`](qiskit.passmanager.FlowControllerLinear "qiskit.passmanager.FlowControllerLinear"), so that it can be nested inside another pass manager. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.StagedPassManager.mdx b/docs/api/qiskit/dev/qiskit.transpiler.StagedPassManager.mdx index 54f48045e44..02adaa098c5 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.StagedPassManager.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.StagedPassManager.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.StagedPassManager # StagedPassManager - + Bases: [`PassManager`](qiskit.transpiler.PassManager "qiskit.transpiler.passmanager.PassManager") A pass manager pipeline built from individual stages. @@ -64,7 +64,7 @@ python_api_name: qiskit.transpiler.StagedPassManager ### append - + Append a Pass Set to the schedule of passes. **Parameters** @@ -82,13 +82,13 @@ python_api_name: qiskit.transpiler.StagedPassManager ### draw - + Draw the staged pass manager. ### remove - + Removes a particular pass in the scheduler. **Parameters** @@ -106,7 +106,7 @@ python_api_name: qiskit.transpiler.StagedPassManager ### replace - + Replace a particular pass in the scheduler. **Parameters** @@ -121,7 +121,7 @@ python_api_name: qiskit.transpiler.StagedPassManager ### run - + Run all the passes on the specified `circuits`. **Parameters** @@ -160,6 +160,10 @@ python_api_name: qiskit.transpiler.StagedPassManager ... ``` + + When running transpilation with multi-processing, the callback function is invoked within the context of each sub-process, independently of the parent process. + + * **num\_processes** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The maximum number of parallel processes to launch if parallel execution is enabled. This argument overrides `num_processes` in the user configuration file, and the `QISKIT_NUM_PROCS` environment variable. If set to `None` the system default or local user configuration will be used. * **property\_set** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*,* [*object*](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")*] | None*) – If given, the initial value to use as the [`PropertySet`](qiskit.passmanager.PropertySet "qiskit.passmanager.PropertySet") for the pass manager pipeline. This can be used to persist analysis from one run to another, in cases where you know the analysis is safe to share. Beware that some analysis will be specific to the input circuit and the particular [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target"), so you should take a lot of care when using this argument. @@ -175,7 +179,7 @@ python_api_name: qiskit.transpiler.StagedPassManager ### to\_flow\_controller - + Linearize this manager into a single [`FlowControllerLinear`](qiskit.passmanager.FlowControllerLinear "qiskit.passmanager.FlowControllerLinear"), so that it can be nested inside another pass manager. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.ALAPScheduleAnalysis.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.ALAPScheduleAnalysis.mdx index c7e33d6668a..897239b2c04 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.ALAPScheduleAnalysis.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.ALAPScheduleAnalysis.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.ALAPScheduleAnalysis # ALAPScheduleAnalysis - + Bases: `BaseScheduler` ALAP Scheduling pass, which schedules the **stop** time of instructions as late as possible. @@ -78,7 +78,7 @@ python_api_name: qiskit.transpiler.passes.ALAPScheduleAnalysis ### run - + Run the ALAPSchedule pass on dag. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.InstructionDurationCheck.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.InstructionDurationCheck.mdx index 90a9ea95e64..cfe22cbc2e1 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.InstructionDurationCheck.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.InstructionDurationCheck.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.InstructionDurationCheck # InstructionDurationCheck - + Bases: [`AnalysisPass`](qiskit.transpiler.AnalysisPass "qiskit.transpiler.basepasses.AnalysisPass") Duration validation pass for reschedule. @@ -79,7 +79,7 @@ python_api_name: qiskit.transpiler.passes.InstructionDurationCheck ### run - + Run duration validation passes. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.InverseCancellation.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.InverseCancellation.mdx index 220e4d18cb7..6af18d3de37 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.InverseCancellation.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.InverseCancellation.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.InverseCancellation # InverseCancellation - + Bases: [`TransformationPass`](qiskit.transpiler.TransformationPass "qiskit.transpiler.basepasses.TransformationPass") Cancel specific Gates which are inverses of each other when they occur back-to- back. @@ -17,7 +17,34 @@ python_api_name: qiskit.transpiler.passes.InverseCancellation **Parameters** - **gates\_to\_cancel** – List describing the gates to cancel. Each element of the list is either a single gate or a pair of gates. If a single gate, then it should be self-inverse. If a pair of gates, then the gates in the pair should be inverses of each other. + * **gates\_to\_cancel** – + + List describing the gates to cancel. Each element of the list is either a single gate or a pair of gates. If a single gate, then it should be self-inverse. If a pair of gates, then the gates in the pair should be inverses of each other. If `None` a default list of self-inverse gates and a default list of inverse gate pairs will be used. The current default list of self-inverse gates is: + + > * [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate") + > * [`ECRGate`](qiskit.circuit.library.ECRGate "qiskit.circuit.library.ECRGate") + > * [`CYGate`](qiskit.circuit.library.CYGate "qiskit.circuit.library.CYGate") + > * [`CZGate`](qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate") + > * [`XGate`](qiskit.circuit.library.XGate "qiskit.circuit.library.XGate") + > * [`YGate`](qiskit.circuit.library.YGate "qiskit.circuit.library.YGate") + > * [`ZGate`](qiskit.circuit.library.ZGate "qiskit.circuit.library.ZGate") + > * [`HGate`](qiskit.circuit.library.HGate "qiskit.circuit.library.HGate") + > * [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") + > * [`CHGate`](qiskit.circuit.library.CHGate "qiskit.circuit.library.CHGate") + > * [`CCXGate`](qiskit.circuit.library.CCXGate "qiskit.circuit.library.CCXGate") + > * [`CCZGate`](qiskit.circuit.library.CCZGate "qiskit.circuit.library.CCZGate") + > * [`RCCXGate`](qiskit.circuit.library.RCCXGate "qiskit.circuit.library.RCCXGate") + > * [`CSwapGate`](qiskit.circuit.library.CSwapGate "qiskit.circuit.library.CSwapGate") + > * [`C3XGate`](qiskit.circuit.library.C3XGate "qiskit.circuit.library.C3XGate") + + and the default list of inverse gate pairs is: + + > * [`TGate`](qiskit.circuit.library.TGate "qiskit.circuit.library.TGate") and [`TdgGate`](qiskit.circuit.library.TdgGate "qiskit.circuit.library.TdgGate") + > * [`SGate`](qiskit.circuit.library.SGate "qiskit.circuit.library.SGate") and [`SdgGate`](qiskit.circuit.library.SdgGate "qiskit.circuit.library.SdgGate") + > * [`SXGate`](qiskit.circuit.library.SXGate "qiskit.circuit.library.SXGate") and [`SXdgGate`](qiskit.circuit.library.SXdgGate "qiskit.circuit.library.SXdgGate") + > * [`CSGate`](qiskit.circuit.library.CSGate "qiskit.circuit.library.CSGate") and [`CSdgGate`](qiskit.circuit.library.CSdgGate "qiskit.circuit.library.CSdgGate") + + * **run\_default** – If set to true and `gates_to_cancel` is set to a list then in addition to the gates listed in `gates_to_cancel` the default list of gate inverses (the same as when `gates_to_cancel` is set to `None`) will be run. The order of evaluation is significant in how sequences of gates are cancelled and the default gates will be evaluated after the provided gates in `gates_to_cancel`. If `gates_to_cancel` is `None` this option has no impact. **Raises** @@ -75,7 +102,7 @@ python_api_name: qiskit.transpiler.passes.InverseCancellation ### run - + Run the InverseCancellation pass on dag. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDelay.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDelay.mdx index f34e2e2bdb8..c59a364af58 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDelay.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDelay.mdx @@ -90,7 +90,7 @@ python_api_name: qiskit.transpiler.passes.PadDelay ### get\_duration - + Get duration of a given node in the circuit. @@ -106,7 +106,7 @@ python_api_name: qiskit.transpiler.passes.PadDelay ### run - + Run the padding pass on `dag`. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDynamicalDecoupling.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDynamicalDecoupling.mdx index cc858d98520..c9c5b2bca21 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDynamicalDecoupling.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.PadDynamicalDecoupling.mdx @@ -154,7 +154,7 @@ python_api_name: qiskit.transpiler.passes.PadDynamicalDecoupling ### get\_duration - + Get duration of a given node in the circuit. @@ -170,7 +170,7 @@ python_api_name: qiskit.transpiler.passes.PadDynamicalDecoupling ### run - + Run the padding pass on `dag`. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPermutation.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPermutation.mdx index 329f489ee19..bd2aa8e8936 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPermutation.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPermutation.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPerm # ACGSynthesisPermutation - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The permutation synthesis plugin based on the Alon, Chung, Graham method. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ACGSynthesisPerm ### run - + Run synthesis for the given Permutation. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisClifford.mdx index 9696ddb2ce6..72d79b89de8 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisCliff # AGSynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Clifford synthesis plugin based on the Aaronson-Gottesman method. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.AGSynthesisCliff ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisClifford.mdx index 07c754d04a1..561dd2e683c 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisCliff # BMSynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Clifford synthesis plugin based on the Bravyi-Maslov method. @@ -21,7 +21,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.BMSynthesisCliff ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPermutation.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPermutation.mdx index cdc939aa27e..5a961e10a74 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPermutation.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPermutation.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPe # BasicSynthesisPermutation - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The permutation synthesis plugin based on sorting. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.BasicSynthesisPe ### run - + Run synthesis for the given Permutation. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisClifford.mdx index cfdab0b5d9c..1f546890ac3 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesis # DefaultSynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default clifford synthesis plugin. @@ -21,7 +21,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesis ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisLinearFunction.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisLinearFunction.mdx index 2b38004ded1..2a1cf545799 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisLinearFunction.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesisLinearFunction.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesis # DefaultSynthesisLinearFunction - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default linear function synthesis plugin. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.DefaultSynthesis ### run - + Run synthesis for the given LinearFunction. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisC04.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisC04.mdx index 722bf524913..3bc50721385 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisC04.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisC04.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes # FullAdderSynthesisC04 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-in and a carry-out bit. @@ -21,7 +21,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisDefault.mdx index 2ce4cf0237f..bb41006753e 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes # FullAdderSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-in and a carry-out bit. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisV95.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisV95.mdx index 47e0de6de28..9c037c15c25 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisV95.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthesisV95.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes # FullAdderSynthesisV95 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-in and a carry-out bit. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.FullAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisClifford.mdx index 008c63253a4..6376fcf63ed 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisC # GreedySynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Clifford synthesis plugin based on the greedy synthesis Bravyi-Hu-Maslov-Shaydulin method. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.GreedySynthesisC ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisC04.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisC04.mdx index 9a6034cd096..606df8bf06e 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisC04.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisC04.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes # HalfAdderSynthesisC04 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-out bit. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisD00.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisD00.mdx index 01602d780e6..498a17f6db1 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisD00.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisD00.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes # HalfAdderSynthesisD00 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A QFT-based adder with a carry-in and a carry-out bit. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisDefault.mdx index c23894688e4..86f6c4e0e4e 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes # HalfAdderSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default half-adder (no carry in, but a carry out qubit) synthesis. @@ -27,7 +27,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisR25.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisR25.mdx index 630e5d85f16..966482e732a 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisR25.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisR25.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes # HalfAdderSynthesisR25 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-out bit with no ancillary qubits. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisV95.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisV95.mdx index a04a4ed6d9a..5de51a73588 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisV95.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthesisV95.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes # HalfAdderSynthesisV95 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder with a carry-out bit. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.HalfAdderSynthes ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesis2s.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesis2s.mdx index 2a30ec53d19..a1e5a11c5e8 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesis2s.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesis2s.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn # IntComparatorSynthesis2s - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") An integer comparison based on 2s complement. @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisDefault.mdx index fa49684df78..f3413e893b0 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn # IntComparatorSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default synthesis for `IntegerComparatorGate`. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisNoAux.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisNoAux.mdx index 8ae9cd18f7c..934936bbb32 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisNoAux.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSynthesisNoAux.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn # IntComparatorSynthesisNoAux - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A potentially exponentially expensive comparison w/o auxiliary qubits. @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.IntComparatorSyn ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLinearFunction.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLinearFunction.mdx index d48c858656b..cfbfd462e29 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLinearFunction.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLinearFunction.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLine # KMSSynthesisLinearFunction - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Linear function synthesis plugin based on the Kutin-Moulton-Smithline method. @@ -29,7 +29,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisLine ### run - + Run synthesis for the given LinearFunction. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPermutation.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPermutation.mdx index 39cf33a6472..bc1c670e081 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPermutation.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPermutation.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPerm # KMSSynthesisPermutation - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The permutation synthesis plugin based on the Kutin, Moulton, Smithline method. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.KMSSynthesisPerm ### run - + Run synthesis for the given Permutation. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesisClifford.mdx index 63a205c255b..8529473ad97 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesi # LayerLnnSynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Clifford synthesis plugin based on the Bravyi-Maslov method to synthesize Cliffords into layers, with each layer synthesized adhering to LNN connectivity. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.LayerLnnSynthesi ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisClifford.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisClifford.mdx index d5f956beb2e..8ff897c901d 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisClifford.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisClifford.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisCl # LayerSynthesisClifford - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Clifford synthesis plugin based on the Bravyi-Maslov method to synthesize Cliffords into layers. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.LayerSynthesisCl ### run - + Run synthesis for the given Clifford. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault.mdx index 2c972fe7f5a..84cb1a89093 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDef # MCMTSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A default decomposition for MCMT gates. @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDef ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux.mdx index d491b32a687..716bb1d3722 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoA # MCMTSynthesisNoAux - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A V-chain based synthesis for `MCMTGate`. @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoA ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain.mdx index ca9482e5d92..41923331e0a 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVCh # MCMTSynthesisVChain - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A V-chain based synthesis for `MCMTGate`. @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVCh ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate.mdx new file mode 100644 index 00000000000..22c440bbf60 --- /dev/null +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate.mdx @@ -0,0 +1,42 @@ +--- +title: MCMTSynthesisXGate (dev version) +description: API reference for qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate in the dev version of qiskit +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate +--- + +# MCMTSynthesisXGate + + + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") + + A synthesis for `MCMTGate` with X gate as the base gate. + + ## Methods + + ### run + + + Run synthesis for the given Operation. + + **Parameters** + + * **high\_level\_object** ([*Operation*](qiskit.circuit.Operation "qiskit.circuit.Operation")) – The Operation to synthesize to a [`DAGCircuit`](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit") object. + * **coupling\_map** ([*CouplingMap*](qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap")) – The coupling map of the backend in case synthesis is done on a physical circuit. + * **target** ([*Target*](qiskit.transpiler.Target "qiskit.transpiler.Target")) – A target representing the target backend. + * **qubits** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) – List of qubits over which the operation is defined in case synthesis is done on a physical circuit. + * **options** – Additional method-specific optional kwargs. + + **Returns** + + **The quantum circuit representation of the Operation** + + when successful, and `None` otherwise. + + **Return type** + + [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") + + + diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95.mdx index 2f5d89bdff0..4a0ff4f8df9 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Cle # MCXSynthesis1CleanB95 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Barenco et al. (1995). @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Cle ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24.mdx index 80e44d9e039..2a7ba06faaa 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Cle # MCXSynthesis1CleanKG24 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Khattar and Gidney (2024). @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Cle The plugin name is :`mcx.1_clean_kg24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). - For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $1$ additional clean ancillary qubit. The synthesized circuit consists of $k + 2$ qubits and at most $12 * k - 18$ CX gates. + For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $1$ additional clean ancillary qubit. The synthesized circuit consists of $k + 2$ qubits and at most $6 * k - 6$ CX gates. The plugin supports the following plugin-specific options: @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Cle ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24.mdx index 331a0f9744c..b2cdf9f5621 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Dir # MCXSynthesis1DirtyKG24 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Khattar and Gidney (2024). @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Dir The plugin name is :`mcx.1_dirty_kg24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). - For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $1$ additional dirty ancillary qubit. The synthesized circuit consists of $k + 2$ qubits and at most $24 * k - 48$ CX gates. + For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $1$ additional dirty ancillary qubit. The synthesized circuit consists of $k + 2$ qubits and at most $12 * k - 18$ CX gates. The plugin supports the following plugin-specific options: @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1Dir ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24.mdx index 01ab83afdbe..1da88f23f1d 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Cle # MCXSynthesis2CleanKG24 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Khattar and Gidney (2024). @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Cle The plugin name is :`mcx.2_clean_kg24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). - For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $2$ additional clean ancillary qubits. The synthesized circuit consists of $k + 2$ qubits and at most $12 * k - 18$ CX gates. + For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $2$ additional clean ancillary qubits. The synthesized circuit consists of $k + 3$ qubits and at most $6 * k - 6$ CX gates. The plugin supports the following plugin-specific options: @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Cle ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24.mdx index 224726d4128..fa71741a1c0 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Dir # MCXSynthesis2DirtyKG24 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Khattar and Gidney (2024). @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Dir The plugin name is :`mcx.2_dirty_kg24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). - For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $2$ additional dirty ancillary qubits. The synthesized circuit consists of $k + 2$ qubits and at most $24 * k - 48$ CX gates. + For a multi-controlled X gate with $k\ge 3$ control qubits this synthesis method requires $2$ additional dirty ancillary qubits. The synthesized circuit consists of $k + 3$ qubits and at most $12 * k - 18$ CX gates. The plugin supports the following plugin-specific options: @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2Dir ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault.mdx index d7b9d7c94b3..e4b8a19baa6 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefa # MCXSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default synthesis plugin for a multi-controlled X gate. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefa ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode.mdx index b8ac55b19c4..6d69d76c92a 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGray # MCXSynthesisGrayCode - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the Gray code. @@ -23,7 +23,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGray ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15.mdx index 4aced1ba934..0d1e9e941c6 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCle # MCXSynthesisNCleanM15 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Maslov (2016). @@ -31,7 +31,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCle ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15.mdx index bfc25140b4e..5fc09e2106b 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDir # MCXSynthesisNDirtyI15 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the paper by Iten et al. (2016). @@ -34,7 +34,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDir ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24.mdx new file mode 100644 index 00000000000..32ff7068729 --- /dev/null +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24.mdx @@ -0,0 +1,34 @@ +--- +title: MCXSynthesisNoAuxHP24 (dev version) +description: API reference for qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24 in the dev version of qiskit +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24 +--- + +# MCXSynthesisNoAuxHP24 + + + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") + + Synthesis plugin for a multi-controlled X gate based on the paper by Huang and Palsberg. + + See \[1] for details. + + This plugin name is :`mcx.noaux_hp24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). + + For a multi-controlled X gate with $k$ control qubits this synthesis method requires no additional clean auxiliary qubits. The synthesized circuit consists of $k + 1$ qubits. The number of CX-gates is linear in $k$. + + **References** + + 1. Huang and Palsberg, *Compiling Conditional Quantum Gates without Using Helper Qubits*, PLDI (2024), \<[https://dl.acm.org/doi/10.1145/3656436](https://dl.acm.org/doi/10.1145/3656436)>\`\_ + + ## Methods + + ### run + + + Run synthesis for the given MCX gate. + + + diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24.mdx index 1c8c3e5d278..e2a92f5f5f7 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAu # MCXSynthesisNoAuxV24 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for a multi-controlled X gate based on the implementation for MCPhaseGate, which is in turn based on the paper by Vale et al. (2024). @@ -17,7 +17,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAu This plugin name is :`mcx.noaux_v24` which can be used as the key on an [`HLSConfig`](qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis"). - For a multi-controlled X gate with $k$ control qubits this synthesis method requires no additional clean auxiliary qubits. The synthesized circuit consists of $k + 1$ qubits. + For a multi-controlled X gate with $k$ control qubits this synthesis method requires no additional clean auxiliary qubits. The synthesized circuit consists of $k + 1$ qubits. The number of CX-gates is quadratic in $k$. **References** @@ -27,7 +27,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAu ### run - + Run synthesis for the given MCX gate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisC04.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisC04.mdx index 32d8c417e82..9c459dc60d2 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisC04.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisC04.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt # ModularAdderSynthesisC04 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder, modulo $2^n$. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisD00.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisD00.mdx index f0a9967de34..ca46796a6dc 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisD00.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisD00.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt # ModularAdderSynthesisD00 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A QFT-based adder, modulo $2^n$. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisDefault.mdx index f3f03cf53b6..f96d42c5ad8 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt # ModularAdderSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The default modular adder (no carry in, no carry out qubit) synthesis. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisV95.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisV95.mdx index 906abcf7f09..c945ebe34fa 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisV95.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynthesisV95.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt # ModularAdderSynthesisV95 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A ripple-carry adder, modulo $2^n$. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.ModularAdderSynt ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisH18.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisH18.mdx index 0b97b4921f3..abadb4e51e3 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisH18.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisH18.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthe # MultiplierSynthesisH18 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A cumulative multiplier based on controlled adders. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthe ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisR17.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisR17.mdx index 946e352a7dd..c73647e2bfd 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisR17.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthesisR17.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthe # MultiplierSynthesisR17 - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") A QFT-based multiplier. @@ -19,7 +19,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.MultiplierSynthe ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLinearFunction.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLinearFunction.mdx index 358b230edf9..7f457a4a2bf 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLinearFunction.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLinearFunction.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLine # PMHSynthesisLinearFunction - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Linear function synthesis plugin based on the Patel-Markov-Hayes method. @@ -35,7 +35,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PMHSynthesisLine ### run - + Run synthesis for the given LinearFunction. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisDefault.mdx index a9e14e3396d..52d6159b0e7 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSy # PauliEvolutionSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesize a [`PauliEvolutionGate`](qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") using the default synthesis algorithm. @@ -25,7 +25,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSy ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisRustiq.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisRustiq.mdx index a545568fd99..6f5db10a4b0 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisRustiq.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSynthesisRustiq.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSy # PauliEvolutionSynthesisRustiq - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesize a [`PauliEvolutionGate`](qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate") using Rustiq. @@ -47,7 +47,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.PauliEvolutionSy ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull.mdx index 3da51788bae..8c54ce2c0bf 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull # QFTSynthesisFull - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for QFT gates using all-to-all connectivity. @@ -42,7 +42,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisFull ### run - + Run synthesis for the given QFTGate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine.mdx index a389e05c6f1..cf51169347a 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine # QFTSynthesisLine - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesis plugin for QFT gates using linear connectivity. @@ -36,7 +36,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.QFTSynthesisLine ### run - + Run synthesis for the given QFTGate. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynthesisPermutation.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynthesisPermutation.mdx index acdffc15190..409ab1d61f2 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynthesisPermutation.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynthesisPermutation.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynt # TokenSwapperSynthesisPermutation - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") The permutation synthesis plugin based on the token swapper algorithm. @@ -33,7 +33,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.TokenSwapperSynt ### run - + Run synthesis for the given Permutation. diff --git a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynthesisDefault.mdx b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynthesisDefault.mdx index 5c1d40f3c16..d2f76056479 100644 --- a/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynthesisDefault.mdx +++ b/docs/api/qiskit/dev/qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynthesisDefault.mdx @@ -8,7 +8,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynth # WeightedSumSynthesisDefault - + Bases: [`HighLevelSynthesisPlugin`](qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") Synthesize a [`WeightedSumGate`](qiskit.circuit.library.WeightedSumGate "qiskit.circuit.library.WeightedSumGate") using the default synthesis algorithm. @@ -23,7 +23,7 @@ python_api_name: qiskit.transpiler.passes.synthesis.hls_plugins.WeightedSumSynth ### run - + Run synthesis for the given Operation. **Parameters** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_multivector.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_multivector.mdx index a133f0e8d1c..7ba4e1bf2ca 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_multivector.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_multivector.mdx @@ -32,7 +32,7 @@ python_api_name: qiskit.visualization.plot_bloch_multivector **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_vector.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_vector.mdx index fdfa0925713..c01fb3c5a37 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_vector.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_bloch_vector.mdx @@ -19,7 +19,7 @@ python_api_name: qiskit.visualization.plot_bloch_vector * **bloch** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")*\[double]*) – array of three elements where \[\, \, \] (Cartesian) or \[\, \, \] (spherical in radians) \ is inclination angle from +z direction \ is azimuth from +x direction * **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – a string that represents the plot title - * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An Axes to use for rendering the bloch sphere + * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An Axes to use for rendering the bloch sphere * **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Figure size in inches. Has no effect is passing `ax`. * **coord\_type** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – a string that specifies coordinate type for bloch (Cartesian or spherical), default is Cartesian * **font\_size** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – Font size. @@ -30,7 +30,7 @@ python_api_name: qiskit.visualization.plot_bloch_vector **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_distribution.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_distribution.mdx index 7bbfa7a51b3..9e237c4c077 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_distribution.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_distribution.mdx @@ -24,7 +24,7 @@ python_api_name: qiskit.visualization.plot_distribution * **legend** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) – A list of strings to use for labels of the data. The number of entries must match the length of data (if data is a list or 1 if it’s a dict) * **bar\_labels** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – Label each bar in histogram with probability value. * **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – A string to use for the plot title - * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. * **filename** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – file path to save image to. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_histogram.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_histogram.mdx index 20a89494c4a..c1867080ccc 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_histogram.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_histogram.mdx @@ -24,7 +24,7 @@ python_api_name: qiskit.visualization.plot_histogram * **legend** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) – A list of strings to use for labels of the data. The number of entries must match the length of data (if data is a list or 1 if it’s a dict) * **bar\_labels** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – Label each bar in histogram with counts value. * **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – A string to use for the plot title - * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. * **filename** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – file path to save image to. **Returns** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_state_city.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_state_city.mdx index ad960f0b2d6..8130d4cda91 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_state_city.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_state_city.mdx @@ -22,8 +22,8 @@ python_api_name: qiskit.visualization.plot_state_city * **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Figure size in inches. * **color** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) – A list of len=2 giving colors for real and imaginary components of matrix elements. * **alpha** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – Transparency value for bars - * **ax\_real** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. - * **ax\_imag** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_real only the imaginary component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax\_real** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax\_imag** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_real only the imaginary component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. **Returns** @@ -31,7 +31,7 @@ python_api_name: qiskit.visualization.plot_state_city **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_state_hinton.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_state_hinton.mdx index 7675908dd99..ea671aa7d52 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_state_hinton.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_state_hinton.mdx @@ -21,8 +21,8 @@ python_api_name: qiskit.visualization.plot_state_hinton * **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – a string that represents the plot title * **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Figure size in inches. * **filename** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – file path to save image to. - * **ax\_real** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. - * **ax\_imag** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax\_real** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax\_imag** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. If this is specified without an ax\_imag only the real component plot will be generated. Additionally, if specified there will be no returned Figure since it is redundant. **Returns** @@ -30,7 +30,7 @@ python_api_name: qiskit.visualization.plot_state_hinton **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_state_paulivec.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_state_paulivec.mdx index 5259ce252dc..233d75e902b 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_state_paulivec.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_state_paulivec.mdx @@ -28,7 +28,7 @@ $$ * **title** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – a string that represents the plot title * **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Figure size in inches. * **color** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") *or*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – Color of the coefficient value bars. - * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. **Returns** @@ -36,7 +36,7 @@ $$ **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/qiskit.visualization.plot_state_qsphere.mdx b/docs/api/qiskit/dev/qiskit.visualization.plot_state_qsphere.mdx index 1fa2a1ad622..2054f4fbe2e 100644 --- a/docs/api/qiskit/dev/qiskit.visualization.plot_state_qsphere.mdx +++ b/docs/api/qiskit/dev/qiskit.visualization.plot_state_qsphere.mdx @@ -17,7 +17,7 @@ python_api_name: qiskit.visualization.plot_state_qsphere * **state** ([*Statevector*](qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") *or*[*DensityMatrix*](qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix") *or ndarray*) – an N-qubit quantum state. * **figsize** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Figure size in inches. - * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.3)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. + * **ax** ([*matplotlib.axes.Axes*](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes "(in Matplotlib v3.10.5)")) – An optional Axes object to be used for the visualization output. If none is specified a new matplotlib Figure will be created and used. Additionally, if specified there will be no returned Figure since it is redundant. * **show\_state\_labels** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – An optional boolean indicating whether to show labels for each basis state. * **show\_state\_phases** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – An optional boolean indicating whether to show the phase for each basis state. * **use\_degrees** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – An optional boolean indicating whether to use radians or degrees for the phase values in the plot. @@ -28,7 +28,7 @@ python_api_name: qiskit.visualization.plot_state_qsphere **Return type** - [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.3)") + [`matplotlib.figure.Figure`](https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure "(in Matplotlib v3.10.5)") **Raises** diff --git a/docs/api/qiskit/dev/synthesis.mdx b/docs/api/qiskit/dev/synthesis.mdx index 0a9bdab59e6..9737d8d0b9c 100644 --- a/docs/api/qiskit/dev/synthesis.mdx +++ b/docs/api/qiskit/dev/synthesis.mdx @@ -715,7 +715,7 @@ python_api_name: qiskit.synthesis ### synth\_qft\_full - + Construct a circuit for the Quantum Fourier Transform using all-to-all connectivity. @@ -746,42 +746,50 @@ Decomposition of general $2^n \times 2^n$ unitary matrices for any number of qub ### qs\_decomposition - - Decomposes a unitary matrix into one and two qubit gates using Quantum Shannon Decomposition, + + Decomposes a unitary matrix into one and two qubit gates using Quantum Shannon Decomposition, based on the Block ZXZ-Decomposition. - This decomposition is described in Shende et al. \[1]. + This decomposition is described in Krol and Al-Ars \[2] and improves the method of Shende et al. \[1]. ```text - ┌───┐ ┌───┐ ┌───┐ ┌───┐ - ─┤ ├─ ───────┤ Rz├─────┤ Ry├─────┤ Rz├───── - │ │ ≃ ┌───┐└─┬─┘┌───┐└─┬─┘┌───┐└─┬─┘┌───┐ - /─┤ ├─ /─┤ ├──□──┤ ├──□──┤ ├──□──┤ ├ - └───┘ └───┘ └───┘ └───┘ └───┘ + ┌───┐ ┌───┐ ┌───┐ + ─┤ ├─ ────□──┤ H ├──□──┤ H ├──□── + │ │ ≃ ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ + /─┤ ├─ ──┤ C ├─────┤ B ├─────┤ A ├ + └───┘ └───┘ └───┘ └───┘ ``` - The number of [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate")s generated with the decomposition without optimizations is: + The number of [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate")s generated with the decomposition without optimizations is the same as the unoptimized method in \[1]: $$ \frac{9}{16} 4^n - \frac{3}{2} 2^n $$ - If `opt_a1 = True`, the default, the CX count is reduced by: + If `opt_a1 = True`, the CX count is reduced, improving \[1], by: $$ -\frac{1}{3} 4^{n - 2} - 1. +\frac{2}{3} (4^{n - 2} - 1). $$ - If `opt_a2 = True`, the default, the CX count is reduced by: + Saving two [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate")s instead of one in each step of the recursion. + + If `opt_a2 = True`, the CX count is reduced, as in \[1], by: $$ 4^{n-2} - 1. +$$ + + Hence, the number of [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate")s generated with the decomposition with optimizations is + +$$ +\frac{22}{48} 4^n - \frac{3}{2} 2^n + \frac{5}{3}. $$ **Parameters** * **mat** (*np.ndarray*) – unitary matrix to decompose - * **opt\_a1** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – whether to try optimization A.1 from Shende et al. \[1]. This should eliminate 1 `cx` per call. If `True`, [`CZGate`](qiskit.circuit.library.CZGate "qiskit.circuit.library.CZGate")s are left in the output. If desired these can be further decomposed to [`CXGate`](qiskit.circuit.library.CXGate "qiskit.circuit.library.CXGate")s. - * **opt\_a2** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – whether to try optimization A.2 from Shende et al. \[1]. This decomposes two qubit unitaries into a diagonal gate and a two cx unitary and reduces overall cx count by $4^{n-2} - 1$. + * **opt\_a1** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") *| None*) – whether to try optimization A.1 from \[1, 2]. This should eliminate 2 `cx` per call. + * **opt\_a2** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") *| None*) – whether to try optimization A.2 from \[1, 2]. This decomposes two qubit unitaries into a diagonal gate and a two `cx` unitary and reduces overall `cx` count by $4^{n-2} - 1$. This optimization should not be done if the original unitary is controlled. * **decomposer\_1q** (*Callable\[\[np.ndarray],* [*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")*] | None*) – optional 1Q decomposer. If None, uses [`OneQubitEulerDecomposer`](qiskit.synthesis.OneQubitEulerDecomposer "qiskit.synthesis.OneQubitEulerDecomposer"). * **decomposer\_2q** (*Callable\[\[np.ndarray],* [*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")*] | None*) – optional 2Q decomposer. If None, uses [`TwoQubitBasisDecomposer`](qiskit.synthesis.TwoQubitBasisDecomposer "qiskit.synthesis.TwoQubitBasisDecomposer"). @@ -796,6 +804,7 @@ $$ **References** 1. Shende, Bullock, Markov, *Synthesis of Quantum Logic Circuits*, [arXiv:0406176 \[quant-ph\]](https://arxiv.org/abs/quant-ph/0406176) + 2. Krol, Al-Ars, *Beyond Quantum Shannon: Circuit Construction for General n-Qubit Gates Based on Block ZXZ-Decomposition*, [arXiv:2403.13692](https://arxiv.org/abs/2403.13692) The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.unitary.aqc`](qiskit.synthesis.unitary.aqc#module-qiskit.synthesis.unitary.aqc "qiskit.synthesis.unitary.aqc"). @@ -839,7 +848,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcmt\_vchain - + Synthesize MCMT using a V-chain. This uses a chain of CCX gates, using `num_ctrl_qubits - 1` auxiliary qubits. @@ -865,10 +874,53 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u **Parameters** - * **gate** ([*Gate*](qiskit.circuit.Gate "qiskit.circuit.Gate")) – - * **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – - * **num\_target\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – - * **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – + * **gate** ([*Gate*](qiskit.circuit.Gate "qiskit.circuit.Gate")) – Base gate to be applied to the targets. + * **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – Number of control qubits. + * **num\_target\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – Number of target qubits. + * **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – Optional control state as an integer. + + **Returns** + + The synthesized circuit for the MCMT gate. + + **Return type** + + [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") + + +### synth\_mcmt\_xgate + + + Synthesize MCMT X gate. + + This uses a special circuit structure that is efficient for MCMT X gates. It does not require any ancillary qubits and benefits from efficient MCX decompositions. + + E.g. a 3-control, 3-target X gate will be synthesized as: + + ```python + q_0: ─────────────■──────────── + | + q_1: ─────────────■──────────── + | + q_2: ─────────────■──────────── + ┌─┴─┐ + q_3: ────────■──┤ X ├──■─────── + ┌─┴─┐└───┘┌─┴─┐ + q_4: ───■──┤ X ├─────┤ X ├──■── + ┌─┴─┐└───┘ └───┘┌─┴─┐ + q_5: ─┤ X ├───────────────┤ X ├ + └───┘ └───┘ + ``` + + **Parameters** + + * **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – Number of control qubits. + * **num\_target\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – Number of target qubits. + * **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *| None*) – Optional control state as an integer. + + **Returns** + + The synthesized circuit for the MCMT X gate. **Return type** @@ -877,8 +929,8 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_1\_clean\_kg24 - - Synthesize a multi-controlled X gate with $k$ controls using $1$ clean ancillary qubit producing a circuit with $2k-3$ Toffoli gates and depth $O(k)$ as described in Sec. 5.1 of \[1]. + + Synthesize a multi-controlled X gate with $k$ controls using $1$ clean ancillary qubit producing a circuit with $2k-3$ Toffoli gates or $6k-6$ CX gates and depth $O(k)$ as described in Sec. 5.1 of \[1]. **Parameters** @@ -903,8 +955,8 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_1\_dirty\_kg24 - - Synthesize a multi-controlled X gate with $k$ controls using $1$ dirty ancillary qubit producing a circuit with $4k-8$ Toffoli gates and depth $O(k)$ as described in Sec. 5.3 of \[1]. + + Synthesize a multi-controlled X gate with $k$ controls using $1$ dirty ancillary qubit producing a circuit with $4k-8$ Toffoli gates or $12k-18$ CX gates and depth $O(k)$ as described in Sec. 5.3 of \[1]. **Parameters** @@ -929,8 +981,8 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_2\_clean\_kg24 - - Synthesize a multi-controlled X gate with $k$ controls using $2$ clean ancillary qubits producing a circuit with $2k-3$ Toffoli gates and depth $O(\log(k))$ as described in Sec. 5.2 of \[1]. + + Synthesize a multi-controlled X gate with $k$ controls using $2$ clean ancillary qubits producing a circuit with $2k-3$ Toffoli gates or $6k-6$ CX gates and depth $O(\log(k))$ as described in Sec. 5.2 of \[1]. **Parameters** @@ -955,8 +1007,8 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_2\_dirty\_kg24 - - Synthesize a multi-controlled X gate with $k$ controls using $2$ dirty ancillary qubits producing a circuit with $4k-8$ Toffoli gates and depth $O(\log(k))$ as described in Sec. 5.4 of \[1]. + + Synthesize a multi-controlled X gate with $k$ controls using $2$ dirty ancillary qubits producing a circuit with $4k-8$ Toffoli gates or $12k-18$ CX gates and depth $O(\log(k))$ as described in Sec. 5.4 of \[1]. **Parameters** @@ -981,7 +1033,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_n\_dirty\_i15 - + Synthesize a multi-controlled X gate with $k$ controls based on the paper by Iten et al. \[1]. For $k\ge 4$ the method uses $k - 2$ dirty ancillary qubits, producing a circuit with $2 * k - 1$ qubits and at most $8 * k - 6$ CX gates. For $k\le 3$ explicit efficient circuits are used instead. @@ -1007,7 +1059,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_n\_clean\_m15 - + Synthesize a multi-controlled X gate with $k$ controls using $k - 2$ clean ancillary qubits with producing a circuit with $2 * k - 1$ qubits and at most $6 * k - 6$ CX gates, by Maslov \[1]. **Parameters** @@ -1029,7 +1081,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_1\_clean\_b95 - + Synthesize a multi-controlled X gate with $k$ controls using a single clean ancillary qubit producing a circuit with $k + 2$ qubits and at most $16 * k - 24$ CX gates, by \[1], \[2]. **Parameters** @@ -1052,7 +1104,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_mcx\_noaux\_v24 - + Synthesize a multi-controlled X gate with $k$ controls based on the implementation for MCPhaseGate. In turn, the MCPhase gate uses the decomposition for multi-controlled special unitaries described in \[1]. @@ -1076,9 +1128,33 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u 1. Vale et. al., *Circuit Decomposition of Multicontrolled Special Unitary Single-Qubit Gates*, IEEE TCAD 43(3) (2024), [arXiv:2302.06377](https://arxiv.org/abs/2302.06377) +### synth\_mcx\_noaux\_hp24 + + + Synthesize a multi-controlled X gate with $k$ controls based on the work by Huang and Palsberg. + + Produces a quantum circuit with $k + 1$ qubits. The number of CX-gates is linear in $k$. + + **Parameters** + + **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")) – The number of control qubits. + + **Returns** + + The synthesized quantum circuit. + + **Return type** + + [*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit") + + **References** + + 1. Huang and Palsberg, *Compiling Conditional Quantum Gates without Using Helper Qubits*, PLDI (2024), \<[https://dl.acm.org/doi/10.1145/3656436](https://dl.acm.org/doi/10.1145/3656436)>\`\_ + + ### synth\_mcx\_gray\_code - + Synthesize a multi-controlled X gate with $k$ controls using the Gray code. Produces a quantum circuit with $k + 1$ qubits. This method produces exponentially many CX gates and should be used only for small values of $k$. @@ -1098,7 +1174,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_c3x - + Efficient synthesis of 3-controlled X-gate. **Return type** @@ -1108,7 +1184,7 @@ The Approximate Quantum Compiler is available as the module [`qiskit.synthesis.u ### synth\_c4x - + Efficient synthesis of 4-controlled X-gate. **Return type** diff --git a/docs/api/qiskit/dev/transpiler_synthesis_plugins.mdx b/docs/api/qiskit/dev/transpiler_synthesis_plugins.mdx index 7d12580e3e0..7e373a12aa6 100644 --- a/docs/api/qiskit/dev/transpiler_synthesis_plugins.mdx +++ b/docs/api/qiskit/dev/transpiler_synthesis_plugins.mdx @@ -307,13 +307,14 @@ The following table lists synthesis plugins available for an [`MCXGate`](qiskit. | Plugin name | Plugin class | Number of clean ancillas | Number of dirty ancillas | Description | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------ | -------------------------------------------------------------------------------- | | `"gray_code"` | [`MCXSynthesisGrayCode`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode") | 0 | 0 | exponentially many CX gates; use only for small values of k | -| `"noaux_v24"` | [`MCXSynthesisNoAuxV24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24") | 0 | 0 | quadratic number of CX gates; use instead of `"gray_code"` for large values of k | +| `"noaux_v24"` | [`MCXSynthesisNoAuxV24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24") | 0 | 0 | quadratic number of CX gates | +| `"noaux_hp24"` | [`MCXSynthesisNoAuxHP24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24") | 0 | 0 | linear number of CX gates; use instead of `"noaux_v24"` or `"gray_code"` for k>5 | | `"n_clean_m15"` | [`MCXSynthesisNCleanM15`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15") | k-2 | 0 | at most 6\*k-6 CX gates | | `"n_dirty_i15"` | [`MCXSynthesisNDirtyI15`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15") | 0 | k-2 | at most 8\*k-6 CX gates | -| `"2_clean_kg24"` | [`MCXSynthesis2CleanKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24") | 2 | 0 | at most 12\*k-18 CX gates | -| `"2_dirty_kg24"` | [`MCXSynthesis2DirtyKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24") | 0 | 2 | at most 24\*k-48 CX gates | -| `"1_clean_kg24"` | [`MCXSynthesis1CleanKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24") | 1 | 0 | at most 12\*k-18 CX gates | -| `"1_dirty_kg24"` | [`MCXSynthesis1DirtyKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24") | 0 | 1 | at most 24\*k-48 CX gates | +| `"2_clean_kg24"` | [`MCXSynthesis2CleanKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24") | 2 | 0 | at most 6\*k-6 CX gates | +| `"2_dirty_kg24"` | [`MCXSynthesis2DirtyKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2DirtyKG24") | 0 | 2 | at most 12\*k-18 CX gates | +| `"1_clean_kg24"` | [`MCXSynthesis1CleanKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanKG24") | 1 | 0 | at most 6\*k-6 CX gates | +| `"1_dirty_kg24"` | [`MCXSynthesis1DirtyKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1DirtyKG24") | 0 | 1 | at most 12\*k-18 CX gates | | `"1_clean_b95"` | [`MCXSynthesis1CleanB95`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis1CleanB95") | 1 | 0 | at most 16\*k-8 CX gates | | `"default"` | [`MCXSynthesisDefault`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisDefault") | any | any | chooses the best algorithm based on the ancillas available | @@ -321,6 +322,7 @@ The following table lists synthesis plugins available for an [`MCXGate`](qiskit. | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | [`MCXSynthesisGrayCode`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode")() | Synthesis plugin for a multi-controlled X gate based on the Gray code. | | [`MCXSynthesisNoAuxV24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxV24")() | Synthesis plugin for a multi-controlled X gate based on the implementation for MCPhaseGate, which is in turn based on the paper by Vale et al. (2024). | +| [`MCXSynthesisNoAuxHP24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24")() | Synthesis plugin for a multi-controlled X gate based on the paper by Huang and Palsberg. | | [`MCXSynthesisNCleanM15`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNCleanM15")() | Synthesis plugin for a multi-controlled X gate based on the paper by Maslov (2016). | | [`MCXSynthesisNDirtyI15`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNDirtyI15")() | Synthesis plugin for a multi-controlled X gate based on the paper by Iten et al. (2016). | | [`MCXSynthesis2CleanKG24`](qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24 "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesis2CleanKG24")() | Synthesis plugin for a multi-controlled X gate based on the paper by Khattar and Gidney (2024). | @@ -336,13 +338,15 @@ The following table lists synthesis plugins available for an [`MCXGate`](qiskit. | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------ | ---------------------------------------------------------- | | `"vchain"` | [`MCMTSynthesisVChain`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain") | k-1 | 0 | uses a linear number of Toffoli gates | | `"noaux"` | [`MCMTSynthesisNoAux`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux") | 0 | 0 | uses Qiskit’s standard control mechanism | +| `"xgate"` | [`MCMTSynthesisXGate`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate") | 0 | 0 | uses a linear number of Toffoli gates | | `"default"` | [`MCMTSynthesisDefault`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault") | any | any | chooses the best algorithm based on the ancillas available | -| | | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -| [`MCMTSynthesisVChain`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain")() | A V-chain based synthesis for `MCMTGate`. | -| [`MCMTSynthesisNoAux`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux")() | A V-chain based synthesis for `MCMTGate`. | -| [`MCMTSynthesisDefault`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault")() | A default decomposition for MCMT gates. | +| | | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | +| [`MCMTSynthesisVChain`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisVChain")() | A V-chain based synthesis for `MCMTGate`. | +| [`MCMTSynthesisNoAux`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisNoAux")() | A V-chain based synthesis for `MCMTGate`. | +| [`MCMTSynthesisXGate`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate")() | A synthesis for `MCMTGate` with X gate as the base gate. | +| [`MCMTSynthesisDefault`](qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisDefault")() | A default decomposition for MCMT gates. | ##### Integer comparators diff --git a/public/docs/api/qiskit-c/dev/objects.inv b/public/docs/api/qiskit-c/dev/objects.inv index f0dc49ea15b..1153e12b61f 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-ibm-runtime/dev/objects.inv b/public/docs/api/qiskit-ibm-runtime/dev/objects.inv index 3a4276b250f..69c908ec1c1 100644 Binary files a/public/docs/api/qiskit-ibm-runtime/dev/objects.inv and b/public/docs/api/qiskit-ibm-runtime/dev/objects.inv differ diff --git a/public/docs/api/qiskit/dev/objects.inv b/public/docs/api/qiskit/dev/objects.inv index ae017b3b785..5f9cf13fe27 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 f6c2a93b333..7152c27809a 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 ee801a6ffa3..9006b73796a 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_library-6_01.avif b/public/docs/images/api/qiskit/dev/circuit_library-6_01.avif index 7fa4caac074..bbe409ec6b1 100644 Binary files a/public/docs/images/api/qiskit/dev/circuit_library-6_01.avif and b/public/docs/images/api/qiskit/dev/circuit_library-6_01.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 d815592eb33..7db53c354f2 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 49e2a56dc79..ba971d143d4 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 a0d0d5fb3c4..b473488b37c 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 64118d1d4b2..187c2aa5126 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 2cc7efdd798..939e5939b91 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 4c071d51032..6b0a5a08204 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 1a90d1f4079..d6ba27789b3 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 4c4d74562b7..aba5eb19981 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 b68928583fe..726212ee68c 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 bf10ebddfa6..93d9bcd54df 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 55d3b0eeb5e..6daf6cdcb88 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 3f688d615d7..d869f7fdb83 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 fca0f11c0f5..f8a6f41a8c7 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 619805bcb37..6fabf458cb1 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 af2b1757ffa..eb7a234c731 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-InnerProduct-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProduct-1.avif index 6e40a6b9427..c42c7ce0431 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProduct-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-InnerProduct-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 cf425c1c3a6..b74d2cbae37 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 f488261e966..9c45b651aa8 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 ee69bf3dd5a..ee143ff7606 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 40b831e89c5..4a2fc5cd9de 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 d28017afa11..9b00d3b71a7 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-phase_estimation-1.avif b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-phase_estimation-1.avif index 1a846a067f5..6a3cea6c3de 100644 Binary files a/public/docs/images/api/qiskit/dev/qiskit-circuit-library-phase_estimation-1.avif and b/public/docs/images/api/qiskit/dev/qiskit-circuit-library-phase_estimation-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 d2eb3db40cd..d7297a48533 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 01cb8d1e893..0347f260f19 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 f0ea08da036..b0605684a08 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 5d156c3d213..765fc42ab04 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 d462ca88c8c..2cea3ed279f 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-visualization-circuit_drawer-1.avif b/public/docs/images/api/qiskit/dev/qiskit-visualization-circuit_drawer-1.avif index 9eeea46d385..9c54a66d63b 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 92ed6b53aff..957ea8edcaa 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 e85644ba611..1c2d6f57ca0 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 d3cab65c815..aa62fce9246 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 95dfdf42e3c..fe12491d5e5 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 f373534c6ed..1036422e0bf 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 0ba6d175dc6..9c6855619fa 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 6da71f7fd02..13d9fd1309a 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 35cc7977c76..492be8dfe00 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 453eb8ead2f..e7d99ef8409 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 b5486b349ae..de34164574d 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 1b7c6ad298e..d5a320448f6 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 8c3ded04459..0cada9b47b2 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 5a25f82b845..e7ab30f7ea9 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 8fc581d6db7..81f4706d3ee 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/3573872792/zip", + "dev": "https://api.github.com/repos/Qiskit/qiskit/actions/artifacts/3722398426/zip", "2.1": "https://ibm.box.com/shared/static/mplc0lvu7mi2xwri9z3y0u0lr6z9ivwv.zip", "2.0": "https://ibm.box.com/shared/static/r3qdbe7yznpi300y12tvksrts9l0xavw.zip", "1.4": "https://ibm.box.com/shared/static/3jeou6yywet2d4no7pvjgvpvwhhfn9ru.zip", @@ -33,7 +33,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/3564422081/zip", + "dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/3693821326/zip", "0.41": "https://ibm.box.com/shared/static/eu5nc0ro07kogyki718oanyx56kkzlab.zip", "0.40": "https://ibm.box.com/shared/static/m2mkvy07d0ns2mz55jskxmfvs4ufzimu.zip", "0.39": "https://ibm.box.com/shared/static/5rcdw33un656ydr62q50gdbxmp46g5ii.zip", diff --git a/scripts/config/historical-pages-to-latest.json b/scripts/config/historical-pages-to-latest.json index 810db0e1b1c..7c66881ffe9 100644 --- a/scripts/config/historical-pages-to-latest.json +++ b/scripts/config/historical-pages-to-latest.json @@ -20930,7 +20930,10 @@ "2.0": { "qiskit.transpiler.passes.LightCone": "/" }, - "dev": {} + "dev": { + "qiskit.transpiler.passes.synthesis.hls_plugins.MCMTSynthesisXGate": "/", + "qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisNoAuxHP24": "/" + } }, "qiskit-ibm-runtime": { "0.14": { @@ -21701,6 +21704,7 @@ "qiskit-c": { "2.0": {}, "dev": { + "qk-elide-permutations-result": "/", "qk-transpiler-passes": "/", "qk-vf-2-layout-result": "/" }