diff --git a/cspell/cSpell.json b/cspell/cSpell.json index dc986c3bd40..35b60e82161 100644 --- a/cspell/cSpell.json +++ b/cspell/cSpell.json @@ -50,8 +50,9 @@ ], "ignorePaths": [ // We cannot easily control these API docs since they live in other repositories. - "../docs/api/qiskit/**/*.md*", - "../docs/api/qiskit-ibm-runtime/**/*.md*", - "../docs/api/qiskit-ibm-provider/**/*.md*" + "../docs/api/qiskit/**/*.mdx", + "../docs/api/qiskit-ibm-runtime/**/*.mdx", + "../docs/api/qiskit-ibm-provider/**/*.mdx", + "../docs/api/qiskit-transpiler-service/**/*.mdx" ] } diff --git a/docs/api/qiskit-transpiler-service/_toc.json b/docs/api/qiskit-transpiler-service/_toc.json index 4964b5f8c1c..d9b65ed93b8 100644 --- a/docs/api/qiskit-transpiler-service/_toc.json +++ b/docs/api/qiskit-transpiler-service/_toc.json @@ -12,9 +12,33 @@ "title": "Module overview", "url": "/api/qiskit-transpiler-service/ai" }, + { + "title": "AICliffordSynthesis", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AICliffordSynthesis" + }, + { + "title": "AILinearFunctionSynthesis", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AILinearFunctionSynthesis" + }, + { + "title": "AIPermutationSynthesis", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIPermutationSynthesis" + }, { "title": "AIRouting", "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIRouting" + }, + { + "title": "CollectCliffords", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectCliffords" + }, + { + "title": "CollectLinearFunctions", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectLinearFunctions" + }, + { + "title": "CollectPermutations", + "url": "/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectPermutations" } ] }, diff --git a/docs/api/qiskit-transpiler-service/ai.mdx b/docs/api/qiskit-transpiler-service/ai.mdx index a715cc7615b..2107e566909 100644 --- a/docs/api/qiskit-transpiler-service/ai.mdx +++ b/docs/api/qiskit-transpiler-service/ai.mdx @@ -18,7 +18,13 @@ python_api_name: qiskit_transpiler_service.ai ## Classes -| | | -| ------------------------------------------------------------------------------------------------------------------ | - | -| [`AIRouting`](qiskit_transpiler_service.ai.AIRouting "qiskit_transpiler_service.ai.AIRouting")(\*args, \*\*kwargs) | | +| | | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| [`AIRouting`](qiskit_transpiler_service.ai.AIRouting "qiskit_transpiler_service.ai.AIRouting")(\[backend\_name, coupling\_map, ...]) | The AIRouting pass acts both as a layout stage and a routing stage. | +| [`AICliffordSynthesis`](qiskit_transpiler_service.ai.AICliffordSynthesis "qiskit_transpiler_service.ai.AICliffordSynthesis")(backend\_name\[, ...]) | Synthesis for Clifford circuits (blocks of H, S and CX gates). | +| [`AILinearFunctionSynthesis`](qiskit_transpiler_service.ai.AILinearFunctionSynthesis "qiskit_transpiler_service.ai.AILinearFunctionSynthesis")(backend\_name\[, ...]) | Synthesis for Linear Function circuits (blocks of CX and SWAP gates). | +| [`AIPermutationSynthesis`](qiskit_transpiler_service.ai.AIPermutationSynthesis "qiskit_transpiler_service.ai.AIPermutationSynthesis")(backend\_name\[, ...]) | Synthesis for Permutation circuits (blocks of SWAP gates). | +| [`CollectCliffords`](qiskit_transpiler_service.ai.CollectCliffords "qiskit_transpiler_service.ai.CollectCliffords")(\[do\_commutative\_analysis, ...]) | Collects Clifford blocks as Instruction objects and stores the original sub-circuit to compare against it after synthesis. | +| [`CollectLinearFunctions`](qiskit_transpiler_service.ai.CollectLinearFunctions "qiskit_transpiler_service.ai.CollectLinearFunctions")(\[...]) | Collects blocks of SWAP and CX as LinearFunction objects and stores the original sub-circuit to compare against it after synthesis. | +| [`CollectPermutations`](qiskit_transpiler_service.ai.CollectPermutations "qiskit_transpiler_service.ai.CollectPermutations")(\[...]) | Collects blocks of SWAP circuits as Permutations. | diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AICliffordSynthesis.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AICliffordSynthesis.mdx new file mode 100644 index 00000000000..271edfeb03d --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AICliffordSynthesis.mdx @@ -0,0 +1,91 @@ +--- +title: AICliffordSynthesis +description: API reference for qiskit_transpiler_service.ai.AICliffordSynthesis +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.AICliffordSynthesis +--- + +# AICliffordSynthesis + + + Bases: `AISynthesis` + + Synthesis for Clifford circuits (blocks of H, S and CX gates). Currently up to 9 qubit blocks. + + **Parameters** + + * **backend\_name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Name of the backend used for doing the AI Clifford synthesis. + * **replace\_only\_if\_better** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Determine if replace the original circuit with the synthesized one if it’s better, defaults to True. + * **max\_threads** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the number of requests to send in parallel. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run a pass on the DAGCircuit. This is implemented by the pass developer. + + **Parameters** + + **dag** ([*DAGCircuit*](/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v1.1)")) – the dag on which the pass is run. + + **Raises** + + [**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError "(in Python v3.12)") – when this is left unimplemented for a pass. + + + ### synth\_node + + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AILinearFunctionSynthesis.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AILinearFunctionSynthesis.mdx new file mode 100644 index 00000000000..2c601bf5bcd --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AILinearFunctionSynthesis.mdx @@ -0,0 +1,91 @@ +--- +title: AILinearFunctionSynthesis +description: API reference for qiskit_transpiler_service.ai.AILinearFunctionSynthesis +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.AILinearFunctionSynthesis +--- + +# AILinearFunctionSynthesis + + + Bases: `AISynthesis` + + Synthesis for Linear Function circuits (blocks of CX and SWAP gates). Currently up to 9 qubit blocks. + + **Parameters** + + * **backend\_name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Name of the backend used for doing the AI Linear Function synthesis. + * **replace\_only\_if\_better** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Determine if replace the original circuit with the synthesized one if it’s better, defaults to True. + * **max\_threads** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the number of requests to send in parallel. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run a pass on the DAGCircuit. This is implemented by the pass developer. + + **Parameters** + + **dag** ([*DAGCircuit*](/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v1.1)")) – the dag on which the pass is run. + + **Raises** + + [**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError "(in Python v3.12)") – when this is left unimplemented for a pass. + + + ### synth\_node + + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIPermutationSynthesis.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIPermutationSynthesis.mdx new file mode 100644 index 00000000000..81b5a828fd6 --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIPermutationSynthesis.mdx @@ -0,0 +1,91 @@ +--- +title: AIPermutationSynthesis +description: API reference for qiskit_transpiler_service.ai.AIPermutationSynthesis +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.AIPermutationSynthesis +--- + +# AIPermutationSynthesis + + + Bases: `AISynthesis` + + Synthesis for Permutation circuits (blocks of SWAP gates). Currently available for 65, 33, and 27 qubit blocks. + + **Parameters** + + * **backend\_name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Name of the backend used for doing the AI Linear Function synthesis. + * **replace\_only\_if\_better** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Determine if replace the original circuit with the synthesized one if it’s better, defaults to True. + * **max\_threads** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the number of requests to send in parallel. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run a pass on the DAGCircuit. This is implemented by the pass developer. + + **Parameters** + + **dag** ([*DAGCircuit*](/api/qiskit/qiskit.dagcircuit.DAGCircuit "(in Qiskit v1.1)")) – the dag on which the pass is run. + + **Raises** + + [**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError "(in Python v3.12)") – when this is left unimplemented for a pass. + + + ### synth\_node + + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIRouting.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIRouting.mdx index f2789268fd3..d07a1139eb3 100644 --- a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIRouting.mdx +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.AIRouting.mdx @@ -8,49 +8,48 @@ python_api_name: qiskit_transpiler_service.ai.AIRouting # AIRouting - - Bases: [`TransformationPass`](/api/qiskit/qiskit.transpiler.TransformationPass "(in Qiskit v1.0)") + + Bases: [`TransformationPass`](/api/qiskit/qiskit.transpiler.TransformationPass "(in Qiskit v1.1)") - ## Attributes + The AIRouting pass acts both as a layout stage and a routing stage. - ### is\_analysis\_pass + **Parameters** - - Check if the pass is an analysis pass. - - If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass. - - - ### is\_transformation\_pass - - - Check if the pass is a transformation pass. - - If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read). - + * **backend\_name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*, optional*) – Name of the backend used for doing the transpilation. + * **coupling\_map** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.12)")*\[*[*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.12)")*\[*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*]], optional*) – A list of pairs that represents physical links between qubits. + * **optimization\_level** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – With a range from 1 to 3, determines the computational effort to spend in the process (higher usually gives better results but takes longer), defaults to 2. + * **layout\_mode** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Specifies how to handle the layout selection. There are 3 layout modes: keep (respects the layout set by the previous transpiler passes), improve (uses the layout set by the previous transpiler passes as a starting point) and optimize (ignores previous layout selections), defaults to OPTIMIZE. ## Methods ### execute - + Execute optimization task for input Qiskit IR. **Parameters** - * **passmanager\_ir** – Qiskit IR to optimize. - * **state** – State associated with workflow execution by the pass manager itself. - * **callback** – A callback function which is caller per execution of optimization task. + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. **Returns** Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] ### name - + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") ### run @@ -78,17 +77,21 @@ python_api_name: qiskit_transpiler_service.ai.AIRouting ### update\_status - + Update workflow status. **Parameters** - * **state** – Pass manager state to update. - * **run\_state** – Completion status of current task. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. **Returns** Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectCliffords.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectCliffords.mdx new file mode 100644 index 00000000000..1ec7540c1d5 --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectCliffords.mdx @@ -0,0 +1,89 @@ +--- +title: CollectCliffords +description: API reference for qiskit_transpiler_service.ai.CollectCliffords +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.CollectCliffords +--- + +# CollectCliffords + + + Bases: `RepeatedCollectAndCollapse` + + Collects Clifford blocks as Instruction objects and stores the original sub-circuit to compare against it after synthesis. + + **Parameters** + + * **do\_commutative\_analysis** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Enable or disable commutative analysis, defaults to True + * **min\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the minimum size for blocks generated during the collect Cliffords pass, defaults to 2. + * **max\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the maximum size for blocks generated during the collect Cliffords pass, defaults to 9. + * **collect\_from\_back** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Specify if collect blocks in reverse order or not, defaults to False. + * **num\_reps** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Specify how many times to repeat the optimization process, defaults to 10. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run the CollectLinearFunctions pass on dag. :param dag: the DAG to be optimized. :type dag: DAGCircuit + + **Returns** + + the optimized DAG. + + **Return type** + + DAGCircuit + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectLinearFunctions.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectLinearFunctions.mdx new file mode 100644 index 00000000000..33315d615ee --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectLinearFunctions.mdx @@ -0,0 +1,89 @@ +--- +title: CollectLinearFunctions +description: API reference for qiskit_transpiler_service.ai.CollectLinearFunctions +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.CollectLinearFunctions +--- + +# CollectLinearFunctions + + + Bases: `RepeatedCollectAndCollapse` + + Collects blocks of SWAP and CX as LinearFunction objects and stores the original sub-circuit to compare against it after synthesis. + + **Parameters** + + * **do\_commutative\_analysis** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Enable or disable commutative analysis, defaults to True + * **min\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the minimum size for blocks generated during the collect linear functions pass, defaults to 4. + * **max\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the maximum size for blocks generated during the collect linear functions pass, defaults to 9. + * **collect\_from\_back** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Specify if collect blocks in reverse order or not, defaults to False. + * **num\_reps** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Specify how many times to repeat the optimization process, defaults to 10. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run the CollectLinearFunctions pass on dag. :param dag: the DAG to be optimized. :type dag: DAGCircuit + + **Returns** + + the optimized DAG. + + **Return type** + + DAGCircuit + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectPermutations.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectPermutations.mdx new file mode 100644 index 00000000000..91650ef6214 --- /dev/null +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.ai.CollectPermutations.mdx @@ -0,0 +1,89 @@ +--- +title: CollectPermutations +description: API reference for qiskit_transpiler_service.ai.CollectPermutations +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_transpiler_service.ai.CollectPermutations +--- + +# CollectPermutations + + + Bases: `RepeatedCollectAndCollapse` + + Collects blocks of SWAP circuits as Permutations. + + **Parameters** + + * **do\_commutative\_analysis** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Enable or disable commutative analysis, defaults to True + * **min\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the minimum size for blocks generated during the collect permutations pass, defaults to 4. + * **max\_block\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Set the maximum size for blocks generated during the collect permutations pass, defaults to 12. + * **collect\_from\_back** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Specify if collect blocks in reverse order or not, defaults to False. + * **num\_reps** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*, optional*) – Specify how many times to repeat the optimization process, defaults to 10. + + ## Methods + + ### execute + + + Execute optimization task for input Qiskit IR. + + **Parameters** + + * **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) – Qiskit IR to optimize. + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – State associated with workflow execution by the pass manager itself. + * **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) – A callback function which is caller per execution of optimization task. + + **Returns** + + Optimized Qiskit IR and state of the workflow. + + **Return type** + + [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")] + + + ### name + + + Name of the pass. + + **Return type** + + [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") + + + ### run + + + Run the CollectLinearFunctions pass on dag. :param dag: the DAG to be optimized. :type dag: DAGCircuit + + **Returns** + + the optimized DAG. + + **Return type** + + DAGCircuit + + + ### update\_status + + + Update workflow status. + + **Parameters** + + * **state** ([*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)")) – Pass manager state to update. + * **run\_state** (*RunState*) – Completion status of current task. + + **Returns** + + Updated pass manager state. + + **Return type** + + [*PassManagerState*](/api/qiskit/qiskit.passmanager.PassManagerState "(in Qiskit v1.1)") + + + diff --git a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.transpiler_service.TranspilerService.mdx b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.transpiler_service.TranspilerService.mdx index 092456ff28b..40521e97126 100644 --- a/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.transpiler_service.TranspilerService.mdx +++ b/docs/api/qiskit-transpiler-service/qiskit_transpiler_service.transpiler_service.TranspilerService.mdx @@ -8,13 +8,34 @@ python_api_name: qiskit_transpiler_service.transpiler_service.TranspilerService # TranspilerService - + Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.12)") + Class for using the transpiler service. + + **Parameters** + + * **optimization\_level** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – The optimization level to use during the transpilation. There are 4 optimization levels ranging from 0 to 3, where 0 is intended for not performing any optimizations and 3 spends the most effort to optimize the circuit. + * **ai** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")*, optional*) – Specifyies if the transpilation should use AI or not, defaults to True. + * **coupling\_map** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.12)")*\[*[*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.12)")*\[*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*]], optional*) – A list of pairs that represents physical links between qubits. + * **backend\_name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*, optional*) – Name of the backend used for doing the transpilation. + * **qiskit\_transpile\_options** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)")*, optional*) – Other options to transpile with qiskit. + * **ai\_layout\_mode** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*, optional*) – Specifies how to handle the layout selection. There are 3 layout modes: keep (respects the layout set by the previous transpiler passes), improve (uses the layout set by the previous transpiler passes as a starting point) and optimize (ignores previous layout selections). + ## Methods ### run - + + Transpile the circuit(s) by calling the service /transpile endpoint. + + **Parameters** + + **circuits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *|*[*QuantumCircuit*](/api/qiskit/qiskit.circuit.QuantumCircuit "(in Qiskit v1.1)")*] |* [*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *|*[*QuantumCircuit*](/api/qiskit/qiskit.circuit.QuantumCircuit "(in Qiskit v1.1)")) – circuit(s) to transpile. + + **Returns** + + The transpiled circuit(s) + diff --git a/docs/api/qiskit-transpiler-service/transpiler_service.mdx b/docs/api/qiskit-transpiler-service/transpiler_service.mdx index 9e87c0c9bd0..3f73cc81aa0 100644 --- a/docs/api/qiskit-transpiler-service/transpiler_service.mdx +++ b/docs/api/qiskit-transpiler-service/transpiler_service.mdx @@ -18,7 +18,7 @@ python_api_name: qiskit_transpiler_service.transpiler_service ## Classes -| | | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | -| [`TranspilerService`](qiskit_transpiler_service.transpiler_service.TranspilerService "qiskit_transpiler_service.transpiler_service.TranspilerService")(optimization\_level\[, ai, ...]) | | +| | | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | +| [`TranspilerService`](qiskit_transpiler_service.transpiler_service.TranspilerService "qiskit_transpiler_service.transpiler_service.TranspilerService")(optimization\_level\[, ai, ...]) | Class for using the transpiler service. | diff --git a/docs/api/qiskit-transpiler-service/utils.mdx b/docs/api/qiskit-transpiler-service/utils.mdx index 86d05cc05f4..fe31e14225f 100644 --- a/docs/api/qiskit-transpiler-service/utils.mdx +++ b/docs/api/qiskit-transpiler-service/utils.mdx @@ -20,11 +20,28 @@ python_api_name: qiskit_transpiler_service.utils ### create\_random\_linear\_function - + + **Parameters** + + * **n\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – + * **seed** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – + + **Return type** + + [*LinearFunction*](/api/qiskit/qiskit.circuit.library.LinearFunction "(in Qiskit v1.1)") + ### get\_metrics - + Returns a dict with metrics from a QuantumCircuit + + **Parameters** + + **qc** ([*QuantumCircuit*](/api/qiskit/qiskit.circuit.QuantumCircuit "(in Qiskit v1.1)")) – + + **Return type** + + [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")] diff --git a/package.json b/package.json index 6e7333fec74..c0083f9d93f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "Qiskit Development Team", "license": "Apache-2.0", "scripts": { - "check": "npm run check:qiskit-bot && check:metadata && npm run check:spelling && npm run check:internal-links && npm run check:orphan-pages && npm run check:fmt", + "check": "npm run check:qiskit-bot && npm run check:metadata && npm run check:spelling && npm run check:internal-links && npm run check:orphan-pages && npm run check:fmt", "check:metadata": "node -r esbuild-register scripts/commands/checkMetadata.ts", "check:spelling": "cspell --relative --no-progress docs/**/*.md* docs/api/**/*.md* --config cspell/cSpell.json", "check:fmt": "prettier --check .", diff --git a/public/api/qiskit-transpiler-service/objects.inv b/public/api/qiskit-transpiler-service/objects.inv index b01df8e1e01..44855e70fa1 100644 Binary files a/public/api/qiskit-transpiler-service/objects.inv and b/public/api/qiskit-transpiler-service/objects.inv differ