Source code used for variational quantum fidelity estimation for quantum channels.
- Run
generator.pyto produce a sample of random channels. By default 1000 channels are generated. - Run
vqcd_optimization.py n, wherenis the index of the channel generated in the previous steps. - Run
vqcd_all_chan.py, to generate and save the average error in fidelity estimation with respect to rank of the state. - Run
vqcd_single_chan.pyto generate and save the error in fidelity estimation for the lowest error channel. Note to generate the lowest error quantum channel runlowest_error_channel.py, which saves the channel number with lowest error. - Run
vqcd_plot.pyto generate and save the plots.
This repository contains source code for running diagonalization procedure as well as to estimate fidelity (error in fidelity estimation) for 1 and 2 qubit channels.
The main folder contains the following files:
-
generate.pyfor generating random channels. The generated channels are saved in thedatasubdirectory, -
vqcd_main_funcs.pycontains the main subroutines of the diagonalization and fidelity estimation algorithm as followscost_funccost function evaluation,eig_infoinferred eigenvalues generation andtrun_output(truncated fidelity bounds estimation) functions.
-
vqcd_secondary_funcs.pycontains secondary subroutines as followsjamilchoigenerates Choi–Jamiołkowski (JC) state of any dimension quantum channel,purity_before_diaggives the purity of the state before diagonalization,maximum_likelihoodperforms maximum-likelihood to avoid negative eigenvalues.
-
vqcd_optimization.py n, wherenis the index of the channel generated (if nonprovided then the index by default is0) to run optimization procedure for random quantum channels, by default the optimized angles are saved indata/opt_ang_testsubfolder, -
vqcd_all_chan.pyfor finding the average error in fidelity estimation (by default the channel number set to1000), by default the average error for each channel are saved indata/fid_plot_data_testsubfolder, -
vqcd_single_chan.pyfor finding the convergence of fidelity with rank of the state for a particular quantum channel, by default the average error for each channel are saved indata/fid_plot_data_testsubfolder, -
vqcd_plot.pyfor plotting the results and contains two subroutines as followsaverage_fidelityreturns plot for average fidelity estimation error for a defined total number of channels,single_chan_fidelityreturns plot for a single channel depicting truncated fidelity bound in respect with rank of the JC state. Plots are saved inplotsubdirectory
This folder is a placeholder for the preprint files.
This code can be distributed under the Apache License.
Python scripts in this repository have been tested with
- qiskit (0.18.2)
- numpy (1.21.2)
- scipy (1.7.1)
To install the recent version of Qiskit run
!pip install qiskit==0.18.2