The function RWC_alam(B, c1, c2, v) is supposed to return an optimal pair (a, lambda) that minimizes the expectation value of the Hamiltonian defined by (B,c1,c2) on the ground state. It does this by finding the zeroes of the expectation value regarded as a function of a.
However, the code actually returns the maximum value of a0 where a0 is a zero of the derivative of the expectation value.
aa0:=max(fsolve(RWC2(A,muf(A))=0,A))
It SHOULD evaluate the expectation value at each zero and then pick the zero that minimizes the expectation value.
In practice, this probably doesn't make much difference since there is probably always just one zero.
The function
RWC_alam(B, c1, c2, v)is supposed to return an optimal pair(a, lambda)that minimizes the expectation value of the Hamiltonian defined by (B,c1,c2) on the ground state. It does this by finding the zeroes of the expectation value regarded as a function ofa.However, the code actually returns the maximum value of
a0wherea0is a zero of the derivative of the expectation value.It SHOULD evaluate the expectation value at each zero and then pick the zero that minimizes the expectation value.
In practice, this probably doesn't make much difference since there is probably always just one zero.