Exemple #1
0

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,
        4e-3,
    noise_model.add_all_qubit_quantum_error(error_gate1, "id")
    return noise_model


if __name__ == "__main__":
    d = int(sys.argv[1])
    T = int(sys.argv[2])

    qubit = SurfaceCodeLogicalQubit(d)
    qubit.stabilize()
    qubit.identity_data()
    qubit.stabilize()
    qubit.readout_z()
    benchmarking_tool = SurfaceCodeBenchmarkingTool(
        decoder=GraphDecoder(d=d, T=T),
        readout_circuit=qubit,
        noise_model_func=get_noise_model,
    )

    print("\nSIMULATE: (d={},T={})\n".format(benchmarking_tool.d,
                                             benchmarking_tool.T))
    correct_logical_value = 0
    noise_values = [
        5e-5,
        1e-4,
        2e-4,
        5e-4,
        1e-3,
        2e-3,
        4e-3,
        5e-3,
Exemple #3
0
        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,
        5e-3,
Exemple #4
0
import sys
import os

sys.path.insert(0, ".." + os.sep)
import matplotlib.pyplot as plt

plt.rcParams.update({"font.size": 14, "pdf.fonttype": 42, "ps.fonttype": 42})

from benchmarking.benchmarking_tools import SurfaceCodeBenchmarkingTool

import glob

data_files = glob.glob("*.npz")
benchmarking_tools = []
for file in data_files:
    benchmarking_tools.append(SurfaceCodeBenchmarkingTool(filename=file))
    benchmarking_tools[-1].load_data()

# Plotting
fig = plt.figure(figsize=(3.5, 2.5), dpi=200)
ax = fig.subplots()

for benchmarking_tool in benchmarking_tools:
    benchmarking_tool.plot_benchmark_data(
        fig=fig,
        ax=ax,
        label="d={},T={}".format(benchmarking_tool.d, benchmarking_tool.T),
    )

plt.legend(loc="lower right", prop={"size": 6})
ax.set_xlabel("Physical Error Rate", size=10)