def load_data(self, filename=None):
        filename = self.filename if filename is None else filename
        data = np.load(filename)
        self.d = int(data["d"])
        self.T = int(data["T"])
        self.decoder = GraphDecoder(d=self.d, T=self.T)

        # self.readout_circuit =
        self.benchmark_data["noise"] = data["noise"]
        self.benchmark_data["logical_error_rate"] = data["logical_error_rate"]
Beispiel #2
0
    return noise_model


decoder_keys = [(d, 1) for d in range(3, 11, 2)]
benchmarking_tools = []

for decoder_key in tqdm(decoder_keys):
    d = decoder_key[0]
    T = decoder_key[1]
    qubit = SurfaceCodeLogicalQubit(d)
    qubit.stabilize()
    qubit.stabilize()
    qubit.readout_z()
    benchmarking_tools.append(
        SurfaceCodeBenchmarkingTool(
            decoder=GraphDecoder(d=d, T=T),
            readout_circuit=qubit,
            noise_model_func=get_noise_model,
        ))
print("\nDONE SETTING UP DECODERS!\n")


def simulate(index):
    correct_logical_value = 0
    noise_values = [
        5e-5,
        1e-4,
        2e-4,
        5e-4,
        1e-3,
        2e-3,
Beispiel #3
0
    noise_model.add_all_qubit_quantum_error(
        error_gate1,
        ["u1", "u2", "u3"])  # single qubit gate error is applied to x gates
    noise_model.add_all_qubit_quantum_error(
        error_gate2, ["cx"])  # two qubit gate error is applied to cx gates

    return noise_model


decoder_keys = [(d, 1) for d in range(3, 13, 2)]
benchmarking_tools = []

for decoder_key in tqdm(decoder_keys):
    benchmarking_tools.append(
        SurfaceCodeBenchmarkingTool(
            decoder=GraphDecoder(d=decoder_key[0], T=decoder_key[1]),
            readout_circuit=logical_zero.copy(),
            noise_model_func=get_noise_model,
        ))


def simulate(index):
    correct_logical_value = 0
    noise_values = [
        5e-5,
        1e-4,
        2e-4,
        5e-4,
        1e-3,
        2e-3,
        4e-3,