From af0afaa60f8efa98002eaa03d16f1763e8a166c3 Mon Sep 17 00:00:00 2001 From: Becky Dimock Date: Thu, 14 May 2026 11:40:13 -0500 Subject: [PATCH 1/3] Set up Box link --- scripts/config/api-html-artifacts.json | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/config/api-html-artifacts.json b/scripts/config/api-html-artifacts.json index b4ef47fc1e6..9dae83389d6 100644 --- a/scripts/config/api-html-artifacts.json +++ b/scripts/config/api-html-artifacts.json @@ -90,6 +90,7 @@ "0.3": "https://ibm.box.com/shared/static/qiskfdazhq1dpxcl9b627x9yi60gncb4.zip" }, "qiskit-addon-aqc-tensor": { + "0.3": "https://ibm.box.com/shared/static/uzw1mzmypuqf2one830vdrvy27x2brvu.zip", "0.2": "https://ibm.box.com/shared/static/dhuyxtri674xvb3oky5rg019bd1a44hf.zip", "0.1": "https://ibm.box.com/shared/static/jnxlji7b6cguhbvp1txdi2vhym38wcnc.zip" }, From b0bf949e569ae9a985dccb614a39ee8a710e5de6 Mon Sep 17 00:00:00 2001 From: Becky Dimock Date: Thu, 14 May 2026 12:50:32 -0500 Subject: [PATCH 2/3] Save historical docs --- .../qiskit-addon-aqc-tensor/0.2/_package.json | 4 + .../api/qiskit-addon-aqc-tensor/0.2/_toc.json | 106 + .../0.2/ansatz-generation-ansatz-block.mdx | 406 +++ .../0.2/ansatz-generation-kak.mdx | 422 +++ ...satz-generation-one-qubit-ansatz-block.mdx | 408 +++ ...satz-generation-two-qubit-ansatz-block.mdx | 408 +++ .../0.2/ansatz-generation-zxz.mdx | 422 +++ .../0.2/ansatz-generation.mdx | 220 ++ .../api/qiskit-addon-aqc-tensor/0.2/index.mdx | 15 + .../qiskit-addon-aqc-tensor/0.2/objective.mdx | 128 + .../0.2/simulation-aer-qiskit-aer-mps.mdx | 37 + ...ion-aer-qiskit-aer-simulation-settings.mdx | 58 + .../0.2/simulation-aer.mdx | 35 + ...-quimb-qiskit-quimb-conversion-context.mdx | 22 + ...simulation-quimb-quimb-circuit-factory.mdx | 16 + .../0.2/simulation-quimb-quimb-simulator.mdx | 60 + .../0.2/simulation-quimb.mdx | 83 + .../0.2/simulation.mdx | 201 ++ .../qiskit-addon-aqc-tensor/0.2/objects.inv | Bin 0 -> 6628 bytes .../0.2/ansatz_generation-1.svg | 747 ++++++ .../0.2/ansatz_generation-2.svg | 1166 ++++++++ .../0.2/ansatz_generation-3.svg | 1030 +++++++ .../0.2/ansatz_generation-4.svg | 1956 ++++++++++++++ .../0.2/ansatz_generation-5.svg | 2377 +++++++++++++++++ .../0.2/ansatz_generation-6.svg | 747 ++++++ .../0.2/ansatz_generation-7.svg | 885 ++++++ .../0.2/ansatz_generation-8.svg | 747 ++++++ .../0.2/ansatz_generation-9.svg | 542 ++++ ...don_aqc_tensor-ansatz_generation-KAK-1.svg | 306 +++ ...don_aqc_tensor-ansatz_generation-KAK-2.svg | 635 +++++ ...don_aqc_tensor-ansatz_generation-ZXZ-1.svg | 271 ++ ...don_aqc_tensor-ansatz_generation-ZXZ-2.svg | 338 +++ .../config/historical-pages-to-latest.json | 3 +- 33 files changed, 14800 insertions(+), 1 deletion(-) create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/_package.json create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/_toc.json create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-ansatz-block.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-kak.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-one-qubit-ansatz-block.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-two-qubit-ansatz-block.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-zxz.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/index.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/objective.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-mps.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-simulation-settings.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-qiskit-quimb-conversion-context.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-circuit-factory.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-simulator.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb.mdx create mode 100644 docs/api/qiskit-addon-aqc-tensor/0.2/simulation.mdx create mode 100644 public/docs/api/qiskit-addon-aqc-tensor/0.2/objects.inv create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-1.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-2.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-3.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-4.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-5.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-6.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-7.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-8.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-9.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg create mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/_package.json b/docs/api/qiskit-addon-aqc-tensor/0.2/_package.json new file mode 100644 index 00000000000..a08b147e6d6 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/_package.json @@ -0,0 +1,4 @@ +{ + "name": "qiskit-addon-aqc-tensor", + "version": "0.2.0" +} diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/_toc.json b/docs/api/qiskit-addon-aqc-tensor/0.2/_toc.json new file mode 100644 index 00000000000..9c547764d03 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/_toc.json @@ -0,0 +1,106 @@ +{ + "title": "Approximate quantum compilation (AQC-Tensor)", + "children": [ + { + "title": "API index", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2" + }, + { + "title": "Release notes", + "useDivider": true, + "url": "/docs/api/qiskit-addon-aqc-tensor/release-notes" + }, + { + "title": "qiskit_addon_aqc_tensor.ansatz_generation", + "untranslatable": true, + "children": [ + { + "title": "Module overview", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation" + }, + { + "title": "AnsatzBlock", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-ansatz-block", + "untranslatable": true + }, + { + "title": "KAK", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-kak", + "untranslatable": true + }, + { + "title": "OneQubitAnsatzBlock", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-one-qubit-ansatz-block", + "untranslatable": true + }, + { + "title": "TwoQubitAnsatzBlock", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-two-qubit-ansatz-block", + "untranslatable": true + }, + { + "title": "ZXZ", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-zxz", + "untranslatable": true + } + ] + }, + { + "title": "qiskit_addon_aqc_tensor.objective", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/objective", + "untranslatable": true + }, + { + "title": "qiskit_addon_aqc_tensor.simulation", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation", + "untranslatable": true + }, + { + "title": "qiskit_addon_aqc_tensor.simulation.aer", + "untranslatable": true, + "children": [ + { + "title": "Module overview", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer" + }, + { + "title": "QiskitAerMPS", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-mps", + "untranslatable": true + }, + { + "title": "QiskitAerSimulationSettings", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-simulation-settings", + "untranslatable": true + } + ] + }, + { + "title": "qiskit_addon_aqc_tensor.simulation.quimb", + "untranslatable": true, + "children": [ + { + "title": "Module overview", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb" + }, + { + "title": "QiskitQuimbConversionContext", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-qiskit-quimb-conversion-context", + "untranslatable": true + }, + { + "title": "QuimbCircuitFactory", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-circuit-factory", + "untranslatable": true + }, + { + "title": "QuimbSimulator", + "url": "/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-simulator", + "untranslatable": true + } + ] + } + ], + "collapsed": true, + "untranslatable": true +} diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-ansatz-block.mdx new file mode 100644 index 00000000000..26b87513104 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-ansatz-block.mdx @@ -0,0 +1,406 @@ +--- +title: AnsatzBlock (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock +--- + +# AnsatzBlock + + + Bases: [`Gate`](/docs/api/qiskit/qiskit.circuit.Gate) + + 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"). + + Initialize the ansatz block. + + **Parameters** + + **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. + + ## 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_addon_aqc_tensor.ansatz_generation.AnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock.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` 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. + + + ### condition + + + The classical condition on the instruction. + + + The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### condition\_bits + + + Get Clbits in condition. + + + The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### decompositions + + + Get the decompositions of the instruction from the SessionEquivalenceLibrary. + + + ### definition + + + Return definition in terms of other basic gates. + + + ### duration + + + Get the duration. + + + The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ### 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 + + + Return the name. + + + ### num\_clbits + + + Return the number of clbits. + + + ### num\_qubits + + + Return the number of qubits. + + + ### params + + + The parameters of this `Instruction`. Ideally these will be gate angles. + + + ### unit + + + Get the time unit of duration. + + + The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ## Methods + + ### add\_decomposition + + + Add a decomposition of the instruction to the SessionEquivalenceLibrary. + + + ### assemble + + + Assemble a QasmQobjInstruction + + + The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. + + + + ### broadcast\_arguments + + + Validation and handling of the arguments and its relationship. + + For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: + + ```python + in: [[q[0],q[1]], q[2]],[] + outs: [q[0], q[2]], [] + [q[1], q[2]], [] + ``` + + The general broadcasting rules are: + + > * If len(qargs) == 1: + > + > ```python + > [q[0], q[1]] -> [q[0]],[q[1]] + > ``` + > + > * If len(qargs) == 2: + > + > ```python + > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] + > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] + > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] + > ``` + > + > * If len(qargs) >= 3: + > + > ```python + > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] + > ``` + + **Parameters** + + * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. + * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. + + **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)]] + + **Returns** + + A tuple with single arguments. + + **Raises** + + **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. + + + ### c\_if + + + Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. + + + This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. + + + + The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### control + + + Return the controlled version of itself. + + Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). + + **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). + + **Returns** + + Controlled version of the given operation. + + **Raises** + + **QiskitError** – unrecognized mode or invalid ctrl\_state + + + ### copy + + + Copy of the instruction. + + **Parameters** + + **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. + + **Returns** + + a copy of the current instruction, with the name updated if it was provided + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### inverse + + + Invert this instruction. + + If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. + + If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. + + Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. + + **Parameters** + + **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. + + **Returns** + + The inverse operation. + + **Raises** + + **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. + + + ### is\_parameterized + + + Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). + + + ### power + + + Raise this gate to the power of `exponent`. + + Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. + + **Parameters** + + * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to + * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. + + **Returns** + + An operation implementing `gate^exponent` + + **Raises** + + **CircuitError** – If gate is not unitary + + + ### repeat + + + Creates an instruction with `self` repeated :math\`n\` times. + + If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. + + **Parameters** + + **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction + + **Returns** + + Containing the definition. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + **Raises** + + **CircuitError** – If n \< 1. + + + ### reverse\_ops + + + For a composite instruction, reverse the order of sub-instructions. + + This is done by recursively reversing all sub-instructions. It does not invert any gate. + + **Returns** + + **a new instruction with** + + sub-instructions reversed. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### soft\_compare + + + Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. + + **Parameters** + + **other** (*instruction*) – other instruction. + + **Returns** + + are self and other equal up to parameter expressions. + + **Return type** + + [bool](https://docs.python.org/3/library/functions.html#bool) + + + ### to\_matrix + + + Return a Numpy.array for the gate unitary matrix. + + **Returns** + + if the Gate subclass has a matrix definition. + + **Return type** + + np.ndarray + + **Raises** + + **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. + + + ### to\_mutable + + + Return a mutable copy of this gate. + + This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. + + + ### validate\_parameter + + + Gate parameters should be int, float, or ParameterExpression + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-kak.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-kak.mdx new file mode 100644 index 00000000000..1e0cb3b8b43 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-kak.mdx @@ -0,0 +1,422 @@ +--- +title: KAK (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.KAK in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.KAK +--- + +# KAK + + + Bases: [`TwoQubitAnsatzBlock`](ansatz-generation-two-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.TwoQubitAnsatzBlock") + + Two-qubit ansatz block based on the KAK decomposition. + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg) + + The above KAK block is equivalent to the following circuit: + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg) + + Initialize the ansatz block. + + **Parameters** + + **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. + + ## Attributes + + ### ansatz\_name + + + + ### ansatz\_num\_params + + + + ### ansatz\_num\_qubits + + + + ### 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_addon_aqc_tensor.ansatz_generation.KAK.base_class "qiskit_addon_aqc_tensor.ansatz_generation.KAK.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` 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. + + + ### condition + + + The classical condition on the instruction. + + + The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### condition\_bits + + + Get Clbits in condition. + + + The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### decompositions + + + Get the decompositions of the instruction from the SessionEquivalenceLibrary. + + + ### definition + + + Return definition in terms of other basic gates. + + + ### duration + + + Get the duration. + + + The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ### 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 + + + Return the name. + + + ### num\_clbits + + + Return the number of clbits. + + + ### num\_qubits + + + Return the number of qubits. + + + ### params + + + The parameters of this `Instruction`. Ideally these will be gate angles. + + + ### unit + + + Get the time unit of duration. + + + The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ## Methods + + ### add\_decomposition + + + Add a decomposition of the instruction to the SessionEquivalenceLibrary. + + + ### assemble + + + Assemble a QasmQobjInstruction + + + The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. + + + + ### broadcast\_arguments + + + Validation and handling of the arguments and its relationship. + + For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: + + ```python + in: [[q[0],q[1]], q[2]],[] + outs: [q[0], q[2]], [] + [q[1], q[2]], [] + ``` + + The general broadcasting rules are: + + > * If len(qargs) == 1: + > + > ```python + > [q[0], q[1]] -> [q[0]],[q[1]] + > ``` + > + > * If len(qargs) == 2: + > + > ```python + > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] + > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] + > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] + > ``` + > + > * If len(qargs) >= 3: + > + > ```python + > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] + > ``` + + **Parameters** + + * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. + * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. + + **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)]] + + **Returns** + + A tuple with single arguments. + + **Raises** + + **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. + + + ### c\_if + + + Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. + + + This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. + + + + The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### control + + + Return the controlled version of itself. + + Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). + + **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). + + **Returns** + + Controlled version of the given operation. + + **Raises** + + **QiskitError** – unrecognized mode or invalid ctrl\_state + + + ### copy + + + Copy of the instruction. + + **Parameters** + + **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. + + **Returns** + + a copy of the current instruction, with the name updated if it was provided + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### inverse + + + Invert this instruction. + + If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. + + If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. + + Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. + + **Parameters** + + **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. + + **Returns** + + The inverse operation. + + **Raises** + + **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. + + + ### is\_parameterized + + + Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). + + + ### power + + + Raise this gate to the power of `exponent`. + + Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. + + **Parameters** + + * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to + * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. + + **Returns** + + An operation implementing `gate^exponent` + + **Raises** + + **CircuitError** – If gate is not unitary + + + ### repeat + + + Creates an instruction with `self` repeated :math\`n\` times. + + If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. + + **Parameters** + + **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction + + **Returns** + + Containing the definition. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + **Raises** + + **CircuitError** – If n \< 1. + + + ### reverse\_ops + + + For a composite instruction, reverse the order of sub-instructions. + + This is done by recursively reversing all sub-instructions. It does not invert any gate. + + **Returns** + + **a new instruction with** + + sub-instructions reversed. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### soft\_compare + + + Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. + + **Parameters** + + **other** (*instruction*) – other instruction. + + **Returns** + + are self and other equal up to parameter expressions. + + **Return type** + + [bool](https://docs.python.org/3/library/functions.html#bool) + + + ### to\_matrix + + + Return a Numpy.array for the gate unitary matrix. + + **Returns** + + if the Gate subclass has a matrix definition. + + **Return type** + + np.ndarray + + **Raises** + + **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. + + + ### to\_mutable + + + Return a mutable copy of this gate. + + This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. + + + ### validate\_parameter + + + Gate parameters should be int, float, or ParameterExpression + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-one-qubit-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-one-qubit-ansatz-block.mdx new file mode 100644 index 00000000000..31ec9c3d893 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-one-qubit-ansatz-block.mdx @@ -0,0 +1,408 @@ +--- +title: OneQubitAnsatzBlock (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock +--- + +# OneQubitAnsatzBlock + + + Bases: [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.AnsatzBlock") + + One-qubit ansatz block. + + Initialize the ansatz block. + + **Parameters** + + **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. + + ## Attributes + + ### ansatz\_num\_qubits + + + + ### 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_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.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` 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. + + + ### condition + + + The classical condition on the instruction. + + + The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### condition\_bits + + + Get Clbits in condition. + + + The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### decompositions + + + Get the decompositions of the instruction from the SessionEquivalenceLibrary. + + + ### definition + + + Return definition in terms of other basic gates. + + + ### duration + + + Get the duration. + + + The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ### 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 + + + Return the name. + + + ### num\_clbits + + + Return the number of clbits. + + + ### num\_qubits + + + Return the number of qubits. + + + ### params + + + The parameters of this `Instruction`. Ideally these will be gate angles. + + + ### unit + + + Get the time unit of duration. + + + The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ## Methods + + ### add\_decomposition + + + Add a decomposition of the instruction to the SessionEquivalenceLibrary. + + + ### assemble + + + Assemble a QasmQobjInstruction + + + The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. + + + + ### broadcast\_arguments + + + Validation and handling of the arguments and its relationship. + + For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: + + ```python + in: [[q[0],q[1]], q[2]],[] + outs: [q[0], q[2]], [] + [q[1], q[2]], [] + ``` + + The general broadcasting rules are: + + > * If len(qargs) == 1: + > + > ```python + > [q[0], q[1]] -> [q[0]],[q[1]] + > ``` + > + > * If len(qargs) == 2: + > + > ```python + > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] + > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] + > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] + > ``` + > + > * If len(qargs) >= 3: + > + > ```python + > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] + > ``` + + **Parameters** + + * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. + * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. + + **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)]] + + **Returns** + + A tuple with single arguments. + + **Raises** + + **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. + + + ### c\_if + + + Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. + + + This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. + + + + The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### control + + + Return the controlled version of itself. + + Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). + + **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). + + **Returns** + + Controlled version of the given operation. + + **Raises** + + **QiskitError** – unrecognized mode or invalid ctrl\_state + + + ### copy + + + Copy of the instruction. + + **Parameters** + + **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. + + **Returns** + + a copy of the current instruction, with the name updated if it was provided + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### inverse + + + Invert this instruction. + + If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. + + If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. + + Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. + + **Parameters** + + **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. + + **Returns** + + The inverse operation. + + **Raises** + + **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. + + + ### is\_parameterized + + + Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). + + + ### power + + + Raise this gate to the power of `exponent`. + + Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. + + **Parameters** + + * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to + * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. + + **Returns** + + An operation implementing `gate^exponent` + + **Raises** + + **CircuitError** – If gate is not unitary + + + ### repeat + + + Creates an instruction with `self` repeated :math\`n\` times. + + If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. + + **Parameters** + + **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction + + **Returns** + + Containing the definition. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + **Raises** + + **CircuitError** – If n \< 1. + + + ### reverse\_ops + + + For a composite instruction, reverse the order of sub-instructions. + + This is done by recursively reversing all sub-instructions. It does not invert any gate. + + **Returns** + + **a new instruction with** + + sub-instructions reversed. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### soft\_compare + + + Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. + + **Parameters** + + **other** (*instruction*) – other instruction. + + **Returns** + + are self and other equal up to parameter expressions. + + **Return type** + + [bool](https://docs.python.org/3/library/functions.html#bool) + + + ### to\_matrix + + + Return a Numpy.array for the gate unitary matrix. + + **Returns** + + if the Gate subclass has a matrix definition. + + **Return type** + + np.ndarray + + **Raises** + + **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. + + + ### to\_mutable + + + Return a mutable copy of this gate. + + This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. + + + ### validate\_parameter + + + Gate parameters should be int, float, or ParameterExpression + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-two-qubit-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-two-qubit-ansatz-block.mdx new file mode 100644 index 00000000000..631387b7b53 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-two-qubit-ansatz-block.mdx @@ -0,0 +1,408 @@ +--- +title: TwoQubitAnsatzBlock (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock +--- + +# TwoQubitAnsatzBlock + + + Bases: [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.AnsatzBlock") + + Two-qubit ansatz block. + + Initialize the ansatz block. + + **Parameters** + + **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. + + ## Attributes + + ### ansatz\_num\_qubits + + + + ### 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_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.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` 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. + + + ### condition + + + The classical condition on the instruction. + + + The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### condition\_bits + + + Get Clbits in condition. + + + The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### decompositions + + + Get the decompositions of the instruction from the SessionEquivalenceLibrary. + + + ### definition + + + Return definition in terms of other basic gates. + + + ### duration + + + Get the duration. + + + The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ### 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 + + + Return the name. + + + ### num\_clbits + + + Return the number of clbits. + + + ### num\_qubits + + + Return the number of qubits. + + + ### params + + + The parameters of this `Instruction`. Ideally these will be gate angles. + + + ### unit + + + Get the time unit of duration. + + + The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ## Methods + + ### add\_decomposition + + + Add a decomposition of the instruction to the SessionEquivalenceLibrary. + + + ### assemble + + + Assemble a QasmQobjInstruction + + + The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. + + + + ### broadcast\_arguments + + + Validation and handling of the arguments and its relationship. + + For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: + + ```python + in: [[q[0],q[1]], q[2]],[] + outs: [q[0], q[2]], [] + [q[1], q[2]], [] + ``` + + The general broadcasting rules are: + + > * If len(qargs) == 1: + > + > ```python + > [q[0], q[1]] -> [q[0]],[q[1]] + > ``` + > + > * If len(qargs) == 2: + > + > ```python + > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] + > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] + > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] + > ``` + > + > * If len(qargs) >= 3: + > + > ```python + > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] + > ``` + + **Parameters** + + * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. + * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. + + **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)]] + + **Returns** + + A tuple with single arguments. + + **Raises** + + **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. + + + ### c\_if + + + Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. + + + This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. + + + + The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### control + + + Return the controlled version of itself. + + Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). + + **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). + + **Returns** + + Controlled version of the given operation. + + **Raises** + + **QiskitError** – unrecognized mode or invalid ctrl\_state + + + ### copy + + + Copy of the instruction. + + **Parameters** + + **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. + + **Returns** + + a copy of the current instruction, with the name updated if it was provided + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### inverse + + + Invert this instruction. + + If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. + + If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. + + Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. + + **Parameters** + + **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. + + **Returns** + + The inverse operation. + + **Raises** + + **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. + + + ### is\_parameterized + + + Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). + + + ### power + + + Raise this gate to the power of `exponent`. + + Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. + + **Parameters** + + * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to + * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. + + **Returns** + + An operation implementing `gate^exponent` + + **Raises** + + **CircuitError** – If gate is not unitary + + + ### repeat + + + Creates an instruction with `self` repeated :math\`n\` times. + + If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. + + **Parameters** + + **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction + + **Returns** + + Containing the definition. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + **Raises** + + **CircuitError** – If n \< 1. + + + ### reverse\_ops + + + For a composite instruction, reverse the order of sub-instructions. + + This is done by recursively reversing all sub-instructions. It does not invert any gate. + + **Returns** + + **a new instruction with** + + sub-instructions reversed. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### soft\_compare + + + Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. + + **Parameters** + + **other** (*instruction*) – other instruction. + + **Returns** + + are self and other equal up to parameter expressions. + + **Return type** + + [bool](https://docs.python.org/3/library/functions.html#bool) + + + ### to\_matrix + + + Return a Numpy.array for the gate unitary matrix. + + **Returns** + + if the Gate subclass has a matrix definition. + + **Return type** + + np.ndarray + + **Raises** + + **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. + + + ### to\_mutable + + + Return a mutable copy of this gate. + + This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. + + + ### validate\_parameter + + + Gate parameters should be int, float, or ParameterExpression + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-zxz.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-zxz.mdx new file mode 100644 index 00000000000..39cfe5b7b0d --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation-zxz.mdx @@ -0,0 +1,422 @@ +--- +title: ZXZ (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.ZXZ in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.ZXZ +--- + +# ZXZ + + + Bases: [`OneQubitAnsatzBlock`](ansatz-generation-one-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.OneQubitAnsatzBlock") + + One-qubit ansatz block based on the ZXZ decomposition. + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg) + + The above ZXZ block is equivalent to the following circuit: + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg) + + Initialize the ansatz block. + + **Parameters** + + **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. + + ## Attributes + + ### ansatz\_name + + + + ### ansatz\_num\_params + + + + ### ansatz\_num\_qubits + + + + ### 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_addon_aqc_tensor.ansatz_generation.ZXZ.base_class "qiskit_addon_aqc_tensor.ansatz_generation.ZXZ.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` 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. + + + ### condition + + + The classical condition on the instruction. + + + The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### condition\_bits + + + Get Clbits in condition. + + + The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### decompositions + + + Get the decompositions of the instruction from the SessionEquivalenceLibrary. + + + ### definition + + + Return definition in terms of other basic gates. + + + ### duration + + + Get the duration. + + + The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ### 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 + + + Return the name. + + + ### num\_clbits + + + Return the number of clbits. + + + ### num\_qubits + + + Return the number of qubits. + + + ### params + + + The parameters of this `Instruction`. Ideally these will be gate angles. + + + ### unit + + + Get the time unit of duration. + + + The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. + + + + ## Methods + + ### add\_decomposition + + + Add a decomposition of the instruction to the SessionEquivalenceLibrary. + + + ### assemble + + + Assemble a QasmQobjInstruction + + + The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. + + + + ### broadcast\_arguments + + + Validation and handling of the arguments and its relationship. + + For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: + + ```python + in: [[q[0],q[1]], q[2]],[] + outs: [q[0], q[2]], [] + [q[1], q[2]], [] + ``` + + The general broadcasting rules are: + + > * If len(qargs) == 1: + > + > ```python + > [q[0], q[1]] -> [q[0]],[q[1]] + > ``` + > + > * If len(qargs) == 2: + > + > ```python + > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] + > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] + > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] + > ``` + > + > * If len(qargs) >= 3: + > + > ```python + > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] + > ``` + + **Parameters** + + * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. + * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. + + **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)]] + + **Returns** + + A tuple with single arguments. + + **Raises** + + **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. + + + ### c\_if + + + Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. + + + This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. + + + + The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. + + + + ### control + + + Return the controlled version of itself. + + Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). + + **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). + + **Returns** + + Controlled version of the given operation. + + **Raises** + + **QiskitError** – unrecognized mode or invalid ctrl\_state + + + ### copy + + + Copy of the instruction. + + **Parameters** + + **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. + + **Returns** + + a copy of the current instruction, with the name updated if it was provided + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### inverse + + + Invert this instruction. + + If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. + + If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. + + Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. + + **Parameters** + + **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. + + **Returns** + + The inverse operation. + + **Raises** + + **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. + + + ### is\_parameterized + + + Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). + + + ### power + + + Raise this gate to the power of `exponent`. + + Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. + + **Parameters** + + * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to + * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. + + **Returns** + + An operation implementing `gate^exponent` + + **Raises** + + **CircuitError** – If gate is not unitary + + + ### repeat + + + Creates an instruction with `self` repeated :math\`n\` times. + + If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. + + **Parameters** + + **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction + + **Returns** + + Containing the definition. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + **Raises** + + **CircuitError** – If n \< 1. + + + ### reverse\_ops + + + For a composite instruction, reverse the order of sub-instructions. + + This is done by recursively reversing all sub-instructions. It does not invert any gate. + + **Returns** + + **a new instruction with** + + sub-instructions reversed. + + **Return type** + + [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) + + + ### soft\_compare + + + Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. + + **Parameters** + + **other** (*instruction*) – other instruction. + + **Returns** + + are self and other equal up to parameter expressions. + + **Return type** + + [bool](https://docs.python.org/3/library/functions.html#bool) + + + ### to\_matrix + + + Return a Numpy.array for the gate unitary matrix. + + **Returns** + + if the Gate subclass has a matrix definition. + + **Return type** + + np.ndarray + + **Raises** + + **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. + + + ### to\_mutable + + + Return a mutable copy of this gate. + + This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. + + + ### validate\_parameter + + + Gate parameters should be int, float, or ParameterExpression + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation.mdx new file mode 100644 index 00000000000..29a7bd5f48c --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/ansatz-generation.mdx @@ -0,0 +1,220 @@ +--- +title: ansatz_generation (v0.2) +description: API reference for qiskit_addon_aqc_tensor.ansatz_generation in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: qiskit_addon_aqc_tensor.ansatz_generation +--- + + + + + +# Ansatz generation + +`qiskit_addon_aqc_tensor.ansatz_generation` + +Tools for generating ansatz circuits. + +| | | +| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | +| [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock") | Ansatz block. | +| [`OneQubitAnsatzBlock`](ansatz-generation-one-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock") | One-qubit ansatz block. | +| [`TwoQubitAnsatzBlock`](ansatz-generation-two-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock") | Two-qubit ansatz block. | +| [`ZXZ`](ansatz-generation-zxz "qiskit_addon_aqc_tensor.ansatz_generation.ZXZ") | One-qubit ansatz block based on the ZXZ decomposition. | +| [`KAK`](ansatz-generation-kak "qiskit_addon_aqc_tensor.ansatz_generation.KAK") | Two-qubit ansatz block based on the KAK decomposition. | + +### generate\_ansatz\_from\_circuit + + + Generate an ansatz from the two-qubit connectivity structure of a circuit. + + See the [explanatatory material](https://qiskit.github.io/qiskit-addon-aqc-tensor/explanation/index.html#ansatz-generation-motivation) for motivation. + + **Parameters** + + * **qc** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – A circuit, which is assumed to be unitary. Barriers are ignored. + * **qubits\_initially\_zero** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – If `True`, the first Z rotation on each qubit is fixed to zero because such a rotation has no effect on the state $|0\rangle$. + * **parameter\_name** ([`str`](https://docs.python.org/3/library/stdtypes.html#str)) – Name for the [`ParameterVector`](/docs/api/qiskit/qiskit.circuit.ParameterVector) representing the free parameters in the returned ansatz circuit. + + **Return type** + + [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit), [`list`](https://docs.python.org/3/library/stdtypes.html#list)\[[`float`](https://docs.python.org/3/library/functions.html#float)]] + + **Returns** + + `(ansatz, parameter_values)` such that `ansatz.assign_parameters(parameter_values)` is equivalent to `qc` up to a global phase. + + #### Example: + + Consider the following circuit as an example: + + ```python + from qiskit import QuantumCircuit + + qc = QuantumCircuit(6) + qc.rx(0.4, 0) + qc.ryy(0.2, 2, 3) + qc.h(2) + qc.rz(0.1, 2) + qc.rxx(0.3, 0, 1) + qc.rzz(0.3, 0, 1) + qc.cx(2, 1) + qc.s(1) + qc.h(4) + qc.draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-1.svg) + + If the above circuit is passed to [`generate_ansatz_from_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit"), it will return an ansatz with parametrized two-qubit KAK rotations in the same locations as the input: + + ```python + from qiskit_addon_aqc_tensor import generate_ansatz_from_circuit + + ansatz, initial_params = generate_ansatz_from_circuit( + qc, qubits_initially_zero=True, parameter_name="x" + ) + ansatz.draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-2.svg) + + Note that in the generated ansatz, all consecutive single-qubit gates are collapsed into the same ZXZ block, and all consecutive two-qubit gates are collapsed into a single KAK block, up to single-qubit rotations. + + Further, the [`generate_ansatz_from_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit") function provides parameters which, when bound to the ansatz, will result in a circuit equivalent to the original one, up to a global phase: + + ```python + ansatz.assign_parameters(initial_params).draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-3.svg) + + A 1D Trotter circuit leads to a similar result, with its characteristic brickwork structure: + + ```python + from rustworkx.generators import path_graph + from qiskit.synthesis import SuzukiTrotter + from qiskit_addon_utils.problem_generators import generate_time_evolution_circuit, generate_xyz_hamiltonian + + hamiltonian = generate_xyz_hamiltonian( + path_graph(6), + coupling_constants=(0.0, 0.0, 1.0), + ext_magnetic_field=(0.4, 0.0, 0.0), + ) + + good_circuit = generate_time_evolution_circuit( + hamiltonian, + synthesis=SuzukiTrotter(reps=2), + time=1.0, + ) + + good_circuit.draw("mpl", initial_state=True) + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-4.svg) + + ```python + from qiskit_addon_aqc_tensor import generate_ansatz_from_circuit + + ansatz, initial_params = generate_ansatz_from_circuit( + good_circuit, qubits_initially_zero=True, parameter_name="x" + ) + ansatz.assign_parameters(initial_params).draw("mpl", initial_state=True) + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-5.svg) + + +### parametrize\_circuit + + + Create a parametrized version of a circuit. + + Given a quantum circuit, constructs another quantum circuit which is identical except that any gates with numerical parameters are replaced by gates (of the same type) with free parameters. The new circuit is returned along with a list containing the original values of the parameters. + + **Parameters** + + * **qc** (QuantumCircuit) – The quantum circuit to parametrize. + * **parameter\_name** (str) – Name for the [`ParameterVector`](/docs/api/qiskit/qiskit.circuit.ParameterVector) representing the free parameters in the returned ansatz circuit. + + **Return type** + + tuple\[QuantumCircuit, list\[float | None]] + + **Returns** + + `(ansatz, parameter_values)` such that `ansatz.assign_parameters(parameter_values)` is identical to `qc` as long as `qc` did not already contain parameters. If `qc` already had parameters, then `parameter_values` will contain `None` at the entries corresponding to those parameters. + + + + #### Example: + + Consider the following circuit as an example: + + ```python + from qiskit import QuantumCircuit + + qc = QuantumCircuit(6) + qc.rx(0.4, 0) + qc.ryy(0.2, 2, 3) + qc.h(2) + qc.rz(0.1, 2) + qc.rxx(0.3, 0, 1) + qc.rzz(0.3, 0, 1) + qc.cx(2, 1) + qc.s(1) + qc.h(4) + qc.draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-6.svg) + + If the above circuit is passed to [`parametrize_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit "qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit"), it will return an ansatz obtained from this circuit by replacing numerical parameters with free parameters: + + ```python + from qiskit_addon_aqc_tensor import parametrize_circuit + + ansatz, initial_params = parametrize_circuit(qc) + ansatz.draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-7.svg) + + Further, the [`parametrize_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit "qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit") function provides parameters which, when bound to the ansatz, will result in a circuit identical to the original one: + + ```python + ansatz.assign_parameters(initial_params).draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-8.svg) + + If the original circuit already contained parameters, then the returned parameter values will contain `None` at the entries corresponding to those parameters, and the preceding code will not work. The following example shows how to recover the original circuit in this case. + + ```python + from qiskit.circuit import Parameter + + qc = QuantumCircuit(3) + alpha1 = Parameter("alpha1") + alpha2 = Parameter("alpha2") + qc.ry(alpha1, [0]) + qc.rz(0.1, [0]) + qc.ry(alpha2, [1]) + qc.rz(alpha1, [1]) + qc.ry(0.2, [2]) + qc.rz(0.3, [2]) + ansatz, initial_params = parametrize_circuit(qc) + ansatz.assign_parameters( + { + param: val + for param, val in zip(ansatz.parameters, initial_params) + if val is not None + }, + inplace=True, + ) + ansatz.draw("mpl") + ``` + + ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-9.svg) + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/index.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/index.mdx new file mode 100644 index 00000000000..77ae0f23ac1 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/index.mdx @@ -0,0 +1,15 @@ +--- +title: Approximate quantum compilation (AQC-Tensor) API documentation (v0.2) +description: Index of all the modules in qiskit-addon-aqc-tensor v0.2. +--- + + + +# `qiskit-addon-aqc-tensor` API Reference + +* [Ansatz generation (`qiskit_addon_aqc_tensor.ansatz_generation`)](ansatz-generation) +* [Objective function(s) (`qiskit_addon_aqc_tensor.objective`)](objective) +* [Tensor network simulation (`qiskit_addon_aqc_tensor.simulation`)](simulation) +* [Aer simulation backend (`qiskit_addon_aqc_tensor.simulation.aer`)](simulation-aer) +* [Quimb simulation backend (`qiskit_addon_aqc_tensor.simulation.quimb`)](simulation-quimb) + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/objective.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/objective.mdx new file mode 100644 index 00000000000..26a01296b53 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/objective.mdx @@ -0,0 +1,128 @@ +--- +title: objective (v0.2) +description: API reference for qiskit_addon_aqc_tensor.objective in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: qiskit_addon_aqc_tensor.objective +--- + + + + + +# Objective function(s) + +`qiskit_addon_aqc_tensor.objective` + +Code for building and evaluating objective functions used for AQC parameter optimization. + +Currently, this module provides the simplest possible objective function, [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity"). + +### MaximizeStateFidelity + + + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) + + Simplest possible objective function for use with AQC-Tensor. + + Its definition is given by Eq. (7) in [arXiv:2301.08609v6](https://arxiv.org/abs/2301.08609v6): + +$$ +C = 1 - \left| \langle 0 | V^{\dagger}(\vec\theta) | \psi_\mathrm{target} \rangle \right|^2 . +$$ + + Minimizing this function is equivalent to maximizing the pure-state fidelity between the state prepared by the ansatz circuit at the current parameter point, $V(\vec\theta) |0\rangle$, and the target state, $| \psi_\mathrm{target} \rangle$. + + When called with an [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) of parameters, this object will return `(objective_value, gradient)` as a `tuple[float, numpy.ndarray]`. + + Initialize the objective function. + + **Parameters** + + * **ansatz** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – Parametrized ansatz circuit. + * **target** ([`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – Target state in tensor-network representation. + * **settings** ([`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) – Tensor network simulation settings. + + #### loss\_function + + + Evaluate `(objective_value, gradient)` of function at point `x`. + + **Return type** + + [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] + + **Parameters** + + **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) + + + #### target + + + Target tensor network. + + + +### OneMinusFidelity + + + Bases: [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity") + + DEPRECATED objective function, equivalent to [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity"). + + Initialize the objective function. + + The [`OneMinusFidelity`](#qiskit_addon_aqc_tensor.objective.OneMinusFidelity "qiskit_addon_aqc_tensor.objective.OneMinusFidelity") class is DEPRECATED since v0.2. Please migrate to [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity") as soon as possible. + + + The class `qiskit_addon_aqc_tensor.objective.OneMinusFidelity` is deprecated as of qiskit-addon-aqc-tensor 0.2.0. It will be removed no earlier than v0.4.0. This class has been renamed to `MaximizeStateFidelity`. + + + **Parameters** + + * **ansatz** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – Parametrized ansatz circuit. + * **target** ([`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – Target state in tensor-network representation. + * **settings** ([`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) – Tensor network simulation settings. + + #### \_\_call\_\_ + + + Evaluate `(objective_value, gradient)` of function at point `x`. + + This method is DEPRECATED since v0.2. The [`loss_function()`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function") method should be called instead. + + **Return type** + + [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] + + **Parameters** + + **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) + + + The method `qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.__call__()` is deprecated as of qiskit-addon-aqc-tensor 0.2.0. It will be removed no earlier than v0.4.0. Going forward, the `loss_function` method should be called instead of calling the instance directly. + + + + #### loss\_function + + + Evaluate `(objective_value, gradient)` of function at point `x`. + + **Return type** + + [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] + + **Parameters** + + **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) + + + #### target + + + Target tensor network. + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-mps.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-mps.mdx new file mode 100644 index 00000000000..d4bc0eb1143 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-mps.mdx @@ -0,0 +1,37 @@ +--- +title: QiskitAerMPS (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS +--- + +# QiskitAerMPS + + + Bases: [`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + Qiskit Aer representation of a matrix-product state. + + This form of a matrix-product state was introduced in the original time-evolving block decimation (TEBD) paper, [https://arxiv.org/abs/quant-ph/0301063](https://arxiv.org/abs/quant-ph/0301063). See Sec. 7.3.2 of [https://arxiv.org/abs/1008.3477v2](https://arxiv.org/abs/1008.3477v2) for more details on the relationship with other MPS representations. + + ## Attributes + + **Parameters** + + * **gamma** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*,* [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*]]*) + * **lamb** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*]*) + + ### gamma + + + Gamma matrices (list of 2-tuples of ndarrays, one for each site). + + + ### lamb + + + Lambda matrices (list of ndarrays, one for each bond between adjacent qubits). + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-simulation-settings.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-simulation-settings.mdx new file mode 100644 index 00000000000..a84e6f2a2ec --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer-qiskit-aer-simulation-settings.mdx @@ -0,0 +1,58 @@ +--- +title: QiskitAerSimulationSettings (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings +--- + +# QiskitAerSimulationSettings + + + Bases: [`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings") + + Qiskit Aer simulator settings. + + Example usage: + + ```python + from qiskit_aer import AerSimulator + from qiskit_addon_aqc_tensor.simulation.aer import QiskitAerSimulationSettings + + simulator = AerSimulator( + method="matrix_product_state", + matrix_product_state_max_bond_dimension=200, + matrix_product_state_truncation_threshold=1e-6, + mps_log_data=True, + ) + + def my_simulation_callback(circuit, result): + print(f"Simulated circuit of depth {circuit.depth()}") + metadata = result.results[0].metadata + print(metadata["MPS_log_data"]) + + settings = QiskitAerSimulationSettings(simulator, my_simulation_callback) + ``` + + See additional options for when using the `matrix_product_state` simulation method in the documentation for [`AerSimulator`](https://qiskit.github.io/qiskit-aer/stubs/qiskit_aer.AerSimulator.html#qiskit_aer.AerSimulator "(in Qiskit Aer v0.16.1)"). + + ## Attributes + + **Parameters** + + * **simulator** (*AerSimulator*) + * **callback** (*Callable\[\[QuantumCircuit, Result], None] | None*) + + ### callback + + + This callable, if provided, is called with `(circuit, result)` as arguments immediately after each MPS simulation. + + + ### simulator + + + Aer simulator, must be configured with method=’matrix\_product\_state’. Stores configuration like `max_bond_dimension`, `truncation_threshold`, etc. + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer.mdx new file mode 100644 index 00000000000..56b4228a692 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-aer.mdx @@ -0,0 +1,35 @@ +--- +title: aer (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.aer in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: qiskit_addon_aqc_tensor.simulation.aer +--- + + + + + +# Aer simulation backend + +`qiskit_addon_aqc_tensor.simulation.aer` + +Qiskit Aer MPS simulator as a tensor network backend. + +| | | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | +| [`QiskitAerMPS`](simulation-aer-qiskit-aer-mps "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS") | Qiskit Aer representation of a matrix-product state. | +| [`QiskitAerSimulationSettings`](simulation-aer-qiskit-aer-simulation-settings "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings") | Qiskit Aer simulator settings. | + +## Functions + +### is\_aer\_available + + + Return `True` is qiskit-aer is installed, `False` otherwise. + + **Return type** + + [`bool`](https://docs.python.org/3/library/functions.html#bool) + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-qiskit-quimb-conversion-context.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-qiskit-quimb-conversion-context.mdx new file mode 100644 index 00000000000..c0954ca0b46 --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-qiskit-quimb-conversion-context.mdx @@ -0,0 +1,22 @@ +--- +title: QiskitQuimbConversionContext (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext +--- + +# QiskitQuimbConversionContext + + + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) + + Contains information about Qiskit-to-Quimb conversion, necessary to recover Qiskit parameters. + + Initialize. Should not be called by users. + + **Parameters** + + **mapping** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*]]*) + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-circuit-factory.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-circuit-factory.mdx new file mode 100644 index 00000000000..3ab7eeeecac --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-circuit-factory.mdx @@ -0,0 +1,16 @@ +--- +title: QuimbCircuitFactory (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory +--- + +# QuimbCircuitFactory + + + Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol) + + Quimb circuit factory. + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-simulator.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-simulator.mdx new file mode 100644 index 00000000000..2235f88ea3d --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb-quimb-simulator.mdx @@ -0,0 +1,60 @@ +--- +title: QuimbSimulator (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 1 +python_api_type: class +python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator +--- + +# QuimbSimulator + + + Bases: [`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings") + + Settings for Quimb simulator. + + This is compatible with both [Quimb’s MPS simulator](https://quimb.readthedocs.io/en/latest/tensor/tensor-circuit-mps.html), which eagerly contracts gates by default, as well as [Quimb’s standard method for circuit simulation](https://quimb.readthedocs.io/en/latest/tensor/tensor-circuit.html). + + Example usage: + + ```python + from functools import partial + import quimb.tensor + from qiskit_addon_aqc_tensor.simulation.quimb import QuimbSimulator + + simulator_settings = QuimbSimulator( + partial( + quimb.tensor.CircuitMPS, + gate_opts={"cutoff": 1e-8}, + ), + autodiff_backend="jax", + ) + ``` + + For additional options, see the API documentation for [quimb.tensor.Circuit](https://quimb.readthedocs.io/en/main/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit) and [quimb.tensor.CircuitMPS](https://quimb.readthedocs.io/en/main/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.CircuitMPS). + + ## Attributes + + **Parameters** + + * **quimb\_circuit\_factory** ([*QuimbCircuitFactory*](simulation-quimb-quimb-circuit-factory "qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory")) + * **autodiff\_backend** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) + * **progbar** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) + + ### autodiff\_backend + + + + ### progbar + + + Whether to display a progress bar while applying gates. + + + ### quimb\_circuit\_factory + + + Callable for constructing the Quimb circuit, e.g., `Circuit()` or `CircuitMPS()`. + + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb.mdx new file mode 100644 index 00000000000..e4f095c8dad --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation-quimb.mdx @@ -0,0 +1,83 @@ +--- +title: quimb (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation.quimb in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: qiskit_addon_aqc_tensor.simulation.quimb +--- + + + + + +# Quimb simulation backend + +`qiskit_addon_aqc_tensor.simulation.quimb` + +Quimb as a tensor network backend. + +| | | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| [`QuimbCircuitFactory`](simulation-quimb-quimb-circuit-factory "qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory") | Quimb circuit factory. | +| [`QuimbSimulator`](simulation-quimb-quimb-simulator "qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator") | Settings for Quimb simulator. | +| [`QiskitQuimbConversionContext`](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext") | Contains information about Qiskit-to-Quimb conversion, necessary to recover Qiskit parameters. | + +## Functions + +### is\_quimb\_available + + + Return `True` is qiskit-quimb is installed, `False` otherwise. + + **Return type** + + [`bool`](https://docs.python.org/3/library/functions.html#bool) + + +### qiskit\_ansatz\_to\_quimb + + + Convert a Qiskit ansatz to a Quimb parametrized circuit. + + **Return type** + + [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`Circuit`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit), [`QiskitQuimbConversionContext`](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext")] + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **initial\_parameters** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence)*\[*[*float*](https://docs.python.org/3/library/functions.html#float)*]*) + + +### recover\_parameters\_from\_quimb + + + Recover Qiskit circuit parameters from a Quimb circuit. + + **Return type** + + [`list`](https://docs.python.org/3/library/stdtypes.html#list)\[[`float`](https://docs.python.org/3/library/functions.html#float)] + + **Parameters** + + * **circ\_opt** ([*Circuit*](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit)) + * **ctx** ([*QiskitQuimbConversionContext*](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext")) + + +### tnoptimizer\_objective\_kwargs + + + Return keyword arguments for use with `TNOptimizer()`. :rtype: [`dict`](https://docs.python.org/3/library/stdtypes.html#dict)\[[`str`](https://docs.python.org/3/library/stdtypes.html#str), [`Any`](https://docs.python.org/3/library/typing.html#typing.Any)] + + * `loss_fn` + * `loss_kwargs` + + **Parameters** + + **objective** ([*MaximizeStateFidelity*](objective#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity")) + + **Return type** + + [dict](https://docs.python.org/3/library/stdtypes.html#dict)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any)] + + diff --git a/docs/api/qiskit-addon-aqc-tensor/0.2/simulation.mdx b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation.mdx new file mode 100644 index 00000000000..f87da580a3f --- /dev/null +++ b/docs/api/qiskit-addon-aqc-tensor/0.2/simulation.mdx @@ -0,0 +1,201 @@ +--- +title: simulation (v0.2) +description: API reference for qiskit_addon_aqc_tensor.simulation in qiskit-addon-aqc-tensor v0.2 +in_page_toc_min_heading_level: 2 +python_api_type: module +python_api_name: qiskit_addon_aqc_tensor.simulation +--- + + + + + +# Tensor network simulation + +`qiskit_addon_aqc_tensor.simulation` + +This module provides an interface to tensor-network simulation that is agnostic to which backend is used. + +Currently, there is a single implementation, which uses the Qiskit Aer matrix-product state (MPS) simulator as its backend. + +## Available backends + +* [`qiskit_addon_aqc_tensor.simulation.aer`](simulation-aer#module-qiskit_addon_aqc_tensor.simulation.aer "qiskit_addon_aqc_tensor.simulation.aer") +* [`qiskit_addon_aqc_tensor.simulation.quimb`](simulation-quimb#module-qiskit_addon_aqc_tensor.simulation.quimb "qiskit_addon_aqc_tensor.simulation.quimb") + +## Functions + +The following functions provide a common interface that can be used with any supported backend. Regardless of which backend you use, you will invoke these functions as a common interface. + +In each function below, the documentation shows every distinct implementation available for that function. The addon will choose which implementation to use based on the types of the arguments that you provide. (This paradigm is called “multiple dispatch”.) + +### tensornetwork\_from\_circuit + + + Create a tensor-network state by simulating a quantum circuit. + + The type of tensor-network state will correspond to the type of the `settings` object. For instance, a [`QiskitAerSimulationSettings`](simulation-aer-qiskit-aer-simulation-settings "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings") will result in this function returning a [`QiskitAerMPS`](simulation-aer-qiskit-aer-mps "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS"). + + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + + **Return type** + + [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + + **Return type** + + [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + + **Return type** + + [`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + + +### apply\_circuit\_to\_state + + + Apply a quantum circuit to a tensor network state. + + The input state (`psi`) is not modified. + + **Return type** + + [`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + **Returns** + + The new state. + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) + + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) + + **Return type** + + [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) + + **Return type** + + [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + + Apply a quantum circuit to a tensor network state. + + The input state (`psi`) is not modified. + + **Returns** + + The new state. + + **Parameters** + + * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) + * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) + * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) + + **Return type** + + [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") + + +### compute\_overlap + + + Compute overlap of two quantum states: $\langle \psi_1 | \psi_2 \rangle$. + + NOTE: Unlike `numpy.dot`, implementations of this method will perform complex conjugation on the first argument. + + **Parameters** + + * **psi\_1** ([`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – first quantum state. + * **psi\_2** ([`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – second quantum state. + + **Return type** + + [`complex`](https://docs.python.org/3/library/functions.html#complex) + + **Returns** + + complex dot product value. + + + **Parameters** + + * **psi\_1** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **psi\_2** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + + **Return type** + + [complex](https://docs.python.org/3/library/functions.html#complex) + + + + **Parameters** + + * **psi\_1** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + * **psi\_2** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) + + **Return type** + + [complex](https://docs.python.org/3/library/functions.html#complex) + + + +## Abstract classes + +These are abstract classes, implemented by each backend. + +### TensorNetworkState + + + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) + + Abstract tensor network state. + + +### TensorNetworkSimulationSettings + + + Bases: [`object`](https://docs.python.org/3/library/functions.html#object) + + Abstract truncation settings. + + diff --git a/public/docs/api/qiskit-addon-aqc-tensor/0.2/objects.inv b/public/docs/api/qiskit-addon-aqc-tensor/0.2/objects.inv new file mode 100644 index 0000000000000000000000000000000000000000..3c3bda03e70a57eda1847503a71af15d0b1694c6 GIT binary patch literal 6628 zcmXw-WmHuC_x362&JhrX?x9OMC8b4Dx*ep4?vNG+knRShLt2=TkZy*MMjA#biD&NL ze?4!`S?iqr-PdPd=f&B3vj7b~I5~qMKxeS8J=ojb(;w(-@9E|24h9P0vjBBH-CgW$ zyjXM__=PvkeFzvNCTmmNq-wmXD;0KYuPiWHc>c_a-*5izyCV zl%Rk^p^}*o@*d5Mf>toR3uR#pSek%dTXJO_C33Q!^jw){>aUQD$szZ|jI-a?k1|up zWo4(S7%b3~I7J2g1luvW7GE~0)x`QCJX;aNJMBZK+W&e8x_BOp(|T{zef&L~+wKDm zK<=&oc2z~RFZY%L58KRhSrnoO8cpqaI(gfTmUmvTRfj-p(~A;pZ6y*bJ|T{h?26mP zI1gH#>>U2qGpys4AKnL4?l|v+GbLJN*|bt7jVcE>BSsZP=}%?7M4jF zH*5az)b92K)rl`&^F`+i63o~}S#+5z6Iiiz3=qgXCShAU;De~F0NnQN{xi>bB0}q9 zi_mw!fb9;PV9Wb7pFvX@GYUY{2)ABBy4*ndj6Z5u2x*eu(^f`$O zn)}hm71J|}29-|6bq^}cYqd5EmB&r#u8(y;7&({~AKn*4uF}E!uUsi{#66Q%s5)&d zCE-}Ge{5p68l1};8WK@53wiRg79q4c6JQwMB9jzN7gZzIXN6WX=XL<5q=5W@FCy{V z0x?ryGp^O)_%0ftqZMFf>fqX+8uiBZ1Gxzi*4|g_`22R-{$Xz;7K#}|BG|<1B=>+f zE&@e%-Xxr*g^^^Pm65DFdBkz~E~ZiGTopc(KY3f-!K&5a%;f3>>N-F^dZ;)pr)RHI zSgMHL;M9x~QMg?+c6b&MZPjO1U0d>Wxg^-+tq7Xr;wuqh$CGX_!eVP z(c`q9Ox$Rq8S|!JUVSVv&{wRYC%sAFgh8#hF4SelUZKHUlSR;zm*`pL8`^{%ePq$XAqjTAC%YheD-yu)V>L52kc8)08nS;N;ayC>had>Bx z4j@N_2cyo&hS-+ca~DHWcVINw9NBn77<=ODPD{71IV*-KhiT}U*zlDHC(^pl|I~3& zVnfxE;AturMr56DfZU3wRLRl#$+wXb*#*y7tQ_2AAz*BpI5y^LH@*mWE2zf68H3TG?RI;@C~ylg>T zJpScaKF07&a_P^<`VlB!^drOtLb#YH%?!B)=;-R9r13ahY&YM3LCG;1!^*MTMUM3q zQO4*;@JlFiF_98=L4QS8W|1pe%a=z@ziq0jMMu;QsgyV!MfyFwwwO?dN5? z`PEq-CC^J%jumS7M_*BZxeEF#DaKp_7Zw2}5BfBvffvr1iW0}QM2Tx_aShN=H$q8q zW8Z0QK%1@mdP?_rCHzABD;0pSN}vG;Iz2fMSGS=+-V}s0 z^!hj7_YunVZ;pFME8^mEi}GY69nobR8`Q+3Eku-(&0_LuwDs0b&do9Mo_3M_V;_kO zwJ_=gKjM9bZ#lNphUJaB;O>xVMoyh|O%Y|K$I_DW{&p*txL%0M<=$UL53(vMi-pTb z(af!@cNY4Rum&v1i8eL^-%?k80+{5+L>P!9sc4UgkYMP+#+#rBGJ51OCV4a_DNpYWJOFr~)wcYm+$fiU1M)R>9BH-Wh;3Uc z^C#x!WQlG08DCeb#jOcm-_=Q!}uUye|YYH3&GFED(-$vAyYl= z8LLHT_{SRiox=*ZWHhjh>uG;Jz>=20u+8QL&Z+M?Rv+jZ zd-jT-6UYMo>Ptn@A3H<#cO>qjEfv2;2V)mEUPm<@bZe2POSRN(M;xxDmX79X4Zo!5 zQ|@&}ejG4>4X_P$_+me?q`c7Cpf~$VlTZolx-8 zaM87q&D%h`u= zNqijGkzl#74VZq$-$98MSPS;=6_XF>Ut_XP@ObxHe=Bv8N*R5*{QGj2Cx!P7OKmhw zfX5D6N_ov#uB%?NlGDityXMBOm4%1O@%X{BXfmU9y9FHUlNK79qZ${Img*wz=F`J` z!jeqQo|Zq+P>762B&$PxFanv*U~MbI6oTHd4}}lcYh3NOhvQsXcce8^ zeq+E{+34{r@gqk8J<$WK{g1j89>V#oy*2Z88aH{bOs>0;Hf(1p{GrW~&Wxm@s@x$U zgM?4!A-A9J`4*cpVfq0Ap+RhKPbBAGa4B?t51`Mo&Dcl7tG5A&cR{#@hDv0C9E zs(wiykL%&bu!F1gS0Uf-T78UEkmr5iqfm5aCnKts+|Tn0;~z|uaV9t}ghWG)m-0S$ zAZZR+&Dh+m(X z+^7^B;cFQJnr4*5dEex&!CUnW4y*MD`rhd@8+^FD6j)KHl6fQ{yNI|Sg&CH?JK>Pz zhWvQK^qR`hnX;s$s^rZ#zMDSCkW)-wHg$1)8zkvpu2{Mchp<#%qw}EQ_e7+nKnjlr<3ejl#JRf4iBxdyeHgv zyjy+IJnGtMn2Uq|$L3ZEKmbg;vZLFZ zbup({5YK*J$)?X(5`3}fsj1v}$a<9T{3%M)Id&oq{EQ=R;ffm3@s|%sb;7~xDo@%p zCbt^SryXp?oOUXo7$=3vvL$;y75#fc?X}@ms`uisw|hN3eRi8G8_OICdV3^Who97K zz{zXay@O`$&}i&}xj?HuJ7Y2KD;nEb54<~8o_p@T-F=8cE3t0{TK zSc}MwD@Y*43y_C{x~|-6_Sm;SwAC{f8S&m`Uv}6ZnA&btGgLqljKAa3d8*SaGUA4g zHDv#ENo>B*`nDW+s__K|F8%q@8;WnR#pdsW6+-MQpfn z)c%V>s^P%192sNBxv!FLs;15yAgQ(W9kE2=t$Dz%hdTL z$56=dQ`?iy&!^UQ)sN$Fj=tqjK`l@C?dRe(>#Z62;U^aYc?f6Upk-Wp>WNwlqm0&< z0xy7Nw`fei1RxTEhJl-9?lat9XNtw;EN{*yGhRdoWd)7Y%6RktLM*I+TD3cCQ}&@( z0uR*0S0`Q6Ga#6;!5-5epFl28A%`V?^Z>tFqJ zf5O0%q{8vCHZ7^$$PCGy!j3Q*vKu$yFV_nb+dk~zoqadYma}M^>M7dro&4KQ2@*>^ zn6-?+Amo~O0=|m;!kdZ35U87AtFuoI>z+?2jS%d2a-D6yI9}(4Gb2pG6V3iL&$fM) zi0m+%RYOlq7p}2d?}L}QyIHNT+yzC|;;l4uE@{(C)9sd!x= zU4W7Qe6-i+gV>(bOnWm1|2U3`6w=EByumtLyt-nQnE!Vfm$7#;6?Q)bfd1+q?`&yk zk;GWq7Fd8^nHwV7`#gr*!~hnK!JzMZqEPxaI9h3q_9VPHl!86sy*sw&DScjgXP_WQ zR;Tb_wi(X8&FMPTsP&1K0DR%b%}sl@KxN@=n0f0-XVtgGD$kCW6p3}BvW$qw;4jjn zJugPPkRL#of$pDo8#aW84oEEW5<;K0%!qH-@om?a3)98UImHA9KNenx|LlJ8d2ktE z<<|PU6B4kl{nPqH@P~+m?~w7%n^e=HJ5g96NN(VfW@W%RQALD!EaH34>G|)iy=%7C zHo=o&ovgwNC#48CoIa$|rldsPNJD#&3;2NqUl4Gm3YeUDBy@B3Uqd(ZedE_pt$irp zHsssMG;)?k2matkU#ff-h&}NE@2R`oWt52U2kGt z@0yC;YV^JX?S+dH?wQuBrqQY+*441}?JSvHe04VwDc_%uO{LL)GxTID{|#pn)&{#} z1K-;wVt>`H!y8z$*5+&DNlYvA4d+uRx^*4d)P9!=XdH2Mx(Muwp%(d}B$_WAm{Rl>=`ZrDM>20Z`Z&>3D4#Uy9Im1jSwy@6F0H zKR}<0^vJjj11L0q44v*(olGZ++Po#&am^)i z^73o_nTxZss=D7oa>$#PD@UxfWfQUcsw>r1{$7f}xB?*dOyfj(x2^F0$*_PB9q*=8 z>VlKEpDlHoV;FYP?|BbCPiDRBGkJb9WP6vz;9qgzIKc{N*Q6%rE%Df+;_dw;mTonq zYNo~!ayHIGvYL?liYnkMsEA;$7s*92JCUnS7t+Pgs&9xhRl7j>V!+?7)SD3VrC@HH ztaU@hmX?NYZZeZ(m~5FbMK`}>vw+D^J^|Q1SpzCl8A#pu_c?XkG7%AHq|dAUv>oqj zkt&?p;zJrt=Z1+=tgq;FQ&^`XcXJ<4rYFiNT4U+vaGj3s{th6zg`Jh$Fk_*celb1Y z`t!H^4Viq?FiXyJ$7HpCIUu#t1ahaD-k(3V7?&M{{FQe3bhnKDv4am>2(lUrWDty_ zItin{$8Xmm?O2sbVTFDPkSB2{UE{!BfE23ZdD_aB;mp)t*N{(l73$_Q93Fh0fqQ`YTIU8UKDXlYE2hg96?q0bw82X4A$fSvcV(G%MPYg-=YmBg zko_J@5xy7UP$iBSwNMKAedDJvkX|~gY(~XrUOhiHA(N6*jSZ2(_Aa3iRVLCI=21+w zxa8ZQYUB^$dmH5>N61dLjkGQMK*#oTrU7QSaCZbO#qlRAz(bm)j3QKekcULNKrn^- z&qZPwXbKXell}Q3F}r0m#W6}bo_6xQMid5tOE>Akg)v?V{tyoOZngbfm`mZsB<=`$ zq9a6f;D@jSHG4vb*TDAkQgZvr-vui4leh#!s0(LglH*Udk>3}IMGSQpgnfWvR3?pc zRHmH%?dP&SHa~>-Wk>m`U3kfp{+6>QEvqn|{XZu9UGh|>o-p}_iLKFNY-FU?Yf<0U=F zfh|@bm`=WPk(kOb42dz$h`UI=%XsHK~)eGfbtN@IlwrHdq6H)uxa27zet4HQ4m|| zr2iC>UYFBnS7$h5Oh0=HihbaJOAU28AT9)f9|?bKKiJOo!>>bobp(sho64UU!Zz_9 z7{aUp$UroY)!{xI0lT<+hW=E?p)+*l=JIj`j@vTV6}p*7Gxjq1z7?VR<5a>XHc6)y z^gxL>hf<`m#2Kbl6*hE3!5L#c*YUCVB@BWG&lZv`Q5SMl5#ezY!zxqAe-JPaQy@{o zWjv0v%g|d?hiKTQyt{((uzDPRZ?sK*D`C2%_H14Zui0(h|AtyDiGq@Gn`ADU(r@CZt%eIlML=z~~}N#5$vstuXs1jbc3rrS;q`kFVlH|@ zJF0c|QQj7O^>H8`c+#xO{7!#nwFAu}Gwk4#Sy2w%%-P%!^Ifh4&mAV#T%DW0%!w^l z`E3=Kpj1*0;eyGK)45b^j-g?$u0dW2-x7I+PYd-BgIT(}AKkU>K~rx-ES`yb?OsRv zB4ZxDN#&Ila=*bE9H0pG-WHjm~9IY`Aa5ev!Z=i#1 zW|`*d{PpEj_uG+wOsQ*AvRJM<)i<45^_4r9V?TD>J2P8(Gn>5hEuUVY7B-s1FaFZW z`GwZ|!SuKL+$^I@PYC~U21du?M%Hh*L8AX#he)j=FaK1Y4o*)#h441->z|z{tjr&? z@%dd~<3}6oc2}l)DkjxIxpJq-lN2vU8#h*!%) z4WXZClE`z%d&AfMOh3A|&OTN9X-XwzkX+e`)A~K(`~9OC+|~~?U#ecHn~CBwWw2WC_Wz;sJ!alX}@+1Zg`< zQ^U<%I~#*g3qc8AM5Hy9Z_MuIIl1&o(7<_et(XV|ESh~QB9vL3vc|vVBEJeuLH1uP Z4R^|s56`bhu0RNj_nV$@(n^q7{||`c(LMkG literal 0 HcmV?d00001 diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-1.svg new file mode 100644 index 00000000000..2b6f3824d3b --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-1.svg @@ -0,0 +1,747 @@ + + + + + + + + 2025-03-28T17:48:30.194901 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-2.svg new file mode 100644 index 00000000000..a509239268d --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-2.svg @@ -0,0 +1,1166 @@ + + + + + + + + 2025-03-28T17:48:31.020542 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-3.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-3.svg new file mode 100644 index 00000000000..9ee3e0fe050 --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-3.svg @@ -0,0 +1,1030 @@ + + + + + + + + 2025-03-28T17:48:31.270177 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-4.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-4.svg new file mode 100644 index 00000000000..9782eb94e8c --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-4.svg @@ -0,0 +1,1956 @@ + + + + + + + + 2025-03-28T17:48:31.739954 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-5.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-5.svg new file mode 100644 index 00000000000..fc623d5032d --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-5.svg @@ -0,0 +1,2377 @@ + + + + + + + + 2025-03-28T17:48:32.155601 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-6.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-6.svg new file mode 100644 index 00000000000..44216b711cb --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-6.svg @@ -0,0 +1,747 @@ + + + + + + + + 2025-03-28T17:48:32.517719 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-7.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-7.svg new file mode 100644 index 00000000000..52569b9ed56 --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-7.svg @@ -0,0 +1,885 @@ + + + + + + + + 2025-03-28T17:48:32.704648 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-8.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-8.svg new file mode 100644 index 00000000000..00df8f09039 --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-8.svg @@ -0,0 +1,747 @@ + + + + + + + + 2025-03-28T17:48:33.058567 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-9.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-9.svg new file mode 100644 index 00000000000..3a0bbb2dfe7 --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/ansatz_generation-9.svg @@ -0,0 +1,542 @@ + + + + + + + + 2025-03-28T17:48:33.157016 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg new file mode 100644 index 00000000000..f1ceecc12ba --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg @@ -0,0 +1,306 @@ + + + + + + + + 2025-03-28T17:48:30.883567 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg new file mode 100644 index 00000000000..253a218a1eb --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg @@ -0,0 +1,635 @@ + + + + + + + + 2025-03-28T17:48:31.172269 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg new file mode 100644 index 00000000000..d257a54c6a4 --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg @@ -0,0 +1,271 @@ + + + + + + + + 2025-03-28T17:48:32.331085 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg new file mode 100644 index 00000000000..20f962b200b --- /dev/null +++ b/public/docs/images/api/qiskit-addon-aqc-tensor/0.2/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg @@ -0,0 +1,338 @@ + + + + + + + + 2025-03-28T17:48:32.414288 + image/svg+xml + + + Matplotlib v3.9.4, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/config/historical-pages-to-latest.json b/scripts/config/historical-pages-to-latest.json index 9323e61f359..64430e44893 100644 --- a/scripts/config/historical-pages-to-latest.json +++ b/scripts/config/historical-pages-to-latest.json @@ -1483,7 +1483,8 @@ "0.17": {} }, "qiskit-addon-aqc-tensor": { - "0.1": {} + "0.1": {}, + "0.2": {} }, "qiskit-addon-obp": { "0.1": {}, From 6299f99510f3af13eacf05fb69587b449772eabc Mon Sep 17 00:00:00 2001 From: Becky Dimock Date: Thu, 14 May 2026 12:51:26 -0500 Subject: [PATCH 3/3] Update latest docs --- .../api/qiskit-addon-aqc-tensor/_package.json | 4 - docs/api/qiskit-addon-aqc-tensor/_toc.json | 106 - .../ansatz-generation-ansatz-block.mdx | 406 --- .../ansatz-generation-kak.mdx | 422 --- ...satz-generation-one-qubit-ansatz-block.mdx | 408 --- ...satz-generation-two-qubit-ansatz-block.mdx | 408 --- .../ansatz-generation-zxz.mdx | 422 --- .../ansatz-generation.mdx | 220 -- docs/api/qiskit-addon-aqc-tensor/index.mdx | 15 - .../api/qiskit-addon-aqc-tensor/objective.mdx | 128 - .../qiskit-addon-aqc-tensor/release-notes.mdx | 74 - .../simulation-aer-qiskit-aer-mps.mdx | 37 - ...ion-aer-qiskit-aer-simulation-settings.mdx | 58 - .../simulation-aer.mdx | 35 - ...-quimb-qiskit-quimb-conversion-context.mdx | 22 - ...simulation-quimb-quimb-circuit-factory.mdx | 16 - .../simulation-quimb-quimb-simulator.mdx | 60 - .../simulation-quimb.mdx | 83 - .../qiskit-addon-aqc-tensor/simulation.mdx | 201 -- .../ansatz_generation-1.svg | 747 ------ .../ansatz_generation-2.svg | 1166 -------- .../ansatz_generation-3.svg | 1030 ------- .../ansatz_generation-4.svg | 1956 -------------- .../ansatz_generation-5.svg | 2377 ----------------- .../ansatz_generation-6.svg | 747 ------ .../ansatz_generation-7.svg | 885 ------ .../ansatz_generation-8.svg | 747 ------ .../ansatz_generation-9.svg | 542 ---- ...don_aqc_tensor-ansatz_generation-KAK-1.svg | 306 --- ...don_aqc_tensor-ansatz_generation-KAK-2.svg | 635 ----- ...don_aqc_tensor-ansatz_generation-ZXZ-1.svg | 271 -- ...don_aqc_tensor-ansatz_generation-ZXZ-2.svg | 338 --- 32 files changed, 14872 deletions(-) delete mode 100644 docs/api/qiskit-addon-aqc-tensor/_package.json delete mode 100644 docs/api/qiskit-addon-aqc-tensor/_toc.json delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation-one-qubit-ansatz-block.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation-two-qubit-ansatz-block.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation-zxz.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/ansatz-generation.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/index.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/objective.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/release-notes.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-mps.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-simulation-settings.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-aer.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-quimb-qiskit-quimb-conversion-context.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-circuit-factory.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-simulator.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation-quimb.mdx delete mode 100644 docs/api/qiskit-addon-aqc-tensor/simulation.mdx delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-1.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-2.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-3.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-4.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-5.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-6.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-7.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-8.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-9.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg delete mode 100644 public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg diff --git a/docs/api/qiskit-addon-aqc-tensor/_package.json b/docs/api/qiskit-addon-aqc-tensor/_package.json deleted file mode 100644 index a08b147e6d6..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/_package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "qiskit-addon-aqc-tensor", - "version": "0.2.0" -} diff --git a/docs/api/qiskit-addon-aqc-tensor/_toc.json b/docs/api/qiskit-addon-aqc-tensor/_toc.json deleted file mode 100644 index 99cd2329015..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/_toc.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "title": "Approximate quantum compilation (AQC-Tensor)", - "children": [ - { - "title": "API index", - "url": "/docs/api/qiskit-addon-aqc-tensor" - }, - { - "title": "Release notes", - "useDivider": true, - "url": "/docs/api/qiskit-addon-aqc-tensor/release-notes" - }, - { - "title": "qiskit_addon_aqc_tensor.ansatz_generation", - "untranslatable": true, - "children": [ - { - "title": "Module overview", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation" - }, - { - "title": "AnsatzBlock", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block", - "untranslatable": true - }, - { - "title": "KAK", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak", - "untranslatable": true - }, - { - "title": "OneQubitAnsatzBlock", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-one-qubit-ansatz-block", - "untranslatable": true - }, - { - "title": "TwoQubitAnsatzBlock", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-two-qubit-ansatz-block", - "untranslatable": true - }, - { - "title": "ZXZ", - "url": "/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-zxz", - "untranslatable": true - } - ] - }, - { - "title": "qiskit_addon_aqc_tensor.objective", - "url": "/docs/api/qiskit-addon-aqc-tensor/objective", - "untranslatable": true - }, - { - "title": "qiskit_addon_aqc_tensor.simulation", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation", - "untranslatable": true - }, - { - "title": "qiskit_addon_aqc_tensor.simulation.aer", - "untranslatable": true, - "children": [ - { - "title": "Module overview", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-aer" - }, - { - "title": "QiskitAerMPS", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-mps", - "untranslatable": true - }, - { - "title": "QiskitAerSimulationSettings", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-simulation-settings", - "untranslatable": true - } - ] - }, - { - "title": "qiskit_addon_aqc_tensor.simulation.quimb", - "untranslatable": true, - "children": [ - { - "title": "Module overview", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-quimb" - }, - { - "title": "QiskitQuimbConversionContext", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-qiskit-quimb-conversion-context", - "untranslatable": true - }, - { - "title": "QuimbCircuitFactory", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-circuit-factory", - "untranslatable": true - }, - { - "title": "QuimbSimulator", - "url": "/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-simulator", - "untranslatable": true - } - ] - } - ], - "collapsed": true, - "untranslatable": true -} diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block.mdx deleted file mode 100644 index 050cb761e69..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-ansatz-block.mdx +++ /dev/null @@ -1,406 +0,0 @@ ---- -title: AnsatzBlock (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock ---- - -# AnsatzBlock - - - Bases: [`Gate`](/docs/api/qiskit/qiskit.circuit.Gate) - - 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"). - - Initialize the ansatz block. - - **Parameters** - - **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. - - ## 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_addon_aqc_tensor.ansatz_generation.AnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock.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` 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. - - - ### condition - - - The classical condition on the instruction. - - - The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### condition\_bits - - - Get Clbits in condition. - - - The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. - - - ### duration - - - Get the duration. - - - The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ### 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 - - - Return the name. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - The parameters of this `Instruction`. Ideally these will be gate angles. - - - ### unit - - - Get the time unit of duration. - - - The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ## Methods - - ### add\_decomposition - - - Add a decomposition of the instruction to the SessionEquivalenceLibrary. - - - ### assemble - - - Assemble a QasmQobjInstruction - - - The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. - - - - ### broadcast\_arguments - - - Validation and handling of the arguments and its relationship. - - For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: - - ```python - in: [[q[0],q[1]], q[2]],[] - outs: [q[0], q[2]], [] - [q[1], q[2]], [] - ``` - - The general broadcasting rules are: - - > * If len(qargs) == 1: - > - > ```python - > [q[0], q[1]] -> [q[0]],[q[1]] - > ``` - > - > * If len(qargs) == 2: - > - > ```python - > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] - > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] - > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] - > ``` - > - > * If len(qargs) >= 3: - > - > ```python - > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] - > ``` - - **Parameters** - - * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. - * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. - - **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)]] - - **Returns** - - A tuple with single arguments. - - **Raises** - - **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. - - - ### c\_if - - - Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. - - - This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. - - - - The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### control - - - Return the controlled version of itself. - - Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). - - **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). - - **Returns** - - Controlled version of the given operation. - - **Raises** - - **QiskitError** – unrecognized mode or invalid ctrl\_state - - - ### copy - - - Copy of the instruction. - - **Parameters** - - **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. - - **Returns** - - a copy of the current instruction, with the name updated if it was provided - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### inverse - - - Invert this instruction. - - If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. - - If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. - - Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. - - **Parameters** - - **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. - - **Returns** - - The inverse operation. - - **Raises** - - **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. - - - ### is\_parameterized - - - Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). - - - ### power - - - Raise this gate to the power of `exponent`. - - Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. - - **Parameters** - - * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to - * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. - - **Returns** - - An operation implementing `gate^exponent` - - **Raises** - - **CircuitError** – If gate is not unitary - - - ### repeat - - - Creates an instruction with `self` repeated :math\`n\` times. - - If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. - - **Parameters** - - **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction - - **Returns** - - Containing the definition. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - **Raises** - - **CircuitError** – If n \< 1. - - - ### reverse\_ops - - - For a composite instruction, reverse the order of sub-instructions. - - This is done by recursively reversing all sub-instructions. It does not invert any gate. - - **Returns** - - **a new instruction with** - - sub-instructions reversed. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### soft\_compare - - - Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. - - **Parameters** - - **other** (*instruction*) – other instruction. - - **Returns** - - are self and other equal up to parameter expressions. - - **Return type** - - [bool](https://docs.python.org/3/library/functions.html#bool) - - - ### to\_matrix - - - Return a Numpy.array for the gate unitary matrix. - - **Returns** - - if the Gate subclass has a matrix definition. - - **Return type** - - np.ndarray - - **Raises** - - **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. - - - ### to\_mutable - - - Return a mutable copy of this gate. - - This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. - - - ### validate\_parameter - - - Gate parameters should be int, float, or ParameterExpression - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak.mdx deleted file mode 100644 index 7640ef5b6da..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-kak.mdx +++ /dev/null @@ -1,422 +0,0 @@ ---- -title: KAK (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.KAK in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.KAK ---- - -# KAK - - - Bases: [`TwoQubitAnsatzBlock`](ansatz-generation-two-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.TwoQubitAnsatzBlock") - - Two-qubit ansatz block based on the KAK decomposition. - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg) - - The above KAK block is equivalent to the following circuit: - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg) - - Initialize the ansatz block. - - **Parameters** - - **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. - - ## Attributes - - ### ansatz\_name - - - - ### ansatz\_num\_params - - - - ### ansatz\_num\_qubits - - - - ### 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_addon_aqc_tensor.ansatz_generation.KAK.base_class "qiskit_addon_aqc_tensor.ansatz_generation.KAK.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` 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. - - - ### condition - - - The classical condition on the instruction. - - - The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### condition\_bits - - - Get Clbits in condition. - - - The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. - - - ### duration - - - Get the duration. - - - The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ### 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 - - - Return the name. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - The parameters of this `Instruction`. Ideally these will be gate angles. - - - ### unit - - - Get the time unit of duration. - - - The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ## Methods - - ### add\_decomposition - - - Add a decomposition of the instruction to the SessionEquivalenceLibrary. - - - ### assemble - - - Assemble a QasmQobjInstruction - - - The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. - - - - ### broadcast\_arguments - - - Validation and handling of the arguments and its relationship. - - For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: - - ```python - in: [[q[0],q[1]], q[2]],[] - outs: [q[0], q[2]], [] - [q[1], q[2]], [] - ``` - - The general broadcasting rules are: - - > * If len(qargs) == 1: - > - > ```python - > [q[0], q[1]] -> [q[0]],[q[1]] - > ``` - > - > * If len(qargs) == 2: - > - > ```python - > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] - > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] - > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] - > ``` - > - > * If len(qargs) >= 3: - > - > ```python - > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] - > ``` - - **Parameters** - - * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. - * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. - - **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)]] - - **Returns** - - A tuple with single arguments. - - **Raises** - - **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. - - - ### c\_if - - - Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. - - - This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. - - - - The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### control - - - Return the controlled version of itself. - - Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). - - **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). - - **Returns** - - Controlled version of the given operation. - - **Raises** - - **QiskitError** – unrecognized mode or invalid ctrl\_state - - - ### copy - - - Copy of the instruction. - - **Parameters** - - **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. - - **Returns** - - a copy of the current instruction, with the name updated if it was provided - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### inverse - - - Invert this instruction. - - If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. - - If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. - - Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. - - **Parameters** - - **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. - - **Returns** - - The inverse operation. - - **Raises** - - **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. - - - ### is\_parameterized - - - Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). - - - ### power - - - Raise this gate to the power of `exponent`. - - Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. - - **Parameters** - - * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to - * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. - - **Returns** - - An operation implementing `gate^exponent` - - **Raises** - - **CircuitError** – If gate is not unitary - - - ### repeat - - - Creates an instruction with `self` repeated :math\`n\` times. - - If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. - - **Parameters** - - **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction - - **Returns** - - Containing the definition. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - **Raises** - - **CircuitError** – If n \< 1. - - - ### reverse\_ops - - - For a composite instruction, reverse the order of sub-instructions. - - This is done by recursively reversing all sub-instructions. It does not invert any gate. - - **Returns** - - **a new instruction with** - - sub-instructions reversed. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### soft\_compare - - - Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. - - **Parameters** - - **other** (*instruction*) – other instruction. - - **Returns** - - are self and other equal up to parameter expressions. - - **Return type** - - [bool](https://docs.python.org/3/library/functions.html#bool) - - - ### to\_matrix - - - Return a Numpy.array for the gate unitary matrix. - - **Returns** - - if the Gate subclass has a matrix definition. - - **Return type** - - np.ndarray - - **Raises** - - **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. - - - ### to\_mutable - - - Return a mutable copy of this gate. - - This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. - - - ### validate\_parameter - - - Gate parameters should be int, float, or ParameterExpression - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-one-qubit-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-one-qubit-ansatz-block.mdx deleted file mode 100644 index 07d61abf415..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-one-qubit-ansatz-block.mdx +++ /dev/null @@ -1,408 +0,0 @@ ---- -title: OneQubitAnsatzBlock (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock ---- - -# OneQubitAnsatzBlock - - - Bases: [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.AnsatzBlock") - - One-qubit ansatz block. - - Initialize the ansatz block. - - **Parameters** - - **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. - - ## Attributes - - ### ansatz\_num\_qubits - - - - ### 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_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock.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` 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. - - - ### condition - - - The classical condition on the instruction. - - - The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### condition\_bits - - - Get Clbits in condition. - - - The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. - - - ### duration - - - Get the duration. - - - The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ### 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 - - - Return the name. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - The parameters of this `Instruction`. Ideally these will be gate angles. - - - ### unit - - - Get the time unit of duration. - - - The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ## Methods - - ### add\_decomposition - - - Add a decomposition of the instruction to the SessionEquivalenceLibrary. - - - ### assemble - - - Assemble a QasmQobjInstruction - - - The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. - - - - ### broadcast\_arguments - - - Validation and handling of the arguments and its relationship. - - For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: - - ```python - in: [[q[0],q[1]], q[2]],[] - outs: [q[0], q[2]], [] - [q[1], q[2]], [] - ``` - - The general broadcasting rules are: - - > * If len(qargs) == 1: - > - > ```python - > [q[0], q[1]] -> [q[0]],[q[1]] - > ``` - > - > * If len(qargs) == 2: - > - > ```python - > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] - > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] - > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] - > ``` - > - > * If len(qargs) >= 3: - > - > ```python - > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] - > ``` - - **Parameters** - - * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. - * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. - - **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)]] - - **Returns** - - A tuple with single arguments. - - **Raises** - - **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. - - - ### c\_if - - - Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. - - - This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. - - - - The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### control - - - Return the controlled version of itself. - - Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). - - **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). - - **Returns** - - Controlled version of the given operation. - - **Raises** - - **QiskitError** – unrecognized mode or invalid ctrl\_state - - - ### copy - - - Copy of the instruction. - - **Parameters** - - **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. - - **Returns** - - a copy of the current instruction, with the name updated if it was provided - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### inverse - - - Invert this instruction. - - If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. - - If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. - - Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. - - **Parameters** - - **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. - - **Returns** - - The inverse operation. - - **Raises** - - **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. - - - ### is\_parameterized - - - Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). - - - ### power - - - Raise this gate to the power of `exponent`. - - Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. - - **Parameters** - - * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to - * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. - - **Returns** - - An operation implementing `gate^exponent` - - **Raises** - - **CircuitError** – If gate is not unitary - - - ### repeat - - - Creates an instruction with `self` repeated :math\`n\` times. - - If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. - - **Parameters** - - **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction - - **Returns** - - Containing the definition. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - **Raises** - - **CircuitError** – If n \< 1. - - - ### reverse\_ops - - - For a composite instruction, reverse the order of sub-instructions. - - This is done by recursively reversing all sub-instructions. It does not invert any gate. - - **Returns** - - **a new instruction with** - - sub-instructions reversed. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### soft\_compare - - - Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. - - **Parameters** - - **other** (*instruction*) – other instruction. - - **Returns** - - are self and other equal up to parameter expressions. - - **Return type** - - [bool](https://docs.python.org/3/library/functions.html#bool) - - - ### to\_matrix - - - Return a Numpy.array for the gate unitary matrix. - - **Returns** - - if the Gate subclass has a matrix definition. - - **Return type** - - np.ndarray - - **Raises** - - **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. - - - ### to\_mutable - - - Return a mutable copy of this gate. - - This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. - - - ### validate\_parameter - - - Gate parameters should be int, float, or ParameterExpression - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-two-qubit-ansatz-block.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-two-qubit-ansatz-block.mdx deleted file mode 100644 index 555cde519d4..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-two-qubit-ansatz-block.mdx +++ /dev/null @@ -1,408 +0,0 @@ ---- -title: TwoQubitAnsatzBlock (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock ---- - -# TwoQubitAnsatzBlock - - - Bases: [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.AnsatzBlock") - - Two-qubit ansatz block. - - Initialize the ansatz block. - - **Parameters** - - **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. - - ## Attributes - - ### ansatz\_num\_qubits - - - - ### 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_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.base_class "qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock.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` 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. - - - ### condition - - - The classical condition on the instruction. - - - The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### condition\_bits - - - Get Clbits in condition. - - - The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. - - - ### duration - - - Get the duration. - - - The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ### 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 - - - Return the name. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - The parameters of this `Instruction`. Ideally these will be gate angles. - - - ### unit - - - Get the time unit of duration. - - - The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ## Methods - - ### add\_decomposition - - - Add a decomposition of the instruction to the SessionEquivalenceLibrary. - - - ### assemble - - - Assemble a QasmQobjInstruction - - - The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. - - - - ### broadcast\_arguments - - - Validation and handling of the arguments and its relationship. - - For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: - - ```python - in: [[q[0],q[1]], q[2]],[] - outs: [q[0], q[2]], [] - [q[1], q[2]], [] - ``` - - The general broadcasting rules are: - - > * If len(qargs) == 1: - > - > ```python - > [q[0], q[1]] -> [q[0]],[q[1]] - > ``` - > - > * If len(qargs) == 2: - > - > ```python - > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] - > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] - > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] - > ``` - > - > * If len(qargs) >= 3: - > - > ```python - > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] - > ``` - - **Parameters** - - * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. - * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. - - **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)]] - - **Returns** - - A tuple with single arguments. - - **Raises** - - **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. - - - ### c\_if - - - Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. - - - This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. - - - - The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### control - - - Return the controlled version of itself. - - Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). - - **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). - - **Returns** - - Controlled version of the given operation. - - **Raises** - - **QiskitError** – unrecognized mode or invalid ctrl\_state - - - ### copy - - - Copy of the instruction. - - **Parameters** - - **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. - - **Returns** - - a copy of the current instruction, with the name updated if it was provided - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### inverse - - - Invert this instruction. - - If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. - - If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. - - Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. - - **Parameters** - - **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. - - **Returns** - - The inverse operation. - - **Raises** - - **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. - - - ### is\_parameterized - - - Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). - - - ### power - - - Raise this gate to the power of `exponent`. - - Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. - - **Parameters** - - * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to - * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. - - **Returns** - - An operation implementing `gate^exponent` - - **Raises** - - **CircuitError** – If gate is not unitary - - - ### repeat - - - Creates an instruction with `self` repeated :math\`n\` times. - - If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. - - **Parameters** - - **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction - - **Returns** - - Containing the definition. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - **Raises** - - **CircuitError** – If n \< 1. - - - ### reverse\_ops - - - For a composite instruction, reverse the order of sub-instructions. - - This is done by recursively reversing all sub-instructions. It does not invert any gate. - - **Returns** - - **a new instruction with** - - sub-instructions reversed. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### soft\_compare - - - Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. - - **Parameters** - - **other** (*instruction*) – other instruction. - - **Returns** - - are self and other equal up to parameter expressions. - - **Return type** - - [bool](https://docs.python.org/3/library/functions.html#bool) - - - ### to\_matrix - - - Return a Numpy.array for the gate unitary matrix. - - **Returns** - - if the Gate subclass has a matrix definition. - - **Return type** - - np.ndarray - - **Raises** - - **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. - - - ### to\_mutable - - - Return a mutable copy of this gate. - - This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. - - - ### validate\_parameter - - - Gate parameters should be int, float, or ParameterExpression - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-zxz.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-zxz.mdx deleted file mode 100644 index 062401f8615..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation-zxz.mdx +++ /dev/null @@ -1,422 +0,0 @@ ---- -title: ZXZ (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation.ZXZ in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation.ZXZ ---- - -# ZXZ - - - Bases: [`OneQubitAnsatzBlock`](ansatz-generation-one-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.from_connectivity.OneQubitAnsatzBlock") - - One-qubit ansatz block based on the ZXZ decomposition. - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg) - - The above ZXZ block is equivalent to the following circuit: - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg) - - Initialize the ansatz block. - - **Parameters** - - **params** ([`Sequence`](https://docs.python.org/3/library/typing.html#typing.Sequence)\[[`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter)]) – Sequence of parameters. - - ## Attributes - - ### ansatz\_name - - - - ### ansatz\_num\_params - - - - ### ansatz\_num\_qubits - - - - ### 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_addon_aqc_tensor.ansatz_generation.ZXZ.base_class "qiskit_addon_aqc_tensor.ansatz_generation.ZXZ.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` 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. - - - ### condition - - - The classical condition on the instruction. - - - The property `qiskit.circuit.instruction.Instruction.condition` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### condition\_bits - - - Get Clbits in condition. - - - The property `qiskit.circuit.instruction.Instruction.condition_bits` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### decompositions - - - Get the decompositions of the instruction from the SessionEquivalenceLibrary. - - - ### definition - - - Return definition in terms of other basic gates. - - - ### duration - - - Get the duration. - - - The property `qiskit.circuit.instruction.Instruction.duration` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ### 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 - - - Return the name. - - - ### num\_clbits - - - Return the number of clbits. - - - ### num\_qubits - - - Return the number of qubits. - - - ### params - - - The parameters of this `Instruction`. Ideally these will be gate angles. - - - ### unit - - - Get the time unit of duration. - - - The property `qiskit.circuit.instruction.Instruction.unit` is deprecated as of qiskit 1.3.0. It will be removed in Qiskit 2.0.0. - - - - ## Methods - - ### add\_decomposition - - - Add a decomposition of the instruction to the SessionEquivalenceLibrary. - - - ### assemble - - - Assemble a QasmQobjInstruction - - - The method `qiskit.circuit.instruction.Instruction.assemble()` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The Qobj class and related functionality are part of the deprecated BackendV1 workflow, and no longer necessary for BackendV2. If a user workflow requires Qobj it likely relies on deprecated functionality and should be updated to use BackendV2. - - - - ### broadcast\_arguments - - - Validation and handling of the arguments and its relationship. - - For example, `cx([q[0],q[1]], q[2])` means `cx(q[0], q[2]); cx(q[1], q[2])`. This method yields the arguments in the right grouping. In the given example: - - ```python - in: [[q[0],q[1]], q[2]],[] - outs: [q[0], q[2]], [] - [q[1], q[2]], [] - ``` - - The general broadcasting rules are: - - > * If len(qargs) == 1: - > - > ```python - > [q[0], q[1]] -> [q[0]],[q[1]] - > ``` - > - > * If len(qargs) == 2: - > - > ```python - > [[q[0], q[1]], [r[0], r[1]]] -> [q[0], r[0]], [q[1], r[1]] - > [[q[0]], [r[0], r[1]]] -> [q[0], r[0]], [q[0], r[1]] - > [[q[0], q[1]], [r[0]]] -> [q[0], r[0]], [q[1], r[0]] - > ``` - > - > * If len(qargs) >= 3: - > - > ```python - > [q[0], q[1]], [r[0], r[1]], ...] -> [q[0], r[0], ...], [q[1], r[1], ...] - > ``` - - **Parameters** - - * **qargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of quantum bit arguments. - * **cargs** ([`list`](https://docs.python.org/3/library/stdtypes.html#list)) – List of classical bit arguments. - - **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)]] - - **Returns** - - A tuple with single arguments. - - **Raises** - - **CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation. - - - ### c\_if - - - Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`. - - - This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack. - - - - The method `qiskit.circuit.instruction.Instruction.c_if()` is deprecated as of qiskit 1.3.0. It will be removed in 2.0.0. - - - - ### control - - - Return the controlled version of itself. - - Implemented either as a controlled gate (ref. `ControlledGate`) or as an annotated operation (ref. `AnnotatedOperation`). - - **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). - - **Returns** - - Controlled version of the given operation. - - **Raises** - - **QiskitError** – unrecognized mode or invalid ctrl\_state - - - ### copy - - - Copy of the instruction. - - **Parameters** - - **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name to be given to the copied circuit, if `None` then the name stays the same. - - **Returns** - - a copy of the current instruction, with the name updated if it was provided - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### inverse - - - Invert this instruction. - - If annotated is False, the inverse instruction is implemented as a fresh instruction with the recursively inverted definition. - - If annotated is True, the inverse instruction is implemented as `AnnotatedOperation`, and corresponds to the given instruction annotated with the “inverse modifier”. - - Special instructions inheriting from Instruction can implement their own inverse (e.g. T and Tdg, Barrier, etc.) In particular, they can choose how to handle the argument `annotated` which may include ignoring it and always returning a concrete gate class if the inverse is defined as a standard gate. - - **Parameters** - - **annotated** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – if set to True the output inverse gate will be returned as `AnnotatedOperation`. - - **Returns** - - The inverse operation. - - **Raises** - - **CircuitError** – if the instruction is not composite and an inverse has not been implemented for it. - - - ### is\_parameterized - - - Return whether the `Instruction` contains [compile-time parameters](/docs/api/qiskit/circuit#circuit-compile-time-parameters). - - - ### power - - - Raise this gate to the power of `exponent`. - - Implemented either as a unitary gate (ref. `UnitaryGate`) or as an annotated operation (ref. `AnnotatedOperation`). In the case of several standard gates, such as `RXGate`, when the power of a gate can be expressed in terms of another standard gate that is returned directly. - - **Parameters** - - * **exponent** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the power to raise the gate to - * **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – indicates whether the power gate can be implemented as an annotated operation. In the case of several standard gates, such as `RXGate`, this argument is ignored when the power of a gate can be expressed in terms of another standard gate. - - **Returns** - - An operation implementing `gate^exponent` - - **Raises** - - **CircuitError** – If gate is not unitary - - - ### repeat - - - Creates an instruction with `self` repeated :math\`n\` times. - - If this operation has a conditional, the output instruction will have the same conditional and the inner repeated operations will be unconditional; instructions within a compound definition cannot be conditioned on registers within Qiskit’s data model. This means that it is not valid to apply a repeated instruction to a clbit that it both writes to and reads from in its condition. - - **Parameters** - - **n** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of times to repeat the instruction - - **Returns** - - Containing the definition. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - **Raises** - - **CircuitError** – If n \< 1. - - - ### reverse\_ops - - - For a composite instruction, reverse the order of sub-instructions. - - This is done by recursively reversing all sub-instructions. It does not invert any gate. - - **Returns** - - **a new instruction with** - - sub-instructions reversed. - - **Return type** - - [qiskit.circuit.Instruction](/docs/api/qiskit/qiskit.circuit.Instruction) - - - ### soft\_compare - - - Soft comparison between gates. Their names, number of qubits, and classical bit numbers must match. The number of parameters must match. Each parameter is compared. If one is a ParameterExpression then it is not taken into account. - - **Parameters** - - **other** (*instruction*) – other instruction. - - **Returns** - - are self and other equal up to parameter expressions. - - **Return type** - - [bool](https://docs.python.org/3/library/functions.html#bool) - - - ### to\_matrix - - - Return a Numpy.array for the gate unitary matrix. - - **Returns** - - if the Gate subclass has a matrix definition. - - **Return type** - - np.ndarray - - **Raises** - - **CircuitError** – If a Gate subclass does not implement this method an exception will be raised when this base class method is called. - - - ### to\_mutable - - - Return a mutable copy of this gate. - - This method will return a new mutable copy of this gate instance. If a singleton instance is being used this will be a new unique instance that can be mutated. If the instance is already mutable it will be a deepcopy of that instance. - - - ### validate\_parameter - - - Gate parameters should be int, float, or ParameterExpression - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation.mdx b/docs/api/qiskit-addon-aqc-tensor/ansatz-generation.mdx deleted file mode 100644 index a69a2a5985d..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/ansatz-generation.mdx +++ /dev/null @@ -1,220 +0,0 @@ ---- -title: ansatz_generation (latest version) -description: API reference for qiskit_addon_aqc_tensor.ansatz_generation in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 2 -python_api_type: module -python_api_name: qiskit_addon_aqc_tensor.ansatz_generation ---- - - - - - -# Ansatz generation - -`qiskit_addon_aqc_tensor.ansatz_generation` - -Tools for generating ansatz circuits. - -| | | -| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -| [`AnsatzBlock`](ansatz-generation-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.AnsatzBlock") | Ansatz block. | -| [`OneQubitAnsatzBlock`](ansatz-generation-one-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.OneQubitAnsatzBlock") | One-qubit ansatz block. | -| [`TwoQubitAnsatzBlock`](ansatz-generation-two-qubit-ansatz-block "qiskit_addon_aqc_tensor.ansatz_generation.TwoQubitAnsatzBlock") | Two-qubit ansatz block. | -| [`ZXZ`](ansatz-generation-zxz "qiskit_addon_aqc_tensor.ansatz_generation.ZXZ") | One-qubit ansatz block based on the ZXZ decomposition. | -| [`KAK`](ansatz-generation-kak "qiskit_addon_aqc_tensor.ansatz_generation.KAK") | Two-qubit ansatz block based on the KAK decomposition. | - -### generate\_ansatz\_from\_circuit - - - Generate an ansatz from the two-qubit connectivity structure of a circuit. - - See the [explanatatory material](https://qiskit.github.io/qiskit-addon-aqc-tensor/explanation/index.html#ansatz-generation-motivation) for motivation. - - **Parameters** - - * **qc** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – A circuit, which is assumed to be unitary. Barriers are ignored. - * **qubits\_initially\_zero** ([`bool`](https://docs.python.org/3/library/functions.html#bool)) – If `True`, the first Z rotation on each qubit is fixed to zero because such a rotation has no effect on the state $|0\rangle$. - * **parameter\_name** ([`str`](https://docs.python.org/3/library/stdtypes.html#str)) – Name for the [`ParameterVector`](/docs/api/qiskit/qiskit.circuit.ParameterVector) representing the free parameters in the returned ansatz circuit. - - **Return type** - - [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit), [`list`](https://docs.python.org/3/library/stdtypes.html#list)\[[`float`](https://docs.python.org/3/library/functions.html#float)]] - - **Returns** - - `(ansatz, parameter_values)` such that `ansatz.assign_parameters(parameter_values)` is equivalent to `qc` up to a global phase. - - #### Example: - - Consider the following circuit as an example: - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(6) - qc.rx(0.4, 0) - qc.ryy(0.2, 2, 3) - qc.h(2) - qc.rz(0.1, 2) - qc.rxx(0.3, 0, 1) - qc.rzz(0.3, 0, 1) - qc.cx(2, 1) - qc.s(1) - qc.h(4) - qc.draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-1.svg) - - If the above circuit is passed to [`generate_ansatz_from_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit"), it will return an ansatz with parametrized two-qubit KAK rotations in the same locations as the input: - - ```python - from qiskit_addon_aqc_tensor import generate_ansatz_from_circuit - - ansatz, initial_params = generate_ansatz_from_circuit( - qc, qubits_initially_zero=True, parameter_name="x" - ) - ansatz.draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-2.svg) - - Note that in the generated ansatz, all consecutive single-qubit gates are collapsed into the same ZXZ block, and all consecutive two-qubit gates are collapsed into a single KAK block, up to single-qubit rotations. - - Further, the [`generate_ansatz_from_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit "qiskit_addon_aqc_tensor.ansatz_generation.generate_ansatz_from_circuit") function provides parameters which, when bound to the ansatz, will result in a circuit equivalent to the original one, up to a global phase: - - ```python - ansatz.assign_parameters(initial_params).draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-3.svg) - - A 1D Trotter circuit leads to a similar result, with its characteristic brickwork structure: - - ```python - from rustworkx.generators import path_graph - from qiskit.synthesis import SuzukiTrotter - from qiskit_addon_utils.problem_generators import generate_time_evolution_circuit, generate_xyz_hamiltonian - - hamiltonian = generate_xyz_hamiltonian( - path_graph(6), - coupling_constants=(0.0, 0.0, 1.0), - ext_magnetic_field=(0.4, 0.0, 0.0), - ) - - good_circuit = generate_time_evolution_circuit( - hamiltonian, - synthesis=SuzukiTrotter(reps=2), - time=1.0, - ) - - good_circuit.draw("mpl", initial_state=True) - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-4.svg) - - ```python - from qiskit_addon_aqc_tensor import generate_ansatz_from_circuit - - ansatz, initial_params = generate_ansatz_from_circuit( - good_circuit, qubits_initially_zero=True, parameter_name="x" - ) - ansatz.assign_parameters(initial_params).draw("mpl", initial_state=True) - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-5.svg) - - -### parametrize\_circuit - - - Create a parametrized version of a circuit. - - Given a quantum circuit, constructs another quantum circuit which is identical except that any gates with numerical parameters are replaced by gates (of the same type) with free parameters. The new circuit is returned along with a list containing the original values of the parameters. - - **Parameters** - - * **qc** (QuantumCircuit) – The quantum circuit to parametrize. - * **parameter\_name** (str) – Name for the [`ParameterVector`](/docs/api/qiskit/qiskit.circuit.ParameterVector) representing the free parameters in the returned ansatz circuit. - - **Return type** - - tuple\[QuantumCircuit, list\[float | None]] - - **Returns** - - `(ansatz, parameter_values)` such that `ansatz.assign_parameters(parameter_values)` is identical to `qc` as long as `qc` did not already contain parameters. If `qc` already had parameters, then `parameter_values` will contain `None` at the entries corresponding to those parameters. - - - - #### Example: - - Consider the following circuit as an example: - - ```python - from qiskit import QuantumCircuit - - qc = QuantumCircuit(6) - qc.rx(0.4, 0) - qc.ryy(0.2, 2, 3) - qc.h(2) - qc.rz(0.1, 2) - qc.rxx(0.3, 0, 1) - qc.rzz(0.3, 0, 1) - qc.cx(2, 1) - qc.s(1) - qc.h(4) - qc.draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-6.svg) - - If the above circuit is passed to [`parametrize_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit "qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit"), it will return an ansatz obtained from this circuit by replacing numerical parameters with free parameters: - - ```python - from qiskit_addon_aqc_tensor import parametrize_circuit - - ansatz, initial_params = parametrize_circuit(qc) - ansatz.draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-7.svg) - - Further, the [`parametrize_circuit()`](#qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit "qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit") function provides parameters which, when bound to the ansatz, will result in a circuit identical to the original one: - - ```python - ansatz.assign_parameters(initial_params).draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-8.svg) - - If the original circuit already contained parameters, then the returned parameter values will contain `None` at the entries corresponding to those parameters, and the preceding code will not work. The following example shows how to recover the original circuit in this case. - - ```python - from qiskit.circuit import Parameter - - qc = QuantumCircuit(3) - alpha1 = Parameter("alpha1") - alpha2 = Parameter("alpha2") - qc.ry(alpha1, [0]) - qc.rz(0.1, [0]) - qc.ry(alpha2, [1]) - qc.rz(alpha1, [1]) - qc.ry(0.2, [2]) - qc.rz(0.3, [2]) - ansatz, initial_params = parametrize_circuit(qc) - ansatz.assign_parameters( - { - param: val - for param, val in zip(ansatz.parameters, initial_params) - if val is not None - }, - inplace=True, - ) - ansatz.draw("mpl") - ``` - - ![Circuit diagram output by the previous code.](/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-9.svg) - - diff --git a/docs/api/qiskit-addon-aqc-tensor/index.mdx b/docs/api/qiskit-addon-aqc-tensor/index.mdx deleted file mode 100644 index 0c781f5f7f4..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/index.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Approximate quantum compilation (AQC-Tensor) API documentation (latest version) -description: Index of all the modules in the latest version of qiskit-addon-aqc-tensor. ---- - - - -# `qiskit-addon-aqc-tensor` API Reference - -* [Ansatz generation (`qiskit_addon_aqc_tensor.ansatz_generation`)](ansatz-generation) -* [Objective function(s) (`qiskit_addon_aqc_tensor.objective`)](objective) -* [Tensor network simulation (`qiskit_addon_aqc_tensor.simulation`)](simulation) -* [Aer simulation backend (`qiskit_addon_aqc_tensor.simulation.aer`)](simulation-aer) -* [Quimb simulation backend (`qiskit_addon_aqc_tensor.simulation.quimb`)](simulation-quimb) - diff --git a/docs/api/qiskit-addon-aqc-tensor/objective.mdx b/docs/api/qiskit-addon-aqc-tensor/objective.mdx deleted file mode 100644 index 68961c53d24..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/objective.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: objective (latest version) -description: API reference for qiskit_addon_aqc_tensor.objective in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 2 -python_api_type: module -python_api_name: qiskit_addon_aqc_tensor.objective ---- - - - - - -# Objective function(s) - -`qiskit_addon_aqc_tensor.objective` - -Code for building and evaluating objective functions used for AQC parameter optimization. - -Currently, this module provides the simplest possible objective function, [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity"). - -### MaximizeStateFidelity - - - Bases: [`object`](https://docs.python.org/3/library/functions.html#object) - - Simplest possible objective function for use with AQC-Tensor. - - Its definition is given by Eq. (7) in [arXiv:2301.08609v6](https://arxiv.org/abs/2301.08609v6): - -$$ -C = 1 - \left| \langle 0 | V^{\dagger}(\vec\theta) | \psi_\mathrm{target} \rangle \right|^2 . -$$ - - Minimizing this function is equivalent to maximizing the pure-state fidelity between the state prepared by the ansatz circuit at the current parameter point, $V(\vec\theta) |0\rangle$, and the target state, $| \psi_\mathrm{target} \rangle$. - - When called with an [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) of parameters, this object will return `(objective_value, gradient)` as a `tuple[float, numpy.ndarray]`. - - Initialize the objective function. - - **Parameters** - - * **ansatz** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – Parametrized ansatz circuit. - * **target** ([`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – Target state in tensor-network representation. - * **settings** ([`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) – Tensor network simulation settings. - - #### loss\_function - - - Evaluate `(objective_value, gradient)` of function at point `x`. - - **Return type** - - [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] - - **Parameters** - - **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) - - - #### target - - - Target tensor network. - - - -### OneMinusFidelity - - - Bases: [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity") - - DEPRECATED objective function, equivalent to [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity"). - - Initialize the objective function. - - The [`OneMinusFidelity`](#qiskit_addon_aqc_tensor.objective.OneMinusFidelity "qiskit_addon_aqc_tensor.objective.OneMinusFidelity") class is DEPRECATED since v0.2. Please migrate to [`MaximizeStateFidelity`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity") as soon as possible. - - - The class `qiskit_addon_aqc_tensor.objective.OneMinusFidelity` is deprecated as of qiskit-addon-aqc-tensor 0.2.0. It will be removed no earlier than v0.4.0. This class has been renamed to `MaximizeStateFidelity`. - - - **Parameters** - - * **ansatz** ([`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – Parametrized ansatz circuit. - * **target** ([`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – Target state in tensor-network representation. - * **settings** ([`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) – Tensor network simulation settings. - - #### \_\_call\_\_ - - - Evaluate `(objective_value, gradient)` of function at point `x`. - - This method is DEPRECATED since v0.2. The [`loss_function()`](#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function") method should be called instead. - - **Return type** - - [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] - - **Parameters** - - **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) - - - The method `qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.__call__()` is deprecated as of qiskit-addon-aqc-tensor 0.2.0. It will be removed no earlier than v0.4.0. Going forward, the `loss_function` method should be called instead of calling the instance directly. - - - - #### loss\_function - - - Evaluate `(objective_value, gradient)` of function at point `x`. - - **Return type** - - [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`float`](https://docs.python.org/3/library/functions.html#float), [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)] - - **Parameters** - - **x** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) - - - #### target - - - Target tensor network. - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/release-notes.mdx b/docs/api/qiskit-addon-aqc-tensor/release-notes.mdx deleted file mode 100644 index 98e4f4d51bf..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/release-notes.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Approximate quantum compilation (AQC-Tensor) release notes -description: Changes made to Approximate quantum compilation (AQC-Tensor) -in_page_toc_max_heading_level: 2 ---- - - - - - -# Approximate quantum compilation (AQC-Tensor) release notes - - - - - -## 0.2.0 - - - -### Prelude - -This release renames the primary objective to [`MaximizeStateFidelity`](objective#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity") and adds support for Qiskit 2.0. - - - -### New Features - -* Adds the [`parametrize_circuit()`](ansatz-generation#qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit "qiskit_addon_aqc_tensor.ansatz_generation.parametrize_circuit") function for generating a parametrized version of a given circuit. In contrast to [`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"), `parametrize_circuit` does not change the types of gates in the circuit. It simply replaces numerical parameters with free parameters. - -* Support for Python 3.13. - - - -### Upgrade Notes - -* The `OneMinusFidelity` objective function has been renamed and is now known as [`MaximizeStateFidelity`](objective#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity"). As a related change, one should now call the [`loss_function()`](objective#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity.loss_function") method to obtain the value and gradient of the loss function, instead of calling the instance directly (through its `__call__` method). - -* Qiskit SDK version 1.3 or higher is now required. Qiskit SDK version 2.0 is now supported. - - - -### Bug Fixes - -* This release fixes the import of `quimb_gate()` to work on versions of qiskit-quimb greater than 0.0.5. The aforementioned function is now imported from the toplevel `qiskit_quimb` instead of `qiskit_quimb.circuit`. - - - - - -## 0.1.1 - - - - - -### New Features - -* This release adds quimb-autograd as an optional dependency, so that one can now run `pip install 'qiskit-addon-aqc-tensor[quimb-autograd]'` to install the addon along with quimb and autograd. - - - - - -## 0.1.0 - - - - - -### Prelude - -Initial release. - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-mps.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-mps.mdx deleted file mode 100644 index f6bdbc0e20a..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-mps.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: QiskitAerMPS (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS ---- - -# QiskitAerMPS - - - Bases: [`TensorNetworkState`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - Qiskit Aer representation of a matrix-product state. - - This form of a matrix-product state was introduced in the original time-evolving block decimation (TEBD) paper, [https://arxiv.org/abs/quant-ph/0301063](https://arxiv.org/abs/quant-ph/0301063). See Sec. 7.3.2 of [https://arxiv.org/abs/1008.3477v2](https://arxiv.org/abs/1008.3477v2) for more details on the relationship with other MPS representations. - - ## Attributes - - **Parameters** - - * **gamma** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*,* [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*]]*) - * **lamb** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)*]*) - - ### gamma - - - Gamma matrices (list of 2-tuples of ndarrays, one for each site). - - - ### lamb - - - Lambda matrices (list of ndarrays, one for each bond between adjacent qubits). - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-simulation-settings.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-simulation-settings.mdx deleted file mode 100644 index 4988fc4deca..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-aer-qiskit-aer-simulation-settings.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: QiskitAerSimulationSettings (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings ---- - -# QiskitAerSimulationSettings - - - Bases: [`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings") - - Qiskit Aer simulator settings. - - Example usage: - - ```python - from qiskit_aer import AerSimulator - from qiskit_addon_aqc_tensor.simulation.aer import QiskitAerSimulationSettings - - simulator = AerSimulator( - method="matrix_product_state", - matrix_product_state_max_bond_dimension=200, - matrix_product_state_truncation_threshold=1e-6, - mps_log_data=True, - ) - - def my_simulation_callback(circuit, result): - print(f"Simulated circuit of depth {circuit.depth()}") - metadata = result.results[0].metadata - print(metadata["MPS_log_data"]) - - settings = QiskitAerSimulationSettings(simulator, my_simulation_callback) - ``` - - See additional options for when using the `matrix_product_state` simulation method in the documentation for [`AerSimulator`](https://qiskit.github.io/qiskit-aer/stubs/qiskit_aer.AerSimulator.html#qiskit_aer.AerSimulator "(in Qiskit Aer v0.16.1)"). - - ## Attributes - - **Parameters** - - * **simulator** (*AerSimulator*) - * **callback** (*Callable\[\[QuantumCircuit, Result], None] | None*) - - ### callback - - - This callable, if provided, is called with `(circuit, result)` as arguments immediately after each MPS simulation. - - - ### simulator - - - Aer simulator, must be configured with method=’matrix\_product\_state’. Stores configuration like `max_bond_dimension`, `truncation_threshold`, etc. - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-aer.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-aer.mdx deleted file mode 100644 index 63a91be1436..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-aer.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: aer (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.aer in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 2 -python_api_type: module -python_api_name: qiskit_addon_aqc_tensor.simulation.aer ---- - - - - - -# Aer simulation backend - -`qiskit_addon_aqc_tensor.simulation.aer` - -Qiskit Aer MPS simulator as a tensor network backend. - -| | | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | -| [`QiskitAerMPS`](simulation-aer-qiskit-aer-mps "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS") | Qiskit Aer representation of a matrix-product state. | -| [`QiskitAerSimulationSettings`](simulation-aer-qiskit-aer-simulation-settings "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings") | Qiskit Aer simulator settings. | - -## Functions - -### is\_aer\_available - - - Return `True` is qiskit-aer is installed, `False` otherwise. - - **Return type** - - [`bool`](https://docs.python.org/3/library/functions.html#bool) - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-qiskit-quimb-conversion-context.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-qiskit-quimb-conversion-context.mdx deleted file mode 100644 index 43161fa1e75..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-qiskit-quimb-conversion-context.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: QiskitQuimbConversionContext (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext ---- - -# QiskitQuimbConversionContext - - - Bases: [`object`](https://docs.python.org/3/library/functions.html#object) - - Contains information about Qiskit-to-Quimb conversion, necessary to recover Qiskit parameters. - - Initialize. Should not be called by users. - - **Parameters** - - **mapping** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*,* [*float*](https://docs.python.org/3/library/functions.html#float)*]]*) - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-circuit-factory.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-circuit-factory.mdx deleted file mode 100644 index 4d23612d6d9..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-circuit-factory.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: QuimbCircuitFactory (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory ---- - -# QuimbCircuitFactory - - - Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol) - - Quimb circuit factory. - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-simulator.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-simulator.mdx deleted file mode 100644 index 0113fc9a695..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb-quimb-simulator.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: QuimbSimulator (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 1 -python_api_type: class -python_api_name: qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator ---- - -# QuimbSimulator - - - Bases: [`TensorNetworkSimulationSettings`](simulation#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings") - - Settings for Quimb simulator. - - This is compatible with both [Quimb’s MPS simulator](https://quimb.readthedocs.io/en/latest/tensor/tensor-circuit-mps.html), which eagerly contracts gates by default, as well as [Quimb’s standard method for circuit simulation](https://quimb.readthedocs.io/en/latest/tensor/tensor-circuit.html). - - Example usage: - - ```python - from functools import partial - import quimb.tensor - from qiskit_addon_aqc_tensor.simulation.quimb import QuimbSimulator - - simulator_settings = QuimbSimulator( - partial( - quimb.tensor.CircuitMPS, - gate_opts={"cutoff": 1e-8}, - ), - autodiff_backend="jax", - ) - ``` - - For additional options, see the API documentation for [quimb.tensor.Circuit](https://quimb.readthedocs.io/en/main/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit) and [quimb.tensor.CircuitMPS](https://quimb.readthedocs.io/en/main/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.CircuitMPS). - - ## Attributes - - **Parameters** - - * **quimb\_circuit\_factory** ([*QuimbCircuitFactory*](simulation-quimb-quimb-circuit-factory "qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory")) - * **autodiff\_backend** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) - * **progbar** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) - - ### autodiff\_backend - - - - ### progbar - - - Whether to display a progress bar while applying gates. - - - ### quimb\_circuit\_factory - - - Callable for constructing the Quimb circuit, e.g., `Circuit()` or `CircuitMPS()`. - - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation-quimb.mdx deleted file mode 100644 index c22558e6d2c..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation-quimb.mdx +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: quimb (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation.quimb in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 2 -python_api_type: module -python_api_name: qiskit_addon_aqc_tensor.simulation.quimb ---- - - - - - -# Quimb simulation backend - -`qiskit_addon_aqc_tensor.simulation.quimb` - -Quimb as a tensor network backend. - -| | | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| [`QuimbCircuitFactory`](simulation-quimb-quimb-circuit-factory "qiskit_addon_aqc_tensor.simulation.quimb.QuimbCircuitFactory") | Quimb circuit factory. | -| [`QuimbSimulator`](simulation-quimb-quimb-simulator "qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator") | Settings for Quimb simulator. | -| [`QiskitQuimbConversionContext`](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext") | Contains information about Qiskit-to-Quimb conversion, necessary to recover Qiskit parameters. | - -## Functions - -### is\_quimb\_available - - - Return `True` is qiskit-quimb is installed, `False` otherwise. - - **Return type** - - [`bool`](https://docs.python.org/3/library/functions.html#bool) - - -### qiskit\_ansatz\_to\_quimb - - - Convert a Qiskit ansatz to a Quimb parametrized circuit. - - **Return type** - - [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple)\[[`Circuit`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit), [`QiskitQuimbConversionContext`](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext")] - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **initial\_parameters** ([*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence)*\[*[*float*](https://docs.python.org/3/library/functions.html#float)*]*) - - -### recover\_parameters\_from\_quimb - - - Recover Qiskit circuit parameters from a Quimb circuit. - - **Return type** - - [`list`](https://docs.python.org/3/library/stdtypes.html#list)\[[`float`](https://docs.python.org/3/library/functions.html#float)] - - **Parameters** - - * **circ\_opt** ([*Circuit*](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/circuit/index.html#quimb.tensor.circuit.Circuit)) - * **ctx** ([*QiskitQuimbConversionContext*](simulation-quimb-qiskit-quimb-conversion-context "qiskit_addon_aqc_tensor.simulation.quimb.QiskitQuimbConversionContext")) - - -### tnoptimizer\_objective\_kwargs - - - Return keyword arguments for use with `TNOptimizer()`. :rtype: [`dict`](https://docs.python.org/3/library/stdtypes.html#dict)\[[`str`](https://docs.python.org/3/library/stdtypes.html#str), [`Any`](https://docs.python.org/3/library/typing.html#typing.Any)] - - * `loss_fn` - * `loss_kwargs` - - **Parameters** - - **objective** ([*MaximizeStateFidelity*](objective#qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity "qiskit_addon_aqc_tensor.objective.MaximizeStateFidelity")) - - **Return type** - - [dict](https://docs.python.org/3/library/stdtypes.html#dict)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any)] - - diff --git a/docs/api/qiskit-addon-aqc-tensor/simulation.mdx b/docs/api/qiskit-addon-aqc-tensor/simulation.mdx deleted file mode 100644 index 6ac0123ea68..00000000000 --- a/docs/api/qiskit-addon-aqc-tensor/simulation.mdx +++ /dev/null @@ -1,201 +0,0 @@ ---- -title: simulation (latest version) -description: API reference for qiskit_addon_aqc_tensor.simulation in the latest version of qiskit-addon-aqc-tensor -in_page_toc_min_heading_level: 2 -python_api_type: module -python_api_name: qiskit_addon_aqc_tensor.simulation ---- - - - - - -# Tensor network simulation - -`qiskit_addon_aqc_tensor.simulation` - -This module provides an interface to tensor-network simulation that is agnostic to which backend is used. - -Currently, there is a single implementation, which uses the Qiskit Aer matrix-product state (MPS) simulator as its backend. - -## Available backends - -* [`qiskit_addon_aqc_tensor.simulation.aer`](simulation-aer#module-qiskit_addon_aqc_tensor.simulation.aer "qiskit_addon_aqc_tensor.simulation.aer") -* [`qiskit_addon_aqc_tensor.simulation.quimb`](simulation-quimb#module-qiskit_addon_aqc_tensor.simulation.quimb "qiskit_addon_aqc_tensor.simulation.quimb") - -## Functions - -The following functions provide a common interface that can be used with any supported backend. Regardless of which backend you use, you will invoke these functions as a common interface. - -In each function below, the documentation shows every distinct implementation available for that function. The addon will choose which implementation to use based on the types of the arguments that you provide. (This paradigm is called “multiple dispatch”.) - -### tensornetwork\_from\_circuit - - - Create a tensor-network state by simulating a quantum circuit. - - The type of tensor-network state will correspond to the type of the `settings` object. For instance, a [`QiskitAerSimulationSettings`](simulation-aer-qiskit-aer-simulation-settings "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerSimulationSettings") will result in this function returning a [`QiskitAerMPS`](simulation-aer-qiskit-aer-mps "qiskit_addon_aqc_tensor.simulation.aer.QiskitAerMPS"). - - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - - **Return type** - - [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - - **Return type** - - [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - - **Return type** - - [`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - - -### apply\_circuit\_to\_state - - - Apply a quantum circuit to a tensor network state. - - The input state (`psi`) is not modified. - - **Return type** - - [`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - **Returns** - - The new state. - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) - - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) - - **Return type** - - [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) - - **Return type** - - [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - - Apply a quantum circuit to a tensor network state. - - The input state (`psi`) is not modified. - - **Returns** - - The new state. - - **Parameters** - - * **qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) - * **psi** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **settings** ([*TensorNetworkSimulationSettings*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkSimulationSettings "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkSimulationSettings")) - * **out\_state** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) - - **Return type** - - [*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState") - - -### compute\_overlap - - - Compute overlap of two quantum states: $\langle \psi_1 | \psi_2 \rangle$. - - NOTE: Unlike `numpy.dot`, implementations of this method will perform complex conjugation on the first argument. - - **Parameters** - - * **psi\_1** ([`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – first quantum state. - * **psi\_2** ([`TensorNetworkState`](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) – second quantum state. - - **Return type** - - [`complex`](https://docs.python.org/3/library/functions.html#complex) - - **Returns** - - complex dot product value. - - - **Parameters** - - * **psi\_1** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **psi\_2** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - - **Return type** - - [complex](https://docs.python.org/3/library/functions.html#complex) - - - - **Parameters** - - * **psi\_1** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - * **psi\_2** ([*TensorNetworkState*](#qiskit_addon_aqc_tensor.simulation.TensorNetworkState "qiskit_addon_aqc_tensor.simulation.abstract.TensorNetworkState")) - - **Return type** - - [complex](https://docs.python.org/3/library/functions.html#complex) - - - -## Abstract classes - -These are abstract classes, implemented by each backend. - -### TensorNetworkState - - - Bases: [`object`](https://docs.python.org/3/library/functions.html#object) - - Abstract tensor network state. - - -### TensorNetworkSimulationSettings - - - Bases: [`object`](https://docs.python.org/3/library/functions.html#object) - - Abstract truncation settings. - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-1.svg deleted file mode 100644 index 2b6f3824d3b..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-1.svg +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - - 2025-03-28T17:48:30.194901 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-2.svg deleted file mode 100644 index a509239268d..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-2.svg +++ /dev/null @@ -1,1166 +0,0 @@ - - - - - - - - 2025-03-28T17:48:31.020542 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-3.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-3.svg deleted file mode 100644 index 9ee3e0fe050..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-3.svg +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - - - - 2025-03-28T17:48:31.270177 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-4.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-4.svg deleted file mode 100644 index 9782eb94e8c..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-4.svg +++ /dev/null @@ -1,1956 +0,0 @@ - - - - - - - - 2025-03-28T17:48:31.739954 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-5.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-5.svg deleted file mode 100644 index fc623d5032d..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-5.svg +++ /dev/null @@ -1,2377 +0,0 @@ - - - - - - - - 2025-03-28T17:48:32.155601 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-6.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-6.svg deleted file mode 100644 index 44216b711cb..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-6.svg +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - - 2025-03-28T17:48:32.517719 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-7.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-7.svg deleted file mode 100644 index 52569b9ed56..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-7.svg +++ /dev/null @@ -1,885 +0,0 @@ - - - - - - - - 2025-03-28T17:48:32.704648 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-8.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-8.svg deleted file mode 100644 index 00df8f09039..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-8.svg +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - - 2025-03-28T17:48:33.058567 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-9.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-9.svg deleted file mode 100644 index 3a0bbb2dfe7..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/ansatz_generation-9.svg +++ /dev/null @@ -1,542 +0,0 @@ - - - - - - - - 2025-03-28T17:48:33.157016 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg deleted file mode 100644 index f1ceecc12ba..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-1.svg +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - 2025-03-28T17:48:30.883567 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg deleted file mode 100644 index 253a218a1eb..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-KAK-2.svg +++ /dev/null @@ -1,635 +0,0 @@ - - - - - - - - 2025-03-28T17:48:31.172269 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg deleted file mode 100644 index d257a54c6a4..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-1.svg +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - 2025-03-28T17:48:32.331085 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg b/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg deleted file mode 100644 index 20f962b200b..00000000000 --- a/public/docs/images/api/qiskit-addon-aqc-tensor/qiskit_addon_aqc_tensor-ansatz_generation-ZXZ-2.svg +++ /dev/null @@ -1,338 +0,0 @@ - - - - - - - - 2025-03-28T17:48:32.414288 - image/svg+xml - - - Matplotlib v3.9.4, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -