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

96 lines
4.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: GatesetTomographyFitter (v0.29)
description: API reference for qiskit.ignis.verification.GatesetTomographyFitter in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.ignis.verification.GatesetTomographyFitter
---
# GatesetTomographyFitter
<Class id="qiskit.ignis.verification.GatesetTomographyFitter" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/verification/tomography/fitters/gateset_fitter.py" signature="GatesetTomographyFitter(result, circuits, gateset_basis='default')" modifiers="class">
Bases: `object`
Initialize gateset tomography fitter with experimental data.
**Parameters**
* **result** (`Result`) a Qiskit Result object obtained from executing tomography circuits.
* **circuits** (`List`) a list of circuits or circuit names to extract count information from the result object.
* **gateset\_basis** (`Union`\[`GateSetBasis`, `str`]) (default: default) Representation of
* **gates and SPAM circuits of the gateset** (*the*)
**Additional information:**
The fitter attempts to output a GST result from the collected experimental data. The output will be a dictionary of the computed operators for the gates, as well as the measurment operator and initial state of the system.
The input for the fitter consists of the experimental data collected by the backend, the circuits on which it operated and the gateset basis used when collecting the data.
Example:
```python
from qiskit.circuits.library.standard import *
from qiskit.ignis.verification.basis import default_gateset_basis
from qiskit.ignis.verification import gateset_tomography_circuits
from qiskit.ignis.verification import GateSetTomographyFitter
gate = HGate()
basis = default_gateset_basis()
basis.add_gate(gate)
backend = ...
circuits = gateset_tomography_circuits(gateset_basis=basis)
qobj = assemble(circuits, shots=10000)
result = backend.run(qobj).result()
fitter = GatesetTomographyFitter(result, circuits, basis)
result_gates = fitter.fit()
result_gate = result_gates[gate.name]
```
## Methods
<span id="qiskit-ignis-verification-gatesettomographyfitter-fit" />
### fit
<Function id="qiskit.ignis.verification.GatesetTomographyFitter.fit" signature="GatesetTomographyFitter.fit()">
Reconstruct a gate set from measurement data using optimization.
**Returns**
its approximation found using the optimization process.
**Return type**
For each gate in the gateset
#### Additional Information:
The gateset optimization process con/.sists of three phases: 1) Use linear inversion to obtain an initial approximation. 2) Use gauge optimization to ensure the linear inversion results are close enough to the expected optimization outcome to serve as a suitable starting point 3) Use MLE optimization to obtain the final outcome
</Function>
<span id="qiskit-ignis-verification-gatesettomographyfitter-linear-inversion" />
### linear\_inversion
<Function id="qiskit.ignis.verification.GatesetTomographyFitter.linear_inversion" signature="GatesetTomographyFitter.linear_inversion()">
Reconstruct a gate set from measurement data using linear inversion.
**Returns**
its approximation found using the linear inversion process.
**Return type**
For each gate in the gateset
#### Additional Information:
Given a gate set (G1,…,Gm) and SPAM circuits (F1,…,Fn) constructed from those gates the data should contain the probabilities of the following types: p\_ijk = E\*F\_i\*G\_k\*F\_j\*rho p\_ij = E\*F\_i\*F\_j\*rho
We have p\_ijk = self.probs\[(Fj, Gk, Fi)] since in self.probs (Fj, Gk, Fi) indicates first applying Fj, then Gk, then Fi.
One constructs the Gram matrix g = (p\_ij)\_ij which can be described as a product g=AB where A = sum (i> \<E F\_i) and B=sum (F\_j rho>\<j) For each gate Gk one can also construct the matrix Mk=(pijk)\_ij which can be described as Mk=A\*Gk\*B Inverting g we obtain g^-1 = B^-1A^-1 and so g^1 \* Mk = B^-1 \* Gk \* B This gives us a matrix similiar to Gks representing matrix. However, it will not be the same as Gk, since the observable results cannot distinguish between (G1,…,Gm) and (B^-1\*G1\*B,…,B^-1\*Gm\*B) a further step of *Gauge optimization* is required on the results of the linear inversion stage. One can also use the linear inversion results as a starting point for a MLE optimization for finding a physical gateset, since unless the probabilities are accurate, the resulting gateset need not be physical.
</Function>
</Class>