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

240 lines
6.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: T1Fitter (v0.29)
description: API reference for qiskit.ignis.characterization.T1Fitter in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.ignis.characterization.T1Fitter
---
# T1Fitter
<Class id="qiskit.ignis.characterization.T1Fitter" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/characterization/coherence/fitters.py" signature="T1Fitter(backend_result, xdata, qubits, fit_p0, fit_bounds, time_unit='micro-seconds')" modifiers="class">
Bases: `qiskit.ignis.characterization.fitters.BaseCoherenceFitter`
Estimate T1, based on experiments outcomes,
The experiments were created by t1\_circuits, and executed on the device.
The probabilities of measuring 1 is assumed to be of the form
$$
f(t) = A\mathrm{e}^{-t/T_1}+B,
$$
for unknown parameters A, B, and T1.
**Parameters**
* **backend\_result** (`Result`) result of execution of t1\_circuits on the backend.
* **xdata** (`Union`\[`List`\[`float`], `array`]) delay times of the T1 circuits.
* **qubits** (`List`\[`int`]) indices of the qubits whose T1s are to be measured.
* **fit\_p0** (`List`\[`float`]) initial values to the fit parameters, where the order is $(A, T_1, B)$.
* **fit\_bounds** (`Tuple`\[`List`\[`float`], `List`\[`float`]]) bounds on the parameters to fit. The first tuple is the lower bounds, in the order $(A, T_1, B)$. The second tuple is the upper bounds.
* **time\_unit** (`str`) unit of delay times in xdata.
## Methods
<span id="qiskit-ignis-characterization-t1fitter-add-data" />
### add\_data
<Function id="qiskit.ignis.characterization.T1Fitter.add_data" signature="T1Fitter.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-t1fitter-fit-data" />
### fit\_data
<Function id="qiskit.ignis.characterization.T1Fitter.fit_data" signature="T1Fitter.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-t1fitter-plot" />
### plot
<Function id="qiskit.ignis.characterization.T1Fitter.plot" signature="T1Fitter.plot(qind, series='0', ax=None, show_plot=False)">
Plot coherence data.
**Parameters**
* **qind** qubit index to plot
* **series** which series to plot (if list then plot multiple)
* **ax** plot axes
* **show\_plot** whether to call plt.show()
**Returns**
The axes object
**Return type**
Axes
**Raises**
**ImportError** if matplotlib is not installed
</Function>
<span id="qiskit-ignis-characterization-t1fitter-time" />
### time
<Function id="qiskit.ignis.characterization.T1Fitter.time" signature="T1Fitter.time(qid=- 1, series='0')">
Return the characteristic time for the given qubit and series
**Parameters**
* **qid** (`int`) the qubit index (or all qubits if -1)
* **series** (`str`) the series to get
**Return type**
`Union`\[`float`, `List`\[`float`]]
**Returns**
The characteristic time of the qubit, or all qubits
</Function>
<span id="qiskit-ignis-characterization-t1fitter-time-err" />
### time\_err
<Function id="qiskit.ignis.characterization.T1Fitter.time_err" signature="T1Fitter.time_err(qid=- 1, series='0')">
Return the error of characteristic time for the given qubit and series
**Parameters**
* **qid** (`int`) the qubit index (or all qubits if -1)
* **series** (`str`) the series to get
**Return type**
`Union`\[`float`, `List`\[`float`]]
**Returns**
The error of the characteristic time of the qubit, or all qubits
</Function>
## Attributes
### backend\_result
<Attribute id="qiskit.ignis.characterization.T1Fitter.backend_result">
Return the execution results
**Return type**
`Union`\[`Result`, `List`\[`Result`]]
</Attribute>
### description
<Attribute id="qiskit.ignis.characterization.T1Fitter.description">
Return the fitters purpose, e.g. T1
**Return type**
`str`
</Attribute>
### fit\_fun
<Attribute id="qiskit.ignis.characterization.T1Fitter.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.T1Fitter.measured_qubits">
Return the indices of the qubits to be characterized
**Return type**
`List`\[`int`]
</Attribute>
### params
<Attribute id="qiskit.ignis.characterization.T1Fitter.params">
Return the fit function parameters that were calculated by curve\_fit
**Return type**
`List`\[`float`]
</Attribute>
### params\_err
<Attribute id="qiskit.ignis.characterization.T1Fitter.params_err">
Return the error of the fit function parameters
**Return type**
`List`\[`float`]
</Attribute>
### series
<Attribute id="qiskit.ignis.characterization.T1Fitter.series">
Return the list of series for the data
**Return type**
`Optional`\[`List`\[`str`]]
</Attribute>
### xdata
<Attribute id="qiskit.ignis.characterization.T1Fitter.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.T1Fitter.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>