The paper we followed is written by Gavin E. Crooks : Gradients of parameterized quantum gates using the parameter-shift rule and gate decomposition
See requirement.txt or
pip install -r requirements.txtThe main code is written in simulation.ipynb and the result will be saved in result_npy. Data with 128 and 1024 shots have already be saved. To load the trained parameters and record from npy files, try
np.load('some_file.npy', allow_pickle=True)Note that it is important to use allow_pickle=True since we're going to load a dict file.
To get the plot of the result, see plot_result.ipynb