<jupyter_start><jupyter_text>Data visualization<jupyter_code>#@title Plot key metrics against years {display-mode: "form"}
target = "Physical qubits" #@param ["Physical qubits", "Average two-qubit gate error rate"]
data_horizon = [2002, 2022] #@param
data_horizon = [pd.Timestamp(year=x, month=1, day=1) for x in data_horizon]

# Filter the data
df_hat = df.dropna(subset=["Date", target])
df_hat = df_hat[df_hat[target]> 0.]
df_hat = df_hat[data_horizon[0] <= df_hat["Date"]]
df_hat = df_hat[df_hat["Date"] <= data_horizon[1]]

print(f"n = {len(df_hat)}")

# Plot the filtered data
alt.Chart(df_hat,width=1000, height=800
).mark_point(size=200).encode(
  x=alt.X('Date', scale=alt.Scale(), axis = alt.Axis(format = ("%Y"))),
  y=alt.Y(target, scale=alt.Scale(type="log"),axis=alt.Axis(format=".1e" if target != "Physical qubits" else "i")),
  shape = 'Technology',
  tooltip='Source'
).configure_axis(grid=False,
    labelFontSize=20,
    titleFontSize=40).interactive().configure_legend(
    titleFontSize=20,
    labelFontSize = 18,
    gradientLength=400,
    gradientThickness=30
)
#@title Plot physical qubits against error rate {display-mode: "form"}
mask = df.notna()["Physical qubits"]
mask &= df.notna()["Average two-qubit gate error rate"]
n = np.sum(mask)
print(f"n={ n }")
alt.Chart(df, width=1000, height=800).mark_point(size=200).encode(
  x=alt.X("Physical qubits", scale=alt.Scale(type="log")),
  y=alt.Y("Average two-qubit gate error rate", scale=alt.Scale(type="log"),axis=alt.Axis(format=".1e")),
  color = alt.Color("Year:O", 
                    scale=alt.Scale(scheme='viridis')
          ),
  shape = 'Technology'
).configure_axis(grid=False,
    labelFontSize=20,
    titleFontSize=40).interactive().configure_legend(
    titleFontSize=20,
    labelFontSize = 18,
    gradientLength=400,
    gradientThickness=30
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17228464419475656, 'fraction_numerical': 0.03263777421080792, 'mean_word_length': 5.448275862068965, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '207259', 'license': 'MIT', 'n_tokens_mistral': 732, 'n_tokens_neox': 665, 'n_words': 128, 'path': 'QuantumComputingProgressDataVisualization.ipynb', 'repo_name': 'Jsevillamol/quantumcomputingtimelines', 'size': '1869'}