Source code used for variational quantum fidelity estimation for quantum channels.
- Run
generator.py
to produce a sample of random channels. By default 1000 channels are generated. - Run
vqcd_optimization.py n
, wheren
is 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.py
to 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.py
to 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.py
for generating random channels. The generated channels are saved in thedata
subdirectory, -
vqcd_main_funcs.py
contains the main subroutines of the diagonalization and fidelity estimation algorithm as followscost_func
cost function evaluation,eig_info
inferred eigenvalues generation andtrun_output
(truncated fidelity bounds estimation) functions.
-
vqcd_secondary_funcs.py
contains secondary subroutines as followsjamilchoi
generates Choi–Jamiołkowski (JC) state of any dimension quantum channel,purity_before_diag
gives the purity of the state before diagonalization,maximum_likelihood
performs maximum-likelihood to avoid negative eigenvalues.
-
vqcd_optimization.py n
, wheren
is the index of the channel generated (if non
provided then the index by default is0
) to run optimization procedure for random quantum channels, by default the optimized angles are saved indata/opt_ang_test
subfolder, -
vqcd_all_chan.py
for 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_test
subfolder, -
vqcd_single_chan.py
for 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_test
subfolder, -
vqcd_plot.py
for plotting the results and contains two subroutines as followsaverage_fidelity
returns plot for average fidelity estimation error for a defined total number of channels,single_chan_fidelity
returns plot for a single channel depicting truncated fidelity bound in respect with rank of the JC state. Plots are saved inplot
subdirectory
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