def run_series(iterations, gate, use_swap_gates, draw_circuit, color, pb, gate_duration_file, **kwargs): if gate_duration_file: set_gate_durations_from_file(gate_duration_file) qc = QuantumCircuit(6, 4, **kwargs) gate = gate if not use_swap_gates else gate + '_swap' durations = [] total_print_lines = [] matrices = [] for i in range(iterations): pb.update(1) if pb else None noisy_matrix, print_lines, total_duration = run_non_local_gate( qc, gate, draw_circuit, color, **kwargs) total_print_lines.extend(print_lines) matrices.append(noisy_matrix) durations.append(total_duration) return matrices, total_print_lines, durations
def perform_damping_channel(channel: str, t: float) -> float: qc = QuantumCircuit(1, 0) if channel == "a": dm = CT(ket_0) dm_dec = qc._noise.noise_maps.N_amplitude_damping_channel(qc, 0, dm, 1, t, T=2) else: dm = CT(ket_p) dm_dec = qc._noise.noise_maps.N_phase_damping_channel(qc, 0, dm, 1, t, T=2) return fidelity_elementwise(dm, dm_dec) - 0.5