Figure2=figure(2);
clf;
F_in=0.8:0.01:1;
F = F_in;
%%%%%%%%%%%
N=3;
M=4;
F_out_LQNC= Calculate_fidelity_LQNC_N_hop_M_pair(F_in,N,M);
F_out_ES= Calculate_fidelity_ES_N_hop_M_pair(F_in,N,M);
F_improvement = 100*(F_out_LQNC-F_out_ES)./(F_out_ES);
loglog(F_in,F_improvement,'b-+','LineWidth',1,'MarkerSize', 10,'DisplayName',['N=' num2str(N) 'hops, M=' num2str(M) ' pairs']);
set(gca,'FontSize',14);
hold on;
%grid on;
%%%%%%%%%%%
N=4;
M=8;
F_out_LQNC= Calculate_fidelity_LQNC_N_hop_M_pair(F_in,N,M);
F_out_ES= Calculate_fidelity_ES_N_hop_M_pair(F_in,N,M);
F_improvement = 100*(F_out_LQNC-F_out_ES)./(F_out_ES);
loglog(F_in,F_improvement,'b-o','LineWidth',1,'MarkerSize', 10,'DisplayName',['N=' num2str(N) 'hops, M=' num2str(M) ' pairs']);
set(gca,'FontSize',14);
hold on;
%grid on;
%%%%%%%%%%%
N=7;
M=10;
F_out_LQNC= Calculate_fidelity_LQNC_N_hop_M_pair(F_in,N,M);
F_out_ES= Calculate_fidelity_ES_N_hop_M_pair(F_in,N,M);
F_improvement = 100*(F_out_LQNC-F_out_ES)./(F_out_ES);
loglog(F_in,F_improvement,'b-s','LineWidth',1,'MarkerSize', 10,'DisplayName',['N=' num2str(N) 'hops, M=' num2str(M) ' pairs']);
set(gca,'FontSize',14);
hold on;
%grid on;
%%%%%%%%%%%
N=10;
M=14;
F_out_LQNC= Calculate_fidelity_LQNC_N_hop_M_pair(F_in,N,M);
F_out_ES= Calculate_fidelity_ES_N_hop_M_pair(F_in,N,M);
F_improvement = 100*(F_out_LQNC-F_out_ES)./(F_out_ES);
loglog(F_in,F_improvement,'b-d','LineWidth',1,'MarkerSize', 10,'DisplayName',['N=' num2str(N) 'hops, M=' num2str(M) ' pairs']);
set(gca,'FontSize',14);
hold on;
%grid on;
h_legend=legend('show');
set(h_legend,'FontSize',16);
set(Figure2,'defaulttextinterpreter','latex');
title(['Fidelity Improvement: LQNC vs. ES '],'fontsize',20)
xlabel('Input Fidelity ($F_{in}$)','fontsize',20) % x-axis label
ylabel('$\frac{F^{LQNC}_{out} - F^{ES}_{out}}{F^{ES}_{out}}100$ [\%]','fontsize',20) % y-axis label
ylim ([0 1000]);
xlim ([0.8 1]);