qiskit-documentation/docs/api/qiskit/0.29/qiskit.ignis.verification.C...

170 lines
5.9 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: CNOTDihedralRBFitter
description: API reference for qiskit.ignis.verification.CNOTDihedralRBFitter
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.ignis.verification.CNOTDihedralRBFitter
---
# CNOTDihedralRBFitter
<Class id="qiskit.ignis.verification.CNOTDihedralRBFitter" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/verification/randomized_benchmarking/fitters.py" signature="CNOTDihedralRBFitter(cnotdihedral_Z_result, cnotdihedral_X_result, elmnts_lengths, rb_pattern=None)" modifiers="class">
Bases: `qiskit.ignis.verification.randomized_benchmarking.fitters.RBFitterBase`
Class for fitters for non-Clifford CNOT-Dihedral RB.
Derived from RBFitterBase class. Contains two RBFitter objects.
**Parameters**
* **cnotdihedral\_Z\_result** (*qiskit.Result*) list of results of the RB sequence that measures the ground state.
* **cnotdihedral\_X\_result** (*qiskit.Result*) list of results of the RB sequence that measures the $|+...+>$ state.
* **elmnts\_lengths** (*list*) the group elements lengths, 2D list i x j where i is the number of patterns, j is the number of elements lengths.
* **rb\_pattern** (*list*) the pattern for the RB sequences.
## Methods
### add\_data
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.add_data" signature="CNOTDihedralRBFitter.add_data(new_cnotdihedral_Z_result, new_cnotdihedral_X_result, rerun_fit=True)">
Add a new result.
**Parameters**
* **new\_cnotdihedral\_Z\_result** (*list*) list of rb results of the cnot-dihedral Z circuits.
* **new\_cnotdihedral\_X\_result** (*list*) list of rb results of the cnot-dihedral X circuits.
* **rerun\_fit** (*bool*) re-calculate the means and fit the result.
#### Additional information:
Assumes that the executed result is the output of circuits generated by randomized\_benchmarking\_seq.
</Function>
### calc\_data
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.calc_data" signature="CNOTDihedralRBFitter.calc_data()">
Retrieve probabilities of success from execution results. Outputs results into an internal variable: \_raw\_data .
</Function>
### calc\_statistics
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.calc_statistics" signature="CNOTDihedralRBFitter.calc_statistics()">
Extract averages and std dev. Outputs results into an internal variable: \_ydata .
</Function>
### fit\_data
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.fit_data" signature="CNOTDihedralRBFitter.fit_data()">
Fit the non-Clifford cnot-dihedral RB results.
Fit each of the patterns. According to the paper:
[Scalable randomized benchmarking of non-Clifford gates](https://www.nature.com/articles/npjqi201612)
**Returns**
A list of dictionaries where each dictionary corresponds to a pattern and has fields:
> * `alpha` - alpha parameter of the non-Clifford cnot-dihedral RB.
> * `'alpha_err` - the error of the alpha parameter of the non-Clifford cnot-dihedral RB.
> * `epg_est` - the estimated error per a CNOT-dihedral element.
> * `epg_est_error` - the estimated error derived from the params\_err.
**Return type**
list
</Function>
### fit\_data\_pattern
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.fit_data_pattern" signature="CNOTDihedralRBFitter.fit_data_pattern(patt_ind, fit_guess, fit_index=0)">
Fit the RB results of a particular pattern to an exponential curve.
**Parameters**
* **patt\_ind** (*int*) index of the data pattern to fit.
* **fit\_guess** (*list*) guess values for the fit.
* **fit\_index** (*int*) 0 fit the standard data, 1 fit the interleaved data.
</Function>
### plot\_rb\_data
<Function id="qiskit.ignis.verification.CNOTDihedralRBFitter.plot_rb_data" signature="CNOTDihedralRBFitter.plot_rb_data(pattern_index=0, ax=None, add_label=True, show_plt=True)">
Plot non-Clifford cnot-dihedral randomized benchmarking data of a single pattern.
**Parameters**
* **pattern\_index** (*int*) which RB pattern to plot.
* **ax** (*Axes*) plot axis (if passed in).
* **add\_label** (*bool*) Add an EPG label.
* **show\_plt** (*bool*) display the plot.
**Raises**
**ImportError** if matplotlib is not installed.
</Function>
## Attributes
### cliff\_lengths
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.cliff_lengths">
Return group elements lengths.
</Attribute>
### fit
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.fit">
Return fit as a 2 element list.
</Attribute>
### fit\_cnotdihedral
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.fit_cnotdihedral">
Return cnotdihedral fit parameters.
</Attribute>
### raw\_data
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.raw_data">
Return raw\_data as 2 element list.
</Attribute>
### rb\_fit\_fun
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.rb_fit_fun">
Return the fit function rb\_fit\_fun.
</Attribute>
### rbfit\_X
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.rbfit_X">
Return the cnotdihedral X fitter.
</Attribute>
### rbfit\_Z
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.rbfit_Z">
Return the cnotdihedral Z fitter.
</Attribute>
### results
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.results">
Return all the results as a 2 element list.
</Attribute>
### seeds
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.seeds">
Return the number of loaded seeds as a 2 element list.
</Attribute>
### ydata
<Attribute id="qiskit.ignis.verification.CNOTDihedralRBFitter.ydata">
Return ydata (means and std devs) as a 2 element list.
</Attribute>
</Class>