PennyLaneAI / pennylane-pq

Contains the PennyLane ProjectQ plugin. This plugin provides three devices to work with PennyLane - the ProjectQ IBM device, the ProjectQ quantum simulator, and the ProjectQ classical simulator.
https://docs.pennylane.ai/projects/projectq
Apache License 2.0
16 stars 9 forks source link

Demos #4

Closed cgogolin closed 5 years ago

cgogolin commented 5 years ago

Hi Maria, As a warm-up for implementing unit-test I have played around with the demos and have some qusestions/feedback:

Note: Please be aware that due to the renaming and refactoring you will likely have to uninstall all old versions of openqml and openqml_pq and then install first the latest master of openqml and then the latest master of openqml_pq to make everything work.

mariaschuld commented 5 years ago

Hey Christian. Thanks for the comments! Let me comment back. PS: I think you did not look at the examples branch, did you? Because some issues are solved there and the examples majorly polished...

For 1 - This is the example where the gradient descent optimizer gets stuck in a saddle point. Should converge to -1, not 0. Let me open a separate issue for this. I decided against scientific notation because the eye traces convergence better with fixed point notation.

2a (now 3a) - Solved in principle. I decomposed stateprep but there is a bug somewhere. On my to do list. 2b (now 3b) - State prep is an issue. I need BasisState(...) to work for this. In short, since in qnode I don't have access to unwrapped kwargs, such as the binary strings I input, I cannot do the "if x[i] == 1 flip the ith qubit" command. Will open another issue. 3a (now 2a) - Yes, should work. Need a nicer initial state though to make opt landscape more interesting. 1/sqrt(3)(|00> + |10> + |11>) worked well, but need to figure out how to prepare this. Just polishing jupyter notebook. 3b (now 2b) - Yes, cost is unbounded. Tried square, but then the quantum example stops being so nice. Not sure yet.

-> Note: I tried to keep track of developments by pip installing openqml-pq and openqml every morning...

mariaschuld commented 5 years ago

Let me open issues for the things I'd need your help with :)

cgogolin commented 5 years ago

Indeed, I made a mistake here. Let me close this...