Ejemplo n.º 1
0
#del S2_dep2, S2_depI, S2_fCX, S2_fHH, S2_Idep, S2nft_tot, S
#del ps, pm, mc, sc, P2, P3
#del average, nr_loops, timeleft, stop, diff, lapsesleft, percentage, start
#%%
data = {
    'NFTfid': fidnft,
    'FTfid': fidft,
    'totalfiddiff': fiddiff_tot,
    'NFTtd': tdnft,
    'FTtd': tdft,
    'Tottd': tdtot,
    'pslist': pslist,
    'pmlist': pmlist
}
store.save_chi(data, datetime.datetime.now(), 's', 'Simulations')

pt.plot_contour_fid(pslist, pmlist, fidnft, 'NFT Fidelities', levels=40)
pt.plot_contour_fid(pslist, pmlist, fidft, 'FT Fidelities', levels=40)
pt.plot_contour_fid(pslist, pmlist, tdnft, 'NFT Trace Distance', levels=40)
pt.plot_contour_fid(pslist, pmlist, tdft, 'FT Trace Distance', levels=40)
#%%
pt.plot_contour_fid(pslist, pmlist, tdtot, 'Distance total', levels=30)
pt.plot_contour_fid(pslist,
                    pmlist,
                    fiddiff_tot,
                    'Summing fid distance total',
                    levels=30)
#%%
pt.plot_surface(pslist, pmlist, tdtot)
pt.plot_surface(pslist, pmlist, fiddiff_tot)
Ejemplo n.º 2
0
print('Process fidelity from error matrix:',
      np.around(np.abs(process_fidelity), 3))
print('Channel fidelity from Choi matrix:',
      np.around(np.abs(channel_fidelity), 3))
print('Process fidelity from unfiltered error matrix:',
      np.around(np.abs(process_fidelity_unfiltered), 3))

#%% Store the results
chi_dict = {
    'chi': chi,
    'chi_filtered': chi_filtered,
    'chi_perror': chi_perror,
    'chistddv': chistddv,
    'chistddv_error': chi_perror_stddv
}

store.save_chi_last(chi_dict, circuit_name)
store.save_chi(chi_dict, timestamp, run_type, circuit_name)
#%% delete unwanted variables
del fit_method, direct, run_type, timestamp, tomo_data, tomo_set
#%% Plotting
pt.plot_city(chi, tomoself.get_pauli_names(n), r'$\chi_{filtered}$')
pt.plot_city(chi_perror, tomoself.get_pauli_names(n), r'$\chi_{error}$')
#%% Plotting with standard deviation
#pt.plot_city_with_var(chi,chistddv, tomoself.get_pauli_names(n),r'$\chi_{filtered}$')
#pt.plot_city_with_var(chi_perror,chi_perror_stddv, tomoself.get_pauli_names(n),r'$\chi_{error}$')
#%% Plotting of Pauli twirl and printing ratio
pt.plot_pauli_weight(np.diag(chi_perror), 2 * np.diag(chi_perror_stddv),
                     tomoself.get_pauli_names(n), n)
ratio = an.get_multi_single_ratio(chi_perror, chi_perror_stddv)
print('Ratio multi to single: %f +- %f' % (ratio[0], ratio[1]))