qiskit-documentation/docs/api/qiskit/0.31/qiskit.ignis.characterizati...

221 lines
5.5 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: DragFitter (v0.31)
description: API reference for qiskit.ignis.characterization.DragFitter in qiskit v0.31
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.ignis.characterization.DragFitter
---
# DragFitter
<Class id="qiskit.ignis.characterization.DragFitter" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/characterization/calibrations/fitters.py" signature="DragFitter(backend_result, xdata, qubits, fit_p0, fit_bounds=None)" modifiers="class">
Bases: `qiskit.ignis.characterization.fitters.IQFitter`
Drag Experiment fitter
See IQFitter \_\_init\_\_
fit\_p0 is \[a, x0, c] where the fit is a\*(x-x0)^2+c
## Methods
<span id="qiskit-ignis-characterization-dragfitter-add-data" />
### add\_data
<Function id="qiskit.ignis.characterization.DragFitter.add_data" signature="DragFitter.add_data(results, recalc=True, refit=True)">
Add new execution results to previous execution results
**Parameters**
* **results** (`Union`\[`Result`, `List`\[`Result`]]) new execution results
* **recalc** (`bool`) whether tp recalculate the data
* **refit** (`bool`) whether to refit the data
</Function>
<span id="qiskit-ignis-characterization-dragfitter-drag-amplitude" />
### drag\_amplitude
<Function id="qiskit.ignis.characterization.DragFitter.drag_amplitude" signature="DragFitter.drag_amplitude(qind=- 1)">
Return the drag amplitude from the fit
**Parameters**
**qind** (*int*) qubit index
**Returns**
drag amp
**Return type**
float
</Function>
<span id="qiskit-ignis-characterization-dragfitter-fit-data" />
### fit\_data
<Function id="qiskit.ignis.characterization.DragFitter.fit_data" signature="DragFitter.fit_data(qid=- 1, p0=None, bounds=None, series=None)">
Fit the curve.
Compute self.\_params and self.\_params\_err
**Parameters**
* **qid** (`int`) qubit for fitting. If -1 fit for all the qubits
* **p0** (`Optional`\[`List`\[`float`]]) initial guess, equivalent to p0 in scipy.optimize
* **bounds** (`Optional`\[`Tuple`\[`List`\[`float`], `List`\[`float`]]]) bounds, equivalent to bounds in scipy.optimize
* **series** (`Optional`\[`str`]) series to fit (if None fit all)
</Function>
<span id="qiskit-ignis-characterization-dragfitter-guess-params" />
### guess\_params
<Function id="qiskit.ignis.characterization.DragFitter.guess_params" signature="DragFitter.guess_params(qind=0)">
Guess parameters for the drag fit
**Parameters**
**qind** (*int*) qubit index
**Returns**
**guess parameters**
\[a, x0, c] where the fit is $a * (x - x0)^{2+c}$
**Return type**
list
</Function>
<span id="qiskit-ignis-characterization-dragfitter-plot" />
### plot
<Function id="qiskit.ignis.characterization.DragFitter.plot" signature="DragFitter.plot(qind, series='0', ax=None, show_plot=False)">
Plot the data and fit
**Parameters**
* **qind** (*int*) qubit index
* **series** (*str*) data series to plot (for rabi data always 0)
* **ax** (*Axes*) matploblib axes (if none created)
* **show\_plot** (*bool*) do plot.show
**Returns**
Plot axes
**Return type**
Axes
</Function>
## Attributes
### backend\_result
<Attribute id="qiskit.ignis.characterization.DragFitter.backend_result">
Return the execution results
**Return type**
`Union`\[`Result`, `List`\[`Result`]]
</Attribute>
### description
<Attribute id="qiskit.ignis.characterization.DragFitter.description">
Return the fitters purpose, e.g. T1
**Return type**
`str`
</Attribute>
### fit\_fun
<Attribute id="qiskit.ignis.characterization.DragFitter.fit_fun">
Return the function used in the fit, e.g. BaseFitter.\_exp\_fit\_fun
**Return type**
`Callable`
</Attribute>
### measured\_qubits
<Attribute id="qiskit.ignis.characterization.DragFitter.measured_qubits">
Return the indices of the qubits to be characterized
**Return type**
`List`\[`int`]
</Attribute>
### params
<Attribute id="qiskit.ignis.characterization.DragFitter.params">
Return the fit function parameters that were calculated by curve\_fit
**Return type**
`List`\[`float`]
</Attribute>
### params\_err
<Attribute id="qiskit.ignis.characterization.DragFitter.params_err">
Return the error of the fit function parameters
**Return type**
`List`\[`float`]
</Attribute>
### series
<Attribute id="qiskit.ignis.characterization.DragFitter.series">
Return the list of series for the data
**Return type**
`Optional`\[`List`\[`str`]]
</Attribute>
### xdata
<Attribute id="qiskit.ignis.characterization.DragFitter.xdata">
Return the data points on the x-axis, the independenet parameter which is fit against
**Return type**
`Union`\[`List`\[`float`], `array`]
</Attribute>
### ydata
<Attribute id="qiskit.ignis.characterization.DragFitter.ydata">
Return the data points on the y-axis
The data points are returning in the form of a list of dictionaries:
> * **ydata\[i]\[mean] is a list, where item**
>
> no. j is the probability of success of qubit i for a circuit that lasts xdata\[j].
>
> * **ydata\[i]\[std] is a list, where ydata\[std]\[j] is the**
>
> standard deviation of the success of qubit i.
**Return type**
`List`\[`Dict`]
</Attribute>
</Class>