Thank you so much John! I understand your point. I had defined summation of looped values, which was commented out from the code I posted:
ll = ll + l(δ,σ)
I wrongly interpreted that to be more fundamental error so I commented it out in order to make progress in other parts of the code. That returns me to other errors I encountered before.
Including that line again produces a new error of l
not being defined. So I initialize that with zero before the loops, but now the problem is that δ
is not defined. I don’t understand what is the fundamental difference to the first of the two examples that I used? That has a function with non-defined argument μσ
that does not cause UndefVarError
. Why does it appear with my code? Does it have something to do with the if statements?
I think my current code passes censQML
to optimize
with pre-determined argument values. However, I realize now that that is an unnecessary twist any way.
Antti
PS. I fixed using
in my original post.