Skip to content

Commit

Permalink
Update Qiskit Transpiler Service docs (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano authored May 22, 2024
1 parent 9f601b3 commit aa6d008
Show file tree
Hide file tree
Showing 15 changed files with 651 additions and 39 deletions.
7 changes: 4 additions & 3 deletions cspell/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
24 changes: 24 additions & 0 deletions docs/api/qiskit-transpiler-service/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand Down
12 changes: 9 additions & 3 deletions docs/api/qiskit-transpiler-service/ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

Original file line number Diff line number Diff line change
@@ -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

<Class id="qiskit_transpiler_service.ai.AICliffordSynthesis" isDedicatedPage={true} signature="qiskit_transpiler_service.ai.AICliffordSynthesis(backend_name: str, replace_only_if_better: bool = True, max_threads: int | None = None)" modifiers="class">
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

<Function id="qiskit_transpiler_service.ai.AICliffordSynthesis.execute" signature="execute(passmanager_ir, state, callback=None)">
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)")]
</Function>

### name

<Function id="qiskit_transpiler_service.ai.AICliffordSynthesis.name" signature="name()">
Name of the pass.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")
</Function>

### run

<Function id="qiskit_transpiler_service.ai.AICliffordSynthesis.run" signature="run(dag)">
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.
</Function>

### synth\_node

<Function id="qiskit_transpiler_service.ai.AICliffordSynthesis.synth_node" signature="synth_node(node)" />

### update\_status

<Function id="qiskit_transpiler_service.ai.AICliffordSynthesis.update_status" signature="update_status(state, run_state)">
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)")
</Function>
</Class>

Original file line number Diff line number Diff line change
@@ -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

<Class id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis" isDedicatedPage={true} signature="qiskit_transpiler_service.ai.AILinearFunctionSynthesis(backend_name: str, replace_only_if_better: bool = True, max_threads: int | None = None)" modifiers="class">
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

<Function id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis.execute" signature="execute(passmanager_ir, state, callback=None)">
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)")]
</Function>

### name

<Function id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis.name" signature="name()">
Name of the pass.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")
</Function>

### run

<Function id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis.run" signature="run(dag)">
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.
</Function>

### synth\_node

<Function id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis.synth_node" signature="synth_node(node)" />

### update\_status

<Function id="qiskit_transpiler_service.ai.AILinearFunctionSynthesis.update_status" signature="update_status(state, run_state)">
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)")
</Function>
</Class>

Original file line number Diff line number Diff line change
@@ -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

<Class id="qiskit_transpiler_service.ai.AIPermutationSynthesis" isDedicatedPage={true} signature="qiskit_transpiler_service.ai.AIPermutationSynthesis(backend_name: str, replace_only_if_better: bool = True, max_threads: int | None = None)" modifiers="class">
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

<Function id="qiskit_transpiler_service.ai.AIPermutationSynthesis.execute" signature="execute(passmanager_ir, state, callback=None)">
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)")]
</Function>

### name

<Function id="qiskit_transpiler_service.ai.AIPermutationSynthesis.name" signature="name()">
Name of the pass.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")
</Function>

### run

<Function id="qiskit_transpiler_service.ai.AIPermutationSynthesis.run" signature="run(dag)">
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.
</Function>

### synth\_node

<Function id="qiskit_transpiler_service.ai.AIPermutationSynthesis.synth_node" signature="synth_node(node)" />

### update\_status

<Function id="qiskit_transpiler_service.ai.AIPermutationSynthesis.update_status" signature="update_status(state, run_state)">
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)")
</Function>
</Class>

Loading

0 comments on commit aa6d008

Please sign in to comment.