qiskit-documentation/docs/api/qiskit-addon-cutting/0.9/qpd-qpd-basis.mdx

94 lines
3.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: QPDBasis (v0.9)
description: API reference for qiskit_addon_cutting.qpd.QPDBasis in qiskit-addon-cutting v0.9
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit_addon_cutting.qpd.QPDBasis
---
# QPDBasis
<Class id="qiskit_addon_cutting.qpd.QPDBasis" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-addon-cutting/tree/stable/0.9/qiskit_addon_cutting/qpd/qpd_basis.py" signature="QPDBasis(maps, coeffs)" modifiers="class">
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")
Basis in which to decompose an operation.
This class defines a basis in which a quantum operation will be decomposed. The ideal (noise-free) quantum operation will be decomposed into a quasiprobabilistic mixture of noisy circuits.
Assign member variables.
**Parameters**
* **maps** ([`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.13)")\[[`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")\[[`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.13)")\[[`Instruction`](/api/qiskit/qiskit.circuit.Instruction "(in Qiskit v1.3)")], [`...`](https://docs.python.org/3/library/constants.html#Ellipsis "(in Python v3.13)")]]) A sequence of tuples describing the noisy operations probabilistically used to simulate an ideal quantum operation.
* **coeffs** ([`Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.13)")\[[`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")]) Coefficients for quasiprobability representation. Each coefficient can be any real number.
**Returns**
None
## Attributes
### coeffs
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.coeffs">
Quasiprobability decomposition coefficients.
</Attribute>
### kappa
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.kappa">
Get the square root of the sampling overhead.
This quantity is the sum of the magnitude of the coefficients.
</Attribute>
### maps
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.maps">
Get mappings for each qubit in the decomposition.
</Attribute>
### num\_qubits
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.num_qubits">
Get number of qubits that this decomposition acts on.
</Attribute>
### overhead
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.overhead">
Get the sampling overhead.
The sampling overhead is the square of the sum of the magnitude of the coefficients.
</Attribute>
### probabilities
<Attribute id="qiskit_addon_cutting.qpd.QPDBasis.probabilities">
Get the probabilities on which the maps will be sampled.
</Attribute>
## Methods
### from\_instruction
<Function id="qiskit_addon_cutting.qpd.QPDBasis.from_instruction" signature="from_instruction(gate, /)" modifiers="static">
Generate a [`QPDBasis`](#qiskit_addon_cutting.qpd.QPDBasis "qiskit_addon_cutting.qpd.QPDBasis") object, given a supported operation.
This static method is provided for convenience; it simply calls `qpdbasis_from_instruction()` under the hood.
**Parameters**
**gate** ([`Instruction`](/api/qiskit/qiskit.circuit.Instruction "(in Qiskit v1.3)")) The instruction from which to instantiate a decomposition
**Return type**
[`QPDBasis`](#qiskit_addon_cutting.qpd.QPDBasis "qiskit_addon_cutting.qpd.qpd_basis.QPDBasis")
**Returns**
The newly-instantiated [`QPDBasis`](#qiskit_addon_cutting.qpd.QPDBasis "qiskit_addon_cutting.qpd.QPDBasis") object
</Function>
</Class>