Skip to content

Implementing "Parameter-Shift Rule", providing as one of the feasible methods for computing gradients on quantum neural networks in real quantum computers.

License

Notifications You must be signed in to change notification settings

maplexgitx0302/QML-Qiskit_Parameter_Shift

Repository files navigation

Parameter-Shift Rule using Qiskit


The paper we followed is written by Gavin E. Crooks : Gradients of parameterized quantum gates using the parameter-shift rule and gate decomposition

Prerequisities

See requirement.txt or

pip install -r requirements.txt

Run code

The 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

About

Implementing "Parameter-Shift Rule", providing as one of the feasible methods for computing gradients on quantum neural networks in real quantum computers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published