Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/qiskit-addon-aqc-tensor/_package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "qiskit-addon-aqc-tensor",
"version": "0.3.0"
"version": "0.3.1"
}
4 changes: 3 additions & 1 deletion docs/api/qiskit-addon-aqc-tensor/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,7 @@
}
],
"collapsed": true,
"untranslatable": true
"untranslatable": true,
"parentUrl": "/docs/addons/qiskit-addon-aqc-tensor",
"parentLabel": "Approximate quantum compilation (AQC-Tensor)"
}
24 changes: 14 additions & 10 deletions docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock

Ansatz block.

This is the base class of all blocks returned by [`generate_ansatz_from_circuit()`](ansatz-generation#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit").
This is the base class of all blocks returned by [`generate_ansatz_from_circuit()`](/docs/api/qiskit-addon-aqc-tensor/ansatz-generation#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit").

Initialize the ansatz block.

Expand Down Expand Up @@ -144,7 +144,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock

**Return type**

[`Iterable`](https://docs.python.org/3/library/typing.html#typing.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]
[`Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]

**Returns**

Expand All @@ -160,22 +160,26 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock
<Function id="qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock.control" signature="control(num_ctrl_qubits=1, label=None, ctrl_state=None, annotated=None)">
Return the controlled version of itself.

Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`).
The controlled gate is implemented as `ControlledGate` when `annotated` is `False`, and as `AnnotatedOperation` when `annotated` is `True`.

<Admonition title="Deprecated since version 2.3" type="danger">
`qiskit.circuit.gate.Gate.control()`’s argument `annotated` is deprecated as of Qiskit 2.3. It will be removed in Qiskit 3.0. The method Gate.control() no longer accepts annotated=None. The new default is annotated=True, which represents the controlled gate as an AnnotatedOperation (unless a dedicated controlled-gate class already exists). You can explicitly set annotated=False to preserve the previous behavior. However, using annotated=True is recommended, as it defers construction of the controlled circuit to transpiler, and furthermore enables additional controlled-gate optimizations (typically leading to higher-quality circuits).
</Admonition>

**Parameters**

* **num\_ctrl\_qubits** (int)number of controls to add to gate (default: `1`)
* **label** (str | None)optional gate label. Ignored if implemented as an annotated operation.
* **ctrl\_state** (int | str | None)the control state in decimal or as a bitstring (e.g. `'111'`). If `None`, use `2**num_ctrl_qubits-1`.
* **annotated** (bool | None)indicates whether the controlled gate is implemented as an annotated gate. If `None`, this is set to `False` if the controlled gate can directly be constructed, and otherwise set to `True`. This allows defering the construction process in case the synthesis of the controlled gate requires more information (e.g. values of unbound parameters).
* **num\_ctrl\_qubits** ([`int`](https://docs.python.org/3/library/functions.html#int))Number of controls to add. Defaults to `1`.
* **label** ([`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))Optional gate label. Defaults to `None`. Ignored if the controlled gate is implemented as an annotated operation.
* **ctrl\_state** ([`int`](https://docs.python.org/3/library/functions.html#int) | [`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool) | [`None`](https://docs.python.org/3/library/constants.html#None))Indicates whether the controlled gate should be implemented as a controlled gate or as an annotated operation. If `None`, treated as `False`.

**Returns**

Controlled version of the given operation.
A controlled version of this gate.

**Raises**

**QiskitError** – unrecognized mode or invalid ctrl\_state
**QiskitError** – invalid `num_ctrl_qubits` or `ctrl_state`.
</Function>

### copy
Expand Down Expand Up @@ -250,7 +254,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock
### repeat

<Function id="qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock.repeat" signature="repeat(n)">
Creates an instruction with `self` repeated :math\`n\` times.
Creates an instruction with `self` repeated $n$ times.

**Parameters**

Expand Down
22 changes: 13 additions & 9 deletions docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.KAK

**Return type**

[`Iterable`](https://docs.python.org/3/library/typing.html#typing.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]
[`Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]

**Returns**

Expand All @@ -176,22 +176,26 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.KAK
<Function id="qiskit_addon_aqc_tensor.ansatz_generation.KAK.control" signature="control(num_ctrl_qubits=1, label=None, ctrl_state=None, annotated=None)">
Return the controlled version of itself.

Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`).
The controlled gate is implemented as `ControlledGate` when `annotated` is `False`, and as `AnnotatedOperation` when `annotated` is `True`.

<Admonition title="Deprecated since version 2.3" type="danger">
`qiskit.circuit.gate.Gate.control()`’s argument `annotated` is deprecated as of Qiskit 2.3. It will be removed in Qiskit 3.0. The method Gate.control() no longer accepts annotated=None. The new default is annotated=True, which represents the controlled gate as an AnnotatedOperation (unless a dedicated controlled-gate class already exists). You can explicitly set annotated=False to preserve the previous behavior. However, using annotated=True is recommended, as it defers construction of the controlled circuit to transpiler, and furthermore enables additional controlled-gate optimizations (typically leading to higher-quality circuits).
</Admonition>

**Parameters**

* **num\_ctrl\_qubits** (int)number of controls to add to gate (default: `1`)
* **label** (str | None)optional gate label. Ignored if implemented as an annotated operation.
* **ctrl\_state** (int | str | None)the control state in decimal or as a bitstring (e.g. `'111'`). If `None`, use `2**num_ctrl_qubits-1`.
* **annotated** (bool | None)indicates whether the controlled gate is implemented as an annotated gate. If `None`, this is set to `False` if the controlled gate can directly be constructed, and otherwise set to `True`. This allows defering the construction process in case the synthesis of the controlled gate requires more information (e.g. values of unbound parameters).
* **num\_ctrl\_qubits** ([`int`](https://docs.python.org/3/library/functions.html#int))Number of controls to add. Defaults to `1`.
* **label** ([`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))Optional gate label. Defaults to `None`. Ignored if the controlled gate is implemented as an annotated operation.
* **ctrl\_state** ([`int`](https://docs.python.org/3/library/functions.html#int) | [`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool) | [`None`](https://docs.python.org/3/library/constants.html#None))Indicates whether the controlled gate should be implemented as a controlled gate or as an annotated operation. If `None`, treated as `False`.

**Returns**

Controlled version of the given operation.
A controlled version of this gate.

**Raises**

**QiskitError** – unrecognized mode or invalid ctrl\_state
**QiskitError** – invalid `num_ctrl_qubits` or `ctrl_state`.
</Function>

### copy
Expand Down Expand Up @@ -266,7 +270,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.KAK
### repeat

<Function id="qiskit_addon_aqc_tensor.ansatz_generation.KAK.repeat" signature="repeat(n)">
Creates an instruction with `self` repeated :math\`n\` times.
Creates an instruction with `self` repeated $n$ times.

**Parameters**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock

**Return type**

[`Iterable`](https://docs.python.org/3/library/typing.html#typing.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]
[`Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]

**Returns**

Expand All @@ -162,22 +162,26 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock
<Function id="qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.control" signature="control(num_ctrl_qubits=1, label=None, ctrl_state=None, annotated=None)">
Return the controlled version of itself.

Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`).
The controlled gate is implemented as `ControlledGate` when `annotated` is `False`, and as `AnnotatedOperation` when `annotated` is `True`.

<Admonition title="Deprecated since version 2.3" type="danger">
`qiskit.circuit.gate.Gate.control()`’s argument `annotated` is deprecated as of Qiskit 2.3. It will be removed in Qiskit 3.0. The method Gate.control() no longer accepts annotated=None. The new default is annotated=True, which represents the controlled gate as an AnnotatedOperation (unless a dedicated controlled-gate class already exists). You can explicitly set annotated=False to preserve the previous behavior. However, using annotated=True is recommended, as it defers construction of the controlled circuit to transpiler, and furthermore enables additional controlled-gate optimizations (typically leading to higher-quality circuits).
</Admonition>

**Parameters**

* **num\_ctrl\_qubits** (int)number of controls to add to gate (default: `1`)
* **label** (str | None)optional gate label. Ignored if implemented as an annotated operation.
* **ctrl\_state** (int | str | None)the control state in decimal or as a bitstring (e.g. `'111'`). If `None`, use `2**num_ctrl_qubits-1`.
* **annotated** (bool | None)indicates whether the controlled gate is implemented as an annotated gate. If `None`, this is set to `False` if the controlled gate can directly be constructed, and otherwise set to `True`. This allows defering the construction process in case the synthesis of the controlled gate requires more information (e.g. values of unbound parameters).
* **num\_ctrl\_qubits** ([`int`](https://docs.python.org/3/library/functions.html#int))Number of controls to add. Defaults to `1`.
* **label** ([`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))Optional gate label. Defaults to `None`. Ignored if the controlled gate is implemented as an annotated operation.
* **ctrl\_state** ([`int`](https://docs.python.org/3/library/functions.html#int) | [`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool) | [`None`](https://docs.python.org/3/library/constants.html#None))Indicates whether the controlled gate should be implemented as a controlled gate or as an annotated operation. If `None`, treated as `False`.

**Returns**

Controlled version of the given operation.
A controlled version of this gate.

**Raises**

**QiskitError** – unrecognized mode or invalid ctrl\_state
**QiskitError** – invalid `num_ctrl_qubits` or `ctrl_state`.
</Function>

### copy
Expand Down Expand Up @@ -252,7 +256,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock
### repeat

<Function id="qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.repeat" signature="repeat(n)">
Creates an instruction with `self` repeated :math\`n\` times.
Creates an instruction with `self` repeated $n$ times.

**Parameters**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock

**Return type**

[`Iterable`](https://docs.python.org/3/library/typing.html#typing.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]
[`Iterable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`list`](https://docs.python.org/3/library/stdtypes.html#list), [`list`](https://docs.python.org/3/library/stdtypes.html#list)]]

**Returns**

Expand All @@ -162,22 +162,26 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock
<Function id="qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.control" signature="control(num_ctrl_qubits=1, label=None, ctrl_state=None, annotated=None)">
Return the controlled version of itself.

Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`).
The controlled gate is implemented as `ControlledGate` when `annotated` is `False`, and as `AnnotatedOperation` when `annotated` is `True`.

<Admonition title="Deprecated since version 2.3" type="danger">
`qiskit.circuit.gate.Gate.control()`’s argument `annotated` is deprecated as of Qiskit 2.3. It will be removed in Qiskit 3.0. The method Gate.control() no longer accepts annotated=None. The new default is annotated=True, which represents the controlled gate as an AnnotatedOperation (unless a dedicated controlled-gate class already exists). You can explicitly set annotated=False to preserve the previous behavior. However, using annotated=True is recommended, as it defers construction of the controlled circuit to transpiler, and furthermore enables additional controlled-gate optimizations (typically leading to higher-quality circuits).
</Admonition>

**Parameters**

* **num\_ctrl\_qubits** (int)number of controls to add to gate (default: `1`)
* **label** (str | None)optional gate label. Ignored if implemented as an annotated operation.
* **ctrl\_state** (int | str | None)the control state in decimal or as a bitstring (e.g. `'111'`). If `None`, use `2**num_ctrl_qubits-1`.
* **annotated** (bool | None)indicates whether the controlled gate is implemented as an annotated gate. If `None`, this is set to `False` if the controlled gate can directly be constructed, and otherwise set to `True`. This allows defering the construction process in case the synthesis of the controlled gate requires more information (e.g. values of unbound parameters).
* **num\_ctrl\_qubits** ([`int`](https://docs.python.org/3/library/functions.html#int))Number of controls to add. Defaults to `1`.
* **label** ([`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))Optional gate label. Defaults to `None`. Ignored if the controlled gate is implemented as an annotated operation.
* **ctrl\_state** ([`int`](https://docs.python.org/3/library/functions.html#int) | [`str`](https://docs.python.org/3/library/stdtypes.html#str) | [`None`](https://docs.python.org/3/library/constants.html#None))The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool) | [`None`](https://docs.python.org/3/library/constants.html#None))Indicates whether the controlled gate should be implemented as a controlled gate or as an annotated operation. If `None`, treated as `False`.

**Returns**

Controlled version of the given operation.
A controlled version of this gate.

**Raises**

**QiskitError** – unrecognized mode or invalid ctrl\_state
**QiskitError** – invalid `num_ctrl_qubits` or `ctrl_state`.
</Function>

### copy
Expand Down Expand Up @@ -252,7 +256,7 @@ python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock
### repeat

<Function id="qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.repeat" signature="repeat(n)">
Creates an instruction with `self` repeated :math\`n\` times.
Creates an instruction with `self` repeated $n$ times.

**Parameters**

Expand Down
Loading
Loading