Quantum-Dynamics-Hub / libra-code

https://quantum-dynamics-hub.github.io/libra/index.html
GNU General Public License v3.0
51 stars 47 forks source link

Fix hop in dyn_hop_proposal.cpp #225

Closed foxtran closed 2 months ago

foxtran commented 2 months ago

In one of variants of hop function, initstate variable is not defined. After some looking, I've noticed that hop(int initstate, std::vector<double> &, double) is exactly the same hop(std::vector<double> &, double). In several places, where first variant of routine is called, initstate is 0, so I decided to call hop(int initstate, std::vector<double> &, double) from hop(std::vector<double> &, double) with initstate = 0. So, it should act as it was before.

foxtran commented 2 months ago

There is a three-arg variant with vector at second argument: https://github.com/Quantum-Dynamics-Hub/libra-code/blob/14a99c738ef09d9a58ccdc83aeab611e72bbc2e1/src/dyn/dyn_hop_proposal.cpp#L1361-L1402

It is also defined in header: https://github.com/Quantum-Dynamics-Hub/libra-code/blob/14a99c738ef09d9a58ccdc83aeab611e72bbc2e1/src/dyn/dyn_hop_proposal.h#L82

So, it must work :)