rmlarose / nisqai-dev

Development repository for NISQAI.
Apache License 2.0
15 stars 4 forks source link

Added nisqai.optimize and a new minimizer #15

Closed jtiosue closed 5 years ago

jtiosue commented 5 years ago

I added the nisqai.optimize module. Right now it only contains the function minimize, which is the same as scipy.optimize.minimize except that it also supports using my bounded Powell method.

I added my bounded Powell minimizer. To see usage, run help(nisqai.optimize.bounded_Powell).

Updated the Network.train function. It now uses nisqai.optimize.minimize, and also accepts additional keyword arguments beyond trainer, initial_angles, and shots. I follow the scipy format. So Network.train accepts arbitrary keyword arguments **kwargs, which are then sent into scipy.opimize.minimize as scipy.optmize.minimize(cost, initial_angles, method=trainer, options=kwargs). This way, we can specify options for the optimization such as, for example, maxfev, ftol, etc.

I updated the requirements.txt file such that pip install -r requirements.txt from within a virtual environment will install everything necessary.

I updated .gitignore to ignore virtual environment and pytest files and folders.