From f97c5148b7d2c30dd91cf465b493e50ad81b86cc Mon Sep 17 00:00:00 2001 From: Haggai Landa <55192441+haggaila@users.noreply.github.com> Date: Sun, 6 Aug 2023 13:50:30 +0300 Subject: [PATCH 1/3] Update README.md to refer to the requirements file --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83bd130..e44a601 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,6 @@ Together with the [data](./output), the complete source code allowing to run the The [lindbladmpo](https://github.com/qiskit-community/lindbladmpo) repository is required (together with [ITensor](https://github.com/ITensor/ITensor)), and assumed to be cloned to a directory side by side with current repo's root folder. See the [installation guide](https://github.com/qiskit-community/lindbladmpo/blob/main/INSTALL.md) of _lindbladmpo_ for instructions on compiling the C++ binary necessary for running the simulations. -More details and a `requirements.txt` file for pip installing the dependencies of the code to be listed here soon. +The `requirements.txt` file allows for pip installing the dependencies of the code. + +More details to be listed here soon. From be8837c88fc85e54e5453497433dd8ad7016291c Mon Sep 17 00:00:00 2001 From: Liran Shirizly Date: Sun, 6 Aug 2023 14:15:11 +0300 Subject: [PATCH 2/3] Added paper plots files --- paper_plots/plot-12Q.py | 476 ++++++++++++++++++++++ paper_plots/plot-3Q.py | 352 ++++++++++++++++ paper_plots/plot-PO.py | 203 +++++++++ paper_plots/plot-models-reduced-chisq.py | 74 ++++ paper_plots/plot-time-stability.py | 85 ++++ paper_plots/plot-time-stability_Falcon.py | 84 ++++ 6 files changed, 1274 insertions(+) create mode 100644 paper_plots/plot-12Q.py create mode 100644 paper_plots/plot-3Q.py create mode 100644 paper_plots/plot-PO.py create mode 100644 paper_plots/plot-models-reduced-chisq.py create mode 100644 paper_plots/plot-time-stability.py create mode 100644 paper_plots/plot-time-stability_Falcon.py diff --git a/paper_plots/plot-12Q.py b/paper_plots/plot-12Q.py new file mode 100644 index 0000000..cf02481 --- /dev/null +++ b/paper_plots/plot-12Q.py @@ -0,0 +1,476 @@ +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +from project_simulations.simulation_routines import * + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 18 +plt.rcParams["axes.linewidth"] = 2 + +# (a) 12Q graph state without DD, (b) 12Q graph state with DD +s_simulation_id_a = "b2cdcb62bb894c02981b21c191c852fd" +s_simulation_id_b = "13e7cea845524fec84bec865d20e4f75" + +# The simulation also calculated the initialization of the graph state, +# Set b_plot_initial=True to plot it +b_plot_initial = False + +# Generate paths +( + s_output_path, + s_evolution_path, + s_estimation_path, + s_simulation_path, + _, +) = experiment_routines.generate_paths() +s_paper_plot_path = s_output_path + "paper_figures/" +if not os.path.exists(s_paper_plot_path): + os.mkdir(s_paper_plot_path) + +# Upper figure panel (a) / idle +s_simulation_csv = s_output_path + S_DB_FILENAME +parameters = get_simulation_dict(s_simulation_csv, s_simulation_id_a) +s_output_file = s_simulation_path + S_FILE_PREFIX + "." + s_simulation_id_a +result = LindbladMPOSolver.load_output(s_output_file) + +N = parameters["N"] +t_init = parameters["t_init"] +t_final = parameters["t_final"] +time_unit = parameters["time_unit"] +t_gates = parameters["t_gates"] +s_evolution_csv = s_output_path + experiment_routines.S_EVOLUTION_DF_FILENAME +s_evolution_id = parameters["evolution_id"] +evolution_dict = get_simulation_dict(s_evolution_csv, s_evolution_id) +s_pickle_file = ( + s_evolution_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + "." + + s_evolution_id +) +s_file_prefix = ( + s_paper_plot_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + f".N={N}." + + s_simulation_id_a +) +print( + f'\nEvolution experiment {s_evolution_id}, backend: {evolution_dict["backend"]}. N = {N}.' +) +print(evolution_dict["experiment_link"]) + +sim_qubits = np.asarray(range(N)) +promote_indices(sim_qubits) + +# Load parameters for readout error mitigation +p_0_given_0, p_0_given_1 = load_mitigation_parameters(s_evolution_id) +topo_index = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +xzz_list = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +( + times, + qubits, + ev_1Q_dict, + correlations_dict, + stabilizers_dict, +) = load_observables( + s_pickle_file, + topo_index, + xzz_list, + b_mitigate_readout=True, + b_correlations=False, + p_0_given_0=p_0_given_0, + p_0_given_1=p_0_given_1, + b_stabilizers=True, +) +if b_plot_initial: + times = times / time_unit + 1 * t_gates +else: + times = times / time_unit + +physical_qubits = evolution_dict["qubits"].strip("][").split(", ") + +s_obs_name = "xzz" +_3q_plot_indices = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +_3q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_3q_sim_plot_indices) +_1q_plot_indices = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +_1q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_1q_sim_plot_indices) + +s_file_prefix = ( + s_paper_plot_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + f".N={N}." + + s_simulation_id_a +) +stab = stabilizers_dict + +# Initial value for summing the stabilizers +stab_norm_MPO = 0 +stab_norm = 0 + +fidelity_a = result["obs-cu"].get(("ideal_proj", ())) + +fig, axs = plt.subplots(3, 4, sharex=True, sharey=True, figsize=(12, 7)) +axs = axs.reshape(12) +count = 0 + +for i_x_qubit, _3q_tuple in zip(_1q_plot_indices, _3q_plot_indices): + i, j, k = _3q_tuple[0], _3q_tuple[1], _3q_tuple[2] + q1, q2, q3 = physical_qubits[i], physical_qubits[j], physical_qubits[k] + x1 = physical_qubits[i_x_qubit] + ax = axs[count] + stab_v = stab[f"stabilizer_{i}"] + XZZ = unp_n(stab_v) + XZZ_err = unp_s(stab_v) + ax.errorbar(times, XZZ, XZZ_err, fmt="ro", alpha=0.8, capsize=4, markersize=5) + + obs_data_MPO_stab, _ = prepare_curve_data( + result, "obs-3q", s_obs_name, (sim_qubits[i], sim_qubits[j], sim_qubits[k]) + ) + stab_norm_MPO += (np.asarray(obs_data_MPO_stab[1]) + 1) / 2 + stab_norm += (stab_v + 1) / 2 + + if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0]), + obs_data_MPO_stab[1], + fmt="-r", + alpha=1, + capsize=4, + markersize=5, + ) + else: + gate_time_index = np.argmax(np.asarray(obs_data_MPO_stab[0]) > t_gates) + ax.errorbar( + np.asarray(obs_data_MPO_stab[0])[gate_time_index:] - t_gates, + obs_data_MPO_stab[1][gate_time_index:], + fmt="-r", + alpha=1, + capsize=4, + markersize=5, + ) + + s_stab = f"$\\langle Z_{{{q2}}} X_{{{q1}}} Z_{{{q3}}}\\rangle$" + + ax.legend( + [s_stab + ", exp", s_stab + ", sim"], + loc="upper right", + frameon=False, + fontsize=12, + ) + ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") + ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") + ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") + ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") + count += 1 + +fig.supxlabel(r"time [$\mu s$]", y=0.05) +plt.tight_layout() +plt.subplots_adjust(hspace=0.05, wspace=0.03) + +# Upper figure panel (a) / ZZ DD +s_simulation_csv = s_output_path + S_DB_FILENAME +parameters = get_simulation_dict(s_simulation_csv, s_simulation_id_b) +s_output_file = s_simulation_path + S_FILE_PREFIX + "." + s_simulation_id_b +result = LindbladMPOSolver.load_output(s_output_file) + +N = parameters["N"] +t_init = parameters["t_init"] +t_final = parameters["t_final"] +time_unit = parameters["time_unit"] +t_gates = parameters["t_gates"] +s_evolution_csv = s_output_path + experiment_routines.S_EVOLUTION_DF_FILENAME +s_evolution_id = parameters["evolution_id"] +evolution_dict = get_simulation_dict(s_evolution_csv, s_evolution_id) +s_pickle_file = ( + s_evolution_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + "." + + s_evolution_id +) +print( + f'\nEvolution experiment {s_evolution_id}, backend: {evolution_dict["backend"]}. N = {N}.' +) +print(evolution_dict["experiment_link"]) + +sim_qubits = np.asarray(range(N)) +promote_indices(sim_qubits) +p_0_given_0, p_0_given_1 = load_mitigation_parameters(s_evolution_id) +topo_index = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +xzz_list = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +( + times_DD, + qubits, + ev_1Q_dict, + correlations_dict, + stabilizers_dict, +) = load_observables( + s_pickle_file, + topo_index, + xzz_list, + b_mitigate_readout=True, + b_correlations=False, + p_0_given_0=p_0_given_0, + p_0_given_1=p_0_given_1, + b_stabilizers=True, +) +if b_plot_initial: + times_DD = times_DD / time_unit + 1 * t_gates +else: + times_DD = times_DD / time_unit + +physical_qubits = evolution_dict["qubits"].strip("][").split(", ") +s_obs_name = "xzz" +_3q_plot_indices = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +_3q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_3q_sim_plot_indices) +_1q_plot_indices = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +_1q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_1q_sim_plot_indices) + +s_file_prefix = ( + s_paper_plot_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + f".N={N}." + + s_simulation_id_b +) +stab = stabilizers_dict +colors = cm.get_cmap("cool", 10) + + +stab_norm_MPO_DD = 0 +stab_norm_DD = 0 +fidelity_b = result["obs-cu"].get(("ideal_proj", ())) +fig, axs = plt.subplots(3, 4, sharex=True, sharey=True, figsize=(12, 7)) +axs = axs.reshape(12) +count = 0 +for i_x_qubit, _3q_tuple in zip(_1q_plot_indices, _3q_plot_indices): + i, j, k = _3q_tuple[0], _3q_tuple[1], _3q_tuple[2] + q1, q2, q3 = physical_qubits[i], physical_qubits[j], physical_qubits[k] + x1 = physical_qubits[i_x_qubit] + stab_v = stab[f"stabilizer_{i}"] + XZZ = unp_n(stab_v) + XZZ_err = unp_s(stab_v) + + ax = axs[count] + ax.errorbar(times_DD, XZZ, XZZ_err, fmt="co", alpha=0.8, capsize=4, markersize=5) + + obs_data_MPO_stab_DD, _ = prepare_curve_data( + result, "obs-3q", s_obs_name, (sim_qubits[i], sim_qubits[j], sim_qubits[k]) + ) + stab_norm_MPO_DD += (np.asarray(obs_data_MPO_stab_DD[1]) + 1) / 2 + stab_norm_DD += (stab_v + 1) / 2 + + if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_stab_DD[0]), + obs_data_MPO_stab_DD[1], + fmt="-c", + alpha=1, + capsize=4, + markersize=5, + ) + else: + ax.errorbar( + np.asarray(obs_data_MPO_stab_DD[0])[gate_time_index:] - t_gates, + obs_data_MPO_stab_DD[1][gate_time_index:], + fmt="-c", + alpha=1, + capsize=4, + markersize=5, + ) + + s_stab = f"$\\langle Z_{{{q2}}} X_{{{q1}}} Z_{{{q3}}}\\rangle$" + + count += 1 + ax.legend( + [s_stab + ", exp", s_stab + ", sim"], + loc="lower right", + frameon=False, + fontsize=12, + ) + ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") + ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") + ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") + ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +fig.supxlabel(r"time [$\mu s$]", y=0.05) +plt.tight_layout() +plt.subplots_adjust(hspace=0.05, wspace=0.03) + + +fig, axs = plt.subplots(2, 1, figsize=(8, 7.5), sharex=True) +ax = axs[0] +ax.errorbar( + times_DD, + unp_n(stab_norm_DD / 12), + yerr=unp_s(stab_norm_DD / 12), + fmt=">r", + alpha=0.9, + capsize=4, + markersize=5, + label=r"ZZ DD, exp", +) +if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0]), + stab_norm_MPO_DD / 12, + fmt="-r", + alpha=0.9, + capsize=4, + markersize=5, + linewidth=2, + label=r"ZZ DD, sym", + ) +else: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0][gate_time_index:]) - t_gates, + stab_norm_MPO_DD[gate_time_index:] / 12, + fmt="-r", + alpha=0.9, + capsize=4, + markersize=5, + linewidth=2, + label=r"ZZ DD, sym", + ) + + +ax.errorbar( + times, + unp_n(stab_norm / 12), + yerr=unp_s(stab_norm / 12), + fmt="oc", + alpha=0.9, + capsize=4, + markersize=5, + label=r"Idle, exp", +) +if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0]), + stab_norm_MPO / 12, + fmt="--c", + alpha=0.9, + capsize=4, + markersize=5, + linewidth=2, + label=r"Idle, sym", + ) +else: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0][gate_time_index:]) - t_gates, + stab_norm_MPO[gate_time_index:] / 12, + fmt="--c", + alpha=0.9, + capsize=4, + markersize=5, + linewidth=2, + label=r"Idle, sym", + ) + + +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=3, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=3, width=2, direction="in", right="on") +ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=18) +ax.set_ylabel( + "$\\frac{1}{12}\sum_i \\frac{1 + \\left< S_i \\right>}{2}$", labelpad=5, fontsize=24 +) + +ax = axs[1] + +if b_plot_initial: + ax.errorbar( + np.asarray(fidelity_b[0]), + np.asarray(fidelity_b[1]) * 2**12, + fmt="-r", + alpha=0.9, + capsize=4, + linewidth=2, + markersize=5, + label=r"ZZ DD, sym", + ) + + ax.errorbar( + np.asarray(fidelity_a[0]), + np.asarray(fidelity_a[1]) * 2**12, + fmt="--c", + linewidth=2, + alpha=0.9, + capsize=4, + markersize=5, + label=r"Idle, sym", + ) +else: + ax.errorbar( + np.asarray(fidelity_b[0][gate_time_index:]) - t_gates, + np.asarray(fidelity_b[1][gate_time_index:]) * 2**12, + fmt="-r", + alpha=0.9, + capsize=4, + linewidth=2, + markersize=5, + label=r"ZZ DD, sym", + ) + + ax.errorbar( + np.asarray(fidelity_a[0][gate_time_index:]) - t_gates, + np.asarray(fidelity_a[1][gate_time_index:]) * 2**12, + fmt="--c", + linewidth=2, + alpha=0.9, + capsize=4, + markersize=5, + label=r"Idle, sym", + ) + +ax.set_xlabel(r"time [$\mu s$]", labelpad=1, fontsize=22) +ax.set_yscale("log") +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=3, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=3, width=2, direction="in", right="on") +ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=18) +ax.set_ylabel("Fidelity", labelpad=5, fontsize=24) +plt.tight_layout() +plt.subplots_adjust(hspace=0.05, wspace=0.03) +plt.show() diff --git a/paper_plots/plot-3Q.py b/paper_plots/plot-3Q.py new file mode 100644 index 0000000..00a9245 --- /dev/null +++ b/paper_plots/plot-3Q.py @@ -0,0 +1,352 @@ +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +from project_simulations.simulation_routines import * + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 18 +plt.rcParams["axes.linewidth"] = 2 + +# (a) initial |+,+,+> state, (b) initial 3Q chain graph state +s_simulation_id_a = "299f1297db9347e7853fb5eb510c08e5" +s_simulation_id_b = "d58e318d2b2c4cb0974ae402d01e3fba" + +# The simulation also calculated the initialization of the graph state, +# Set b_plot_initial=True to plot it +b_plot_initial = False + +# Generate paths +( + s_output_path, + s_evolution_path, + s_estimation_path, + s_simulation_path, + _, +) = experiment_routines.generate_paths() +s_paper_plot_path = s_output_path + "paper_figures/" +if not os.path.exists(s_paper_plot_path): + os.mkdir(s_paper_plot_path) + +# Upper figure panel (a) +s_simulation_csv = s_output_path + S_DB_FILENAME +parameters = get_simulation_dict(s_simulation_csv, s_simulation_id_a) +s_output_file = s_simulation_path + S_FILE_PREFIX + "." + s_simulation_id_a +result_MPO = LindbladMPOSolver.load_output(s_output_file) + +N = parameters["N"] +t_init = parameters["t_init"] +t_final = parameters["t_final"] +time_unit = parameters["time_unit"] +t_gates = parameters["t_gates"] +s_evolution_csv = s_output_path + experiment_routines.S_EVOLUTION_DF_FILENAME +s_evolution_id = parameters["evolution_id"] +evolution_dict = get_simulation_dict(s_evolution_csv, s_evolution_id) +s_pickle_file = ( + s_evolution_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + "." + + s_evolution_id +) +s_file_prefix = ( + s_paper_plot_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + f".N={N}." + + s_simulation_id_a +) +print( + f'\nEvolution experiment {s_evolution_id}, backend: {evolution_dict["backend"]}. N = {N}.' +) +print(evolution_dict["experiment_link"]) + +sim_qubits = np.asarray(range(N)) +promote_indices(sim_qubits) + +# Load parameters for readout error mitigation +p_0_given_0, p_0_given_1 = load_mitigation_parameters(s_evolution_id) +topo_index = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +xzz_list = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +( + times, + qubits, + ev_1Q_dict, + correlations_dict, + stabilizers_dict, +) = load_observables( + s_pickle_file, + topo_index, + xzz_list, + b_mitigate_readout=True, + b_correlations=False, + p_0_given_0=p_0_given_0, + p_0_given_1=p_0_given_1, + b_stabilizers=False, +) +times = times / time_unit + +physical_qubits = evolution_dict["qubits"].strip("][").split(", ") + +_1q_plot_indices = np.asarray(range(N)) +n_plot_qubits = len(_1q_plot_indices) +axs = None +figs = [] +axs_list = [] +for i_plot_qubit in range(n_plot_qubits): + qubit = qubits[_1q_plot_indices[i_plot_qubit]] + physical_qubit = physical_qubits[_1q_plot_indices[i_plot_qubit]] + sim_qubit = sim_qubits[_1q_plot_indices[i_plot_qubit]] + RamX_data = unp_n(ev_1Q_dict[f"X_{qubit}"]) + RamX_err = unp_s(ev_1Q_dict[f"X_{qubit}"]) + RamY_data = unp_n(ev_1Q_dict[f"Y_{qubit}"]) + RamY_err = unp_s(ev_1Q_dict[f"Y_{qubit}"]) + + s_obs_name = "x" + obs_data_MPO_x, _ = prepare_curve_data( + result_MPO, "obs-1q", s_obs_name, (sim_qubit,) + ) + + s_obs_name = "y" + obs_data_MPO_y, _ = prepare_curve_data( + result_MPO, "obs-1q", s_obs_name, (sim_qubit,) + ) + + fig, axs = plt.subplots(2, 1, figsize=(6, 6.5), sharex=True) + ax = axs[0] + + ax.errorbar( + times[::2], + RamX_data[::2], + yerr=RamX_err[::2], + fmt="o", + alpha=0.9, + capsize=4, + markersize=4, + label=f"$\\left< X_{{{str(physical_qubit)}}} \\right>,$ exp", + color="C0", + ) + ax.errorbar( + obs_data_MPO_x[0], + obs_data_MPO_x[1], + fmt="-", + alpha=0.8, + capsize=4, + markersize=5, + label=f"$\\left< X_{{{str(physical_qubit)}}} \\right>,$ sim", + color="C0", + ) + + ax.errorbar( + times[::2], + RamY_data[::2], + yerr=RamY_err[::2], + fmt=">", + alpha=0.9, + capsize=4, + markersize=4, + label=f"$\\left< Y_{{{str(physical_qubit)}}} \\right>,$ exp", + color="C1", + ) + ax.errorbar( + obs_data_MPO_y[0], + obs_data_MPO_y[1], + fmt="--", + alpha=0.8, + capsize=4, + markersize=5, + label=f"$\\left< Y_{{{str(physical_qubit)}}} \\right>,$ sim", + color="C1", + ) + # Edit the major and minor ticks of the x and y axes + ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") + ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") + ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") + ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") + + ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=14) + + figs.append(fig) + axs_list.append(axs) + + +# Lower figure panel (b) +s_simulation_csv = s_output_path + S_DB_FILENAME +parameters = get_simulation_dict(s_simulation_csv, s_simulation_id_b) +s_output_file = s_simulation_path + S_FILE_PREFIX + "." + s_simulation_id_b +result_MPO_stab = LindbladMPOSolver.load_output(s_output_file) + +N = parameters["N"] +t_init = parameters["t_init"] +t_final = parameters["t_final"] +time_unit = parameters["time_unit"] +t_gates = parameters["t_gates"] +s_evolution_csv = s_output_path + experiment_routines.S_EVOLUTION_DF_FILENAME +s_evolution_id = parameters["evolution_id"] +evolution_dict = get_simulation_dict(s_evolution_csv, s_evolution_id) +s_pickle_file = ( + s_evolution_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + "." + + s_evolution_id +) +print( + f'\nEvolution experiment {s_evolution_id}, backend: {evolution_dict["backend"]}. N = {N}.' +) +print(evolution_dict["experiment_link"]) + +sim_qubits = np.asarray(range(N)) +promote_indices(sim_qubits) +p_0_given_0, p_0_given_1 = load_mitigation_parameters(s_evolution_id) +topo_index = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +xzz_list = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +( + times, + qubits, + ev_1Q_dict, + correlations_dict, + stabilizers_dict, +) = load_observables( + s_pickle_file, + topo_index, + xzz_list, + b_mitigate_readout=True, + b_correlations=False, + p_0_given_0=p_0_given_0, + p_0_given_1=p_0_given_1, + b_stabilizers=True, +) +if b_plot_initial: + times = times / time_unit + 1 * t_gates +else: + times = times / time_unit + +physical_qubits = evolution_dict["qubits"].strip("][").split(", ") + +s_obs_name = "xzz" +_3q_plot_indices = ( + experiment_routines.RING_3Q_XZZ_LIST + if N == 12 + else experiment_routines.CHAIN_3Q_XZZ_LIST +) +_3q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_3q_sim_plot_indices) +_1q_plot_indices = ( + experiment_routines.RING_TOPOLOGY_INDEXES + if N == 12 + else experiment_routines.CHAIN_3Q_TOPOLOGY_INDEXES +) +_1q_sim_plot_indices = _3q_plot_indices.copy() +promote_indices(_1q_sim_plot_indices) + +s_file_prefix = ( + s_paper_plot_path + + experiment_routines.S_EVOLUTION_DATA_PREFIX + + f".N={N}." + + s_simulation_id_b +) +stab = stabilizers_dict + +_3q_tuple = _3q_plot_indices[0] +i, j, k = _3q_tuple[0], _3q_tuple[1], _3q_tuple[2] +q1, q2, q3 = physical_qubits[i], physical_qubits[j], physical_qubits[k] +i_x_qubit = 1 +x1 = physical_qubits[i_x_qubit] + +fig, ax = figs[1], axs_list[1][1] +stab_v = stab[f"stabilizer_{1}"] +XZZ = unp_n(stab_v) +XZZ_err = unp_s(stab_v) + +obs_data_MPO_x, _ = prepare_curve_data( + result_MPO_stab, "obs-1q", "x", (sim_qubits[i_x_qubit],) +) + +if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_x[0]), + obs_data_MPO_x[1], + fmt="-.", + alpha=0.9, + capsize=4, + markersize=5, + color="C0", + ) +else: + gate_time_index = np.argmax(np.asarray(obs_data_MPO_x[0]) > t_gates) + ax.errorbar( + np.asarray(obs_data_MPO_x[0][gate_time_index:]) - t_gates, + obs_data_MPO_x[1][gate_time_index:], + fmt="-.", + alpha=0.9, + capsize=4, + markersize=5, + color="C0", + ) + +s_x1 = f"$\\langle X_{{{q1}}}\\rangle$" + +ax.errorbar(times, XZZ, XZZ_err, fmt="ro", alpha=0.8, capsize=4, markersize=5) + +obs_data_MPO_stab, _ = prepare_curve_data( + result_MPO_stab, + "obs-3q", + s_obs_name, + (sim_qubits[i], sim_qubits[j], sim_qubits[k]), +) +if b_plot_initial: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0]), + obs_data_MPO_stab[1], + fmt="-r", + alpha=0.9, + capsize=4, + markersize=5, + ) +else: + ax.errorbar( + np.asarray(obs_data_MPO_stab[0][gate_time_index:]) - t_gates, + obs_data_MPO_stab[1][gate_time_index:], + fmt="-r", + alpha=0.9, + capsize=4, + markersize=5, + ) + +s_stab = f"$\\langle Z_{{{q2}}} X_{{{q1}}} Z_{{{q3}}}\\rangle$" + +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_xlabel(r"time [$\mu s$]", labelpad=1) +ax.legend( + [s_x1 + ", sim", s_stab + ", exp", s_stab + ", sim"], + loc="upper right", + frameon=False, + fontsize=14, +) +ax.set_xlim([-3, 100]) +plt.tight_layout() +plt.subplots_adjust(hspace=0.1) +plt.show() diff --git a/paper_plots/plot-PO.py b/paper_plots/plot-PO.py new file mode 100644 index 0000000..0869d66 --- /dev/null +++ b/paper_plots/plot-PO.py @@ -0,0 +1,203 @@ +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. +import os +import pickle +import matplotlib.pyplot as plt +from uncertainties import unumpy as unp + + +# unumpy shortcuts +unp_n = unp.nominal_values +unp_s = unp.std_devs + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 16 +plt.rcParams["axes.linewidth"] = 2 + +s_output_path = ( + os.path.abspath("../output") + "/" +) # use the absolute path of the current file +s_PO_path = s_output_path + "PO/" + +# First figure +qubit = 2 +file = ( + s_PO_path + + f"ibm_cusco.nu.89337de1544b4ba080bea1cc50c59391.Qubit_{qubit}.parity_data.pkl" +) +# Load data +with open(file, "rb") as handle: + data_1Q = pickle.load(handle) + +fig, axs = plt.subplots(2, 1, figsize=(6, 5), sharex=True) +ax = axs[0] +# calculate the xy projection, rho +p_x = unp.uarray(data_1Q["X"].y, data_1Q["X"].y_err) +p_y = unp.uarray(data_1Q["Y"].y, data_1Q["Y"].y_err) +rho = unp.sqrt((2 * p_x - 1) ** 2 + (2 * p_y - 1) ** 2) +# calculate +p_z = unp.uarray(data_1Q["Z"].y, data_1Q["Z"].y_err) +z_ev = 2 * p_z - 1 +# plot +ax.errorbar( + data_1Q["X"].x * 1e6, + unp_n(z_ev), + yerr=unp_s(z_ev), + fmt=">", + alpha=0.8, + capsize=4, + markersize=4, + label=r"$\left< Z \right>,$ exp ", + color="blue", +) +ax.errorbar( + data_1Q["X"].x * 1e6, + unp_n(rho), + yerr=unp_s(rho), + fmt="o", + alpha=0.9, + capsize=4, + markersize=4, + label=r"$\sqrt{\left< X \right>^2 + \left< Y \right>^2},$ exp ", + color="red", +) +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_ylim([-0.11, 1.1]) +ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=14) +ax = axs[1] + +ax.errorbar( + data_1Q["X"].x * 1e6, + data_1Q["X"].y, + yerr=data_1Q["X"].y_err, + fmt="o", + alpha=0.9, + capsize=4, + markersize=5, + label=r"$P_x,$ exp", + color="C0", +) +ax.errorbar( + data_1Q["time-fit"] * 1e6, + data_1Q["Xfit"], + fmt="--", + alpha=0.8, + capsize=4, + markersize=5, + label=r"$P_x,$ fit", + color="C0", +) + +ax.errorbar( + data_1Q["Y"].x * 1e6, + data_1Q["Y"].y, + yerr=data_1Q["Y"].y_err, + fmt=">", + alpha=0.9, + capsize=4, + markersize=5, + label=r"$P_y,$ exp", + color="C1", +) +ax.errorbar( + data_1Q["time-fit"] * 1e6, + data_1Q["Yfit"], + fmt="-b", + alpha=0.8, + capsize=4, + markersize=5, + label=r"$P_y,$ fit", + color="C1", +) +# Edit the major and minor ticks of the x and y axes +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_ylim([0.08, 1.15]) +ax.set_xlabel(r"time [$\mu s$]", labelpad=1, fontsize=18) +ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=14) +plt.tight_layout() +plt.subplots_adjust(hspace=0.1) +plt.show() + +# Second figure +qubit = 45 +file = ( + s_PO_path + + f"ibm_cusco.nu.8409cd5723dd430993e499d402e029bb.Qubit_{qubit}.parity_data.pkl" +) +# Load data +with open(file, "rb") as handle: + data_1Q = pickle.load(handle) + +fig, axs = plt.subplots(1, 1, figsize=(10, 4), sharex=True) +ax = axs +p_x = unp.uarray(data_1Q["X"].y, data_1Q["X"].y_err) +p_y = unp.uarray(data_1Q["Y"].y, data_1Q["Y"].y_err) +rho = unp.sqrt((2 * p_x - 1) ** 2 + (2 * p_y - 1) ** 2) + +ax.errorbar( + data_1Q["X"].x * 1e6, + data_1Q["X"].y, + yerr=data_1Q["X"].y_err, + fmt="o", + alpha=0.9, + capsize=4, + markersize=5, + label=r"$P_x,$ exp", + color="C0", +) +ax.errorbar( + data_1Q["time-fit"] * 1e6, + data_1Q["Xfit"], + fmt="--", + alpha=0.8, + capsize=4, + markersize=5, + label=r"$P_x,$ fit", + color="C0", +) + +ax.errorbar( + data_1Q["Y"].x * 1e6, + data_1Q["Y"].y, + yerr=data_1Q["Y"].y_err, + fmt=">", + alpha=0.9, + capsize=4, + markersize=5, + label=r"$P_y,$ exp", + color="C1", +) +ax.errorbar( + data_1Q["time-fit"] * 1e6, + data_1Q["Yfit"], + fmt="-b", + alpha=0.8, + capsize=4, + markersize=5, + label=r"$P_y,$ fit", + color="C1", +) +# Edit the major and minor ticks of the x and y axes +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_ylim([0.0, 1.05]) +ax.set_xlabel(r"time [$\mu s$]", labelpad=1, fontsize=18) +ax.legend(loc="upper right", frameon=False, ncol=2, fontsize=14) +plt.tight_layout() +plt.subplots_adjust(hspace=0.1) +plt.show() diff --git a/paper_plots/plot-models-reduced-chisq.py b/paper_plots/plot-models-reduced-chisq.py new file mode 100644 index 0000000..4216456 --- /dev/null +++ b/paper_plots/plot-models-reduced-chisq.py @@ -0,0 +1,74 @@ +import os +import matplotlib.pyplot as plt +from project_experiments.load_routines import query_db + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 16 +plt.rcParams["axes.linewidth"] = 2 + +# Files with the fit results +s_db_filename_1 = "ibm_cusco.nu.dde4848bb5cb4792803098f681799afddata.csv" +s_db_filename_2 = "ibm_cusco.nu.3db06923872a4c8eaa9f20dfe164579ddata.csv" + +s_db_filename_1_b = "ibm_cusco.nu.8e4f75fb6fd44caf95bcc57c96e54994data.csv" +s_db_filename_2_b = "ibm_cusco.nu.73bac065c0fa4acebb7b0ea55b0f4b46data.csv" + +s_db_filename_1_kappa = "ibm_cusco.nu.9de0c3cedcb04dd1967c7a873437b9addata.csv" +s_db_filename_2_kappa = "ibm_cusco.nu.f62de71eb69346139fac3086ce4d5f62data.csv" + +s_output_path = os.path.abspath("../output") + "/" +s_csv_file = s_output_path + "PO/" + s_db_filename_1 + +# Arbitrary fit parameter, just for load the reduced-chi^2 +parameter = "'nu_PO'" + +sort_by = ["end_date"] + +# Load files +s_filter_query = "variable_name == " + parameter +df1 = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +s_csv_file = s_output_path + "PO/" + s_db_filename_2 +df2 = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +s_csv_file = s_output_path + "PO/" + s_db_filename_1_b +df1_b = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +s_csv_file = s_output_path + "PO/" + s_db_filename_2_b +df2_b = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +s_csv_file = s_output_path + "PO/" + s_db_filename_1_kappa +df1_kappa = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +s_csv_file = s_output_path + "PO/" + s_db_filename_2_kappa +df2_kappa = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +# Plot reduce chi^2 +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +ax.scatter(df1_kappa.chi_sq, df1.chi_sq, color="blue", alpha=0.5) +ax.scatter(df2_kappa.chi_sq, df2.chi_sq, color="blue", alpha=0.5) +ax.set_xlabel(r"Reduced $\chi^2$ with fitting $\kappa$", labelpad=1, fontsize=18) +ax.set_ylabel(r"Reduced $\chi^2$ with fixing $\kappa=0$", labelpad=1, fontsize=18) +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_ylim([0, 10]) +ax.set_xlim([0, 10]) +plt.tight_layout() + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +ax.scatter(df1_b.chi_sq, df1.chi_sq, color="blue", alpha=0.5) +ax.scatter(df2_b.chi_sq, df2.chi_sq, color="blue", alpha=0.5) +ax.set_xlabel(r"Reduced $\chi^2$ with fitting $b$", labelpad=1, fontsize=18) +ax.set_ylabel(r"Reduced $\chi^2$ with fixing $b=1/2$", labelpad=1, fontsize=18) +ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") +ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") +ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") +ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +ax.set_ylim([0, 10]) +ax.set_xlim([0, 10]) +plt.tight_layout() +plt.show() diff --git a/paper_plots/plot-time-stability.py b/paper_plots/plot-time-stability.py new file mode 100644 index 0000000..49bc7ed --- /dev/null +++ b/paper_plots/plot-time-stability.py @@ -0,0 +1,85 @@ +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +import os +import pandas as pd +import matplotlib.pyplot as plt +from project_experiments.load_routines import query_db + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 18 +plt.rcParams["axes.linewidth"] = 2 + +s_db_filename = "ibm_cusco.Time_Series.07_20_2023.9876f87948744fc0a060c645dcabc189.csv" +s_output_path = os.path.abspath("../output") + "/" +s_csv_file = s_output_path + "time_series/" + s_db_filename + +# Choose which parameter to load +parameter = "'nu_PO'" + +sort_by = ["end_date"] +s_group_by = "device_components" + +# Choose how to filter the data +s_filter_query = ( + "variable_name == " + parameter + " & chi_sq < 3.0" + " & std_dev < 100000" +) +df = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +# Set specific qubits to plot +show_qubits = ["0", "10", "18", "20", "22", "24", "30", "8", "2", "12"] + +# Calculate time of the experiment relative to the first one +dates = pd.to_datetime(df.end_date) +min_t = min(dates) +t_axis = [] +for index, value in dates.items(): + t_axis.append((dates[index] - min_t).seconds / 60.0) +df["t"] = t_axis + +groups = df.groupby(["device_components"]) + +# Plot +fig, axs = plt.subplots( + 3, 1, figsize=(8, 8), gridspec_kw={"height_ratios": [1, 1, 3]}, sharex=True +) +count = 0 +for group_name, group_df in groups: + if group_name[1:] in show_qubits: + if group_name[1:] == "12": + ax = axs[0] + elif group_name[1:] == "2": + ax = axs[1] + else: + ax = axs[2] + ax.errorbar( + group_df.t.values, + group_df.value.values, + yerr=group_df.std_dev.values, + fmt="-o", + alpha=0.8, + capsize=4, + markersize=5, + label=str(group_name), + color=f"C{count}", + ) + count += 1 + +axs[-1].set_xlabel(r"time [m]") +for ax in axs: + ax.legend(bbox_to_anchor=(1.05, 1.0), loc="upper left", frameon=False, fontsize=13) + ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") + ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") + ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") + ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +fig.supylabel(r"$\nu / 2\pi$ [Hz]") +plt.tight_layout() +plt.subplots_adjust(hspace=0.08) +plt.show() diff --git a/paper_plots/plot-time-stability_Falcon.py b/paper_plots/plot-time-stability_Falcon.py new file mode 100644 index 0000000..bc50bdd --- /dev/null +++ b/paper_plots/plot-time-stability_Falcon.py @@ -0,0 +1,84 @@ +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +import os + +import pandas as pd +import matplotlib.pyplot as plt +from brokenaxes import brokenaxes +from matplotlib import gridspec +from uncertainties import ufloat +from project_experiments.load_routines import query_db + +# Set plot parameters +plt.rc("text", usetex=True) # set usetex=False if tex isn't installed +plt.rc("font", family="serif") +plt.rcParams["font.size"] = 18 +plt.rcParams["axes.linewidth"] = 2 + +s_db_filename = ( + "test_sapporo.Time_Series.07_16_2023.0f0326900a314a43b3188de66c1bced0.csv" +) + +s_output_path = os.path.abspath("../output") + "/" +s_csv_file = s_output_path + "time_series/" + s_db_filename + +# Choose which parameter to load +parameter = "'nu_PO'" + +sort_by = ["end_date"] +s_group_by = "device_components" + +# Choose how to filter the data +s_filter_query = ( + "variable_name == " + parameter + " & chi_sq < 3.0" + " & std_dev < 100000" +) +df = query_db(s_csv_file, s_filter_query, sort_by, na_position="first") + +# Set specific qubits to plot +show_qubits = ["8", "19", "7", "12", "14"] + +# Calculate time of the experiment relative to the first one +dates = pd.to_datetime(df.end_date) +min_t = min(dates) +t_axis = [] +for index, value in dates.items(): + t_axis.append((dates[index] - min_t).seconds / 60.0) +df["t"] = t_axis + +groups = df.groupby(["device_components"]) + +# Plot +fig, ax = plt.subplots(1, 1, figsize=(8, 5)) +count = 0 +for group_name, group_df in groups: + if group_name[1:] in show_qubits: + ax.errorbar( + group_df.t.values, + group_df.value.values, + yerr=group_df.std_dev.values, + fmt="-o", + alpha=0.8, + capsize=4, + markersize=5, + label=str(group_name), + color=f"C{count}", + ) + count += 1 +axs = [ax] +axs[-1].set_xlabel(r"time [m]") +for ax in axs: + ax.legend(bbox_to_anchor=(1.05, 1.0), loc="upper left", frameon=False, fontsize=13) + ax.xaxis.set_tick_params(which="major", size=7, width=2, direction="in", top="on") + ax.xaxis.set_tick_params(which="minor", size=5, width=2, direction="in", top="on") + ax.yaxis.set_tick_params(which="major", size=7, width=2, direction="in", right="on") + ax.yaxis.set_tick_params(which="minor", size=5, width=2, direction="in", right="on") +fig.supylabel(r"$\nu / 2\pi$ [Hz]") +plt.tight_layout() +plt.subplots_adjust(hspace=0.08) +plt.show() From 82cd299417f6e13fd0924dd5ef862e6b8dc1c7dd Mon Sep 17 00:00:00 2001 From: Liran Shirizly <108616499+LiranShirizly@users.noreply.github.com> Date: Thu, 10 Aug 2023 19:30:00 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e44a601..269a364 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ This repository contains the data of exeperiments and numerical simulations pres _Dissipative Dynamics of Graph-State Stabilizers with Superconducting Qubits_, Liran Shirizly, Grégoire Misguich, Haggai Landa, [arXiv:2308.01860](https://arxiv.org/abs/2308.01860) -Together with the [data](./output), the complete source code allowing to run the experiments and simulations is included. +Together with the [data](./output), the complete source code allowing to run the [experiments](./project_experiments) and [simulations](./project_simulations) is included. The [lindbladmpo](https://github.com/qiskit-community/lindbladmpo) repository is required (together with [ITensor](https://github.com/ITensor/ITensor)), and assumed to be cloned to a directory side by side with current repo's root folder. See the [installation guide](https://github.com/qiskit-community/lindbladmpo/blob/main/INSTALL.md) of _lindbladmpo_ for instructions on compiling the C++ binary necessary for running the simulations. The `requirements.txt` file allows for pip installing the dependencies of the code. -More details to be listed here soon. +A simple code example allowing to run charge-parity characterization is given [here](./project_experiments/run-parity-characterization.py).