def pauli_gate_error_counts(shots, hex_counts=True): """Pauli gate error circuits reference counts""" counts_lists = [] # 100% all-qubit Pauli error on "id" gates counts = [0, 0, 0, shots] counts_lists.append(counts) # 25% all-qubit Pauli error on "id" gates counts = [9 * shots / 16, 3 * shots / 16, 3 * shots / 16, shots / 16] counts_lists.append(counts) # 100% Pauli error on "id" gates on qubit-1 counts = [0, 0, shots, 0] counts_lists.append(counts) # 25% all-qubit Pauli error on "id" gates on qubit-0 counts = [3 * shots / 4, shots / 4, 0, 0] counts_lists.append(counts) # 50% Pauli error on conditional gate that doesn't get applied counts = [shots, 0, 0, 0] counts_lists.append(counts) # 50% Pauli error on conditional gate that does get applied counts = 4 * [shots / 4] counts_lists.append(counts) # 25% Pauli-X error on spectator for CX gate on [0, 1] counts = [3 * shots / 4, 0, 0, 0, shots / 4, 0, 0, 0] counts_lists.append(counts) return [list2dict(i, hex_counts) for i in counts_lists]
def reset_gate_error_counts(shots, hex_counts=True): """Reset gate error circuits reference counts""" counts_lists = [] # 50% reset to 0 state on qubit 0 counts = [0, 0, shots / 2, shots / 2] counts_lists.append(counts) # 25% reset to 0 state on qubit 1 counts = [0, shots / 4, 0, 3 * shots / 4] counts_lists.append(counts) # 100% reset error to 0 on all qubits counts = [shots, 0, 0, 0] counts_lists.append(counts) # 100% reset error to 1 on all qubits counts = [0, shots, 0, 0] counts_lists.append(counts) # 25% reset error to 0 and 1 on all qubits counts = [3 * shots / 16, shots / 16, 9 * shots / 16, 3 * shots / 16] counts_lists.append(counts) # Convert to counts dict return [list2dict(i, hex_counts) for i in counts_lists]
def pauli_gate_error_counts(shots, hex_counts=True): """Pauli gate error circuits reference counts""" counts_lists = [] # 100% all-qubit Pauli error on "id" gates counts = [0, 0, 0, shots] counts_lists.append(counts) # 25% all-qubit Pauli error on "id" gates counts = [9 * shots / 16, 3 * shots / 16, 3 * shots / 16, shots / 16] counts_lists.append(counts) # 100% Pauli error on "id" gates on qubit-1 counts = [0, 0, shots, 0] counts_lists.append(counts) # 25% all-qubit Pauli error on "id" gates on qubit-0 counts = [3 * shots / 4, shots / 4, 0, 0] counts_lists.append(counts) # 25% Pauli-X error on spectator for CX gate on [0, 1] counts = [3 * shots / 4, 0, 0, 0, shots / 4, 0, 0, 0] counts_lists.append(counts) # Convert to counts dict return [list2dict(i, hex_counts) for i in counts_lists]
def kraus_gate_error_counts(shots, hex_counts=True): """Kraus gate error circuits reference counts""" counts_lists = [] # 100% all-qubit Pauli error on "id" gates counts = [3 * shots / 4, shots / 4, 0, 0] counts_lists.append(counts) # Convert to counts dict return [list2dict(i, hex_counts) for i in counts_lists]
def readout_error_counts(shots, hex_counts=True): """Readout error test circuits reference counts.""" counts_lists = [] # 1-qubit readout error on qubit 0 counts = [ ROERROR_1Q[0][0] * shots / 2, ROERROR_1Q[0][1] * shots / 2, ROERROR_1Q[1][0] * shots / 2, ROERROR_1Q[1][1] * shots / 2 ] counts_lists.append(counts) # 1-qubit readout error on qubit 1 counts = [ ROERROR_1Q[0][0] * shots / 2, ROERROR_1Q[1][0] * shots / 2, ROERROR_1Q[0][1] * shots / 2, ROERROR_1Q[1][1] * shots / 2 ] counts_lists.append(counts) # 1-qubit readout error on qubit 1 p00 = 0.5 * (ROERROR_1Q[0][0]**2 + ROERROR_1Q[1][0]**2) p01 = 0.5 * ( ROERROR_1Q[0][0] * ROERROR_1Q[0][1] + ROERROR_1Q[1][0] * ROERROR_1Q[1][1]) p10 = 0.5 * ( ROERROR_1Q[0][0] * ROERROR_1Q[0][1] + ROERROR_1Q[1][0] * ROERROR_1Q[1][1]) p11 = 0.5 * (ROERROR_1Q[0][1]**2 + ROERROR_1Q[1][1]**2) counts = [p00 * shots, p01 * shots, p10 * shots, p11 * shots] counts_lists.append(counts) # 2-qubit readout error on qubits 0,1 probs_ideal = [0.25, 0.25, 0.25, 0.25] p00 = sum([ ideal * noise[0] for ideal, noise in zip(probs_ideal, ROERROR_2Q) ]) p01 = sum([ ideal * noise[1] for ideal, noise in zip(probs_ideal, ROERROR_2Q) ]) p10 = sum([ ideal * noise[2] for ideal, noise in zip(probs_ideal, ROERROR_2Q) ]) p11 = sum([ ideal * noise[3] for ideal, noise in zip(probs_ideal, ROERROR_2Q) ]) counts = [p00 * shots, p01 * shots, p10 * shots, p11 * shots] counts_lists.append(counts) return [list2dict(i, hex_counts) for i in counts_lists]
def pauli_reset_error_counts(shots, hex_counts=True): """Local Pauli reset error circuits reference counts""" counts_lists = [] # 25% all-qubit Pauli error on reset counts = [9 * shots / 16, 3 * shots / 16, 3 * shots / 16, shots / 16] counts_lists.append(counts) # 25% local Pauli error on reset of qubit 1 counts = [3 * shots / 4, 0, shots / 4, 0] counts_lists.append(counts) # 25 % non-local Pauli error on qubit 1 for reset of qubit-0 counts = [3 * shots / 4, 0, shots / 4, 0] counts_lists.append(counts) # Convert to counts dict return [list2dict(i, hex_counts) for i in counts_lists]