Reproduction of Machine learning of high dimensional data on a noisy quantum processor.
python main.py [-h] [--run RUN] [--n_qubits N_QUBITS] [--n_samples N_SAMPLES] [--qgamma QGAMMA] [--qp QP]
[--rgamma RGAMMA] [--cv CV]
--run all
to run all experiments. The program will go through the following steps:
-
Download PLAsTiCC data if no data available.
The preset data urls may expire. Find data in kaggle.
-
Run process.py if no processed feature data to use.
-
Sample data with size
n_samples N_SAMPLES
. The sampled data will be saved automatically and used in the following experiments.NOTE: Sampled will be used in every run. Delete /data/data1k if you want to use different set.
-
Tune c1:
--run tune_c1
Reproduce Supplementary Figure 2a: Hyperparameter Tuning c1.
-
Explore dataset size:
--run dataset_size
Reproduce Figure 3: Learning Curve and Sample Variance.
-
Build data280:
--run data280
Select 280 data and compute kernel on these data.
-
Tune Cnoiseless:
--run tune_Cnl
Reproduce Supplementary Figure 2b: Hyperparameter Tuning C on noiseless circuit.
-
Tune Chardware:
--run tune_Chw
Reproduce Supplementary Figure 8: Hyperparameter Tuning C on hardware with noise.
-
Noiseless vs. Experimental Results:
--run NLvsHW
Reproduce Supplementary Figure 4c: Noiseless vs. Experimental Results.
pip install -r requirements.txt
Only test on cpu with Schwimmbad library to accelerate processing and computing, not sure whether it will conflict with paddlepaddle-gpu.
-
Number of features
67 VS. 53
53 features:
feature feature feature feature 1 n_measure 16 sum_flux_err2 31 fou2_0 46 fou1_4 2 min_flux 17 skew_flux_err2 32 kur_0 47 fou2_4 3 max_flux 18 mean_interval 33 skew_0 48 kur_4 4 mean_flux 19 max_interval 34 fou1_1 49 skew_4 5 med_flux 20 hostgal_specz 35 fou2_1 50 fou1_5 6 std_flux 21 hostgal_photoz 36 kur_1 51 fou2_5 7 skew_flux 22 hostgal_photoz_err 37 skew_1 52 kur_5 8 min_flux_err 23 ra 38 fou1_2 53 skew_5 9 max_flux_err 24 decl 39 fou2_2 10 mean_flux_err 25 gal_l 40 kur_2 11 med_flux_err 26 gal_b 41 skew_2 12 std_flux_err 27 ddf 42 fou1_3 13 skew_flux_err 28 distmod 43 fou2_3 14 sum_flux_err_ratio 29 mwebv 44 kur_3 15 skew_flux_err_ratio 30 fou1_0 45 skew_3 -
Fourier coefficient
Omit imaginary part?
-
Logscale
logscale_features = ['min_flux', 'max_flux', 'mean_flux', 'med_flux', 'std_flux', 'skew_flux',\ 'min_flux_err', 'max_flux_err', 'mean_flux_err', 'med_flux_err', 'std_flux_err',\ 'skew_flux_err', 'sum_flux_err_ratio', 'skew_flux_err_ratio', 'sum_flux_err2',\ 'skew_flux_err2', 'hostgal_specz', 'hostgal_photoz', 'hostgal_photoz_err']
-
Robust scaler
Transformation in paper:
$$x_k'=\pi (\frac{x_k-P_1}{P_{99}-P_1})-\frac{\pi}{2}$$ is different from sklearn.preprocessing.RobustScaler.