qiskit.ignis.verification.calculate_1q_epg¶
-
calculate_1q_epg
(gate_per_cliff, epc_1q, qubit)[source]¶ Convert error per Clifford (EPC) into error per gates (EPGs) of single qubit basis gates.
Given that a standard 1Q RB sequences consist of
u1
,u2
andu3
gates, the EPC can be written using those EPGs:EPC=1−(1−EPGU1)NU1(1−EPGU2)NU2(1−EPGU3)NU3.where Nx is the number of gate x per Clifford. Assuming
u1
composed of virtual-Z gate, ie FrameChange instruction, the EPGU1 is estimated to be zero within the range of quantization error. Therefore the EPC can be written as:EPC=1−(1−EPGU2)NU2(1−EPGU3)NU3.Because
u2
andu3
gates are respectively implemented by a single and two half-pi pulses with virtual-Z rotations, we assume EPGU3=2EPGU2. Using this relation in the limit of EPGU2≪1:EPC=1−(1−EPGU2)NU2(1−2EPGU2)NU3≃EPGU2(NU2+2NU3).Finally the EPG of each basis gate can be written using EPC and number of gates:
EPGU1=0EPGU2=EPC/(NU2+2NU3)EPGU3=2EPC/(NU2+2NU3)To run this function, you first need to run a standard 1Q RB experiment with transpiled
QuantumCircuit
and count the number of basis gates composing the RB circuits.import pprint import qiskit.ignis.verification.randomized_benchmarking as rb # assuming we ran 1Q RB experiment for qubit 0 gpc = {0: {'cx': 0, 'u1': 0.13, 'u2': 0.31, 'u3': 0.51}} epc = 1.5e-3 # calculate 1Q EPGs epgs = rb.rb_utils.calculate_1q_epg(gate_per_cliff=gpc, epc_1q=epc, qubit=0) pprint.pprint(epgs)
{'u1': 0, 'u2': 0.0011278195488721805, 'u3': 0.002255639097744361}
In the example,
gpc
can be generated bygates_per_clifford()
. The output of the functionepgs
can be used to calculate EPG of CNOT gate in conjugation with 2Q RB results, seecalculate_2q_epg()
.Note
This function presupposes the basis gate consists of
u1
,u2
andu3
.- Parameters
gate_per_cliff (
Dict
[int
,Dict
[str
,float
]]) – dictionary of gate per Clifford. seegates_per_clifford()
.epc_1q (
float
) – EPC fit from 1Q RB experiment data.qubit (
int
) – index of qubit to calculate EPGs.
- Return type
Dict
[str
,float
]- Returns
Dictionary of EPGs of single qubit basis gates.
- Raises
QiskitError – when
u2
oru3
is not found,cx
gate count is nonzero, or specified qubit is not included in the gate count dictionary.