Code Monkey home page Code Monkey logo

qkernel's Introduction

qkernel

Reproduction of Machine learning of high dimensional data on a noisy quantum processor.

Run

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:

  1. Download PLAsTiCC data if no data available.

    The preset data urls may expire. Find data in kaggle.

  2. Run process.py if no processed feature data to use.

  3. 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.

  4. Tune c1: --run tune_c1

    Reproduce Supplementary Figure 2a: Hyperparameter Tuning c1.

  5. Explore dataset size: --run dataset_size

    Reproduce Figure 3: Learning Curve and Sample Variance.

  6. Build data280: --run data280

    Select 280 data and compute kernel on these data.

  7. Tune Cnoiseless: --run tune_Cnl

    Reproduce Supplementary Figure 2b: Hyperparameter Tuning C on noiseless circuit.

  8. Tune Chardware: --run tune_Chw

    Reproduce Supplementary Figure 8: Hyperparameter Tuning C on hardware with noise.

  9. Noiseless vs. Experimental Results: --run NLvsHW

    Reproduce Supplementary Figure 4c: Noiseless vs. Experimental Results.

Env

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.

Discrepancy & Question

  • 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.

qkernel's People

Contributors

wanbingzhao avatar wy-go avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.