JavaFXpert / vqe-playground

Playground for gaining intuition about Variational Quantum Eigensolver
Other
16 stars 7 forks source link

Angle Rotation always in same direction #9

Closed ulitoo closed 3 years ago

ulitoo commented 3 years ago

Hi

vqe_playground/vqe_main.py Line 428

when the optimizator is called, the unit direction is re-initialized to 1 each time, overwriting and forcing any subsequent rotation to direction +1 and not considering the "direction decision" made in the rotation initilization.

    unit_direction_array = np.ones(len(self.optimized_rotations))

would be solved if the unit_direction_array is a self. global array initialized outside the optimize_rotation function.

let me know if you agree, I debug the program and its always summing angles, never substracting.

J

JavaFXpert commented 3 years ago

Thanks! Please feel free to create a pull request.

Regards, James Weaver

On Sat, Dec 12, 2020, at 10:47 AM, Julio Barrientos wrote:

Hi

vqe_playground/vqe_main.py Line 428

when the optimizator is called, the unit direction is re-initialized to 1 each time, overwriting and forcing any subsequent rotation to direction +1 and not considering the "direction decision" made in the rotation initilization.

unit_direction_array = np.ones(len(self.optimized_rotations)) would be solved if the unit_direction_array is a self. global array initialized outside the optimize_rotation function.

let me know if you agree, I debug the program and its always summing angles, never substracting.

J

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JavaFXpert/vqe-playground/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLZ5WVE33ILFGH64FI6VYDSUOGBJANCNFSM4UYJRDBQ.

ulitoo commented 3 years ago

pull request done

ulitoo commented 3 years ago

Pull request done and merged