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

63 lines
2.1 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: calculate_1q_epc
description: API reference for qiskit.ignis.verification.calculate_1q_epc
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.ignis.verification.calculate_1q_epc
---
# qiskit.ignis.verification.calculate\_1q\_epc
<Function id="qiskit.ignis.verification.calculate_1q_epc" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/verification/randomized_benchmarking/rb_utils.py" signature="calculate_1q_epc(gate_per_cliff, epg_1q, qubit)">
Convert error per gate (EPG) into error per Clifford (EPC) of single qubit basis gates.
Given that we know the number of gates per Clifford $N_i$ and those EPGs, we can predict EPC of that RB sequence:
$$
EPC = 1 - \prod_i \left( 1 - EPG_i \right)^{N_i}
$$
To run this function, you need to know EPG of every single qubit basis gates. For example, when you prepare 1Q RB experiment with appropriate error model, you can define EPG of those basis gate set. Then you can estimate the EPC of prepared RB sequence without running experiment.
```python
import qiskit.ignis.verification.randomized_benchmarking as rb
# gate counts of your 1Q RB experiment
gpc = {0: {'cx': 0, 'u1': 0.13, 'u2': 0.31, 'u3': 0.51}}
# EPGs from error model
epgs_q0 = {'u1': 0, 'u2': 0.001, 'u3': 0.002}
# calculate 1Q EPC
epc = rb.rb_utils.calculate_1q_epc(
gate_per_cliff=gpc,
epg_1q=epgs_q0,
qubit=0)
print(epc)
```
```python
0.0013302908430798954
```
**Parameters**
* **gate\_per\_cliff** (`Dict`\[`int`, `Dict`\[`str`, `float`]]) dictionary of gate per Clifford. see [`gates_per_clifford()`](qiskit.ignis.verification.gates_per_clifford "qiskit.ignis.verification.gates_per_clifford").
* **epg\_1q** (`Dict`\[`str`, `float`]) EPG of single qubit gates estimated by error model.
* **qubit** (`int`) index of qubit to calculate EPC.
**Return type**
`float`
**Returns**
EPG of 2Q gate.
**Raises**
**QiskitError** when specified `qubit` is not included in the gate count dictionary
</Function>