This repository provides the experimental code for work "Guided-SPSA: Simultaneous Perturbation Stochastic Approximation assisted by the Parameter Shift Rule by M. Periyasamy et. al.". However, this repo is an initial experimental implementation of guided-spsa. For the installable module of the guided-spsa gradient evaluation, please refer to the following git repository "gspsa-gradients".
We recommend setting up a conda environment and install the required python packages using the environment.yml
file:
conda env create -f environment.yml
We use Hyrda to configure the experimental hyperparameters and run the respective experiments.
The default hyperparameters for the regression experiments are in the file "config_reg.yaml" under the directory "src/conf". One can adjust the hyperparameters and run the experiment as shown below:
python -u src/regression.py hydra/job_logging=disabled
All parameters in "config_reg.yaml" can also be adjusted during the Python execution as shown below:
python -u src/regression.py hydra/job_logging=disabled 'algorith_params.lr=0.03'
The default hyperparameters for the regression experiments are in the file "config_clas.yaml" under the directory "src/conf". One can adjust the hyperparameters and run the experiment as shown below:
python -u src/classification.py hydra/job_logging=disabled
All parameters in "config_clas.yaml" can also be adjusted during the Python execution as shown below:
python -u src/classification.py hydra/job_logging=disabled 'algorith_params.lr=0.03'
We use qiskit
software framework: https://github.com/Qiskit
If you use the gspsa-gradients
or results from the paper, please cite our work as
@misc{periyasamy2024guidedspsa,
title={Guided-SPSA: Simultaneous Perturbation Stochastic Approximation assisted by the Parameter Shift Rule},
author={Maniraman Periyasamy and Axel Plinge and Christopher Mutschler and Daniel D. Scherer and Wolfgang Mauerer},
year={2024},
eprint={2404.15751},
archivePrefix={arXiv},
primaryClass={quant-ph}
}
Apache 2.0 License