in reply to Re: Problem using Q::SP's
in thread Problem using Quantum::Superpositions
Thanks Joost. ({grin} at RMGir)
I had a 'feeling' it was a context problem as noted. I just didn't know what to do about.
So, spelling out what is going on here (just incase I'm not the only DSOB that reads this):
With my $var = all(); when all() checks wantarray() to determine its calling context, it gets SCALER and therefore returns the count of the states that matched the condition.
With my ($var) = all();, wantarray() gives ARRAY so all() (or probably eigenstates()) returns the list (in this case containing just one value) that matched the condition.
I know I'll be (rightfully and usefully) corrected if this is wrong:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Problem using Q::SP's
by RMGir (Prior) on Jul 10, 2002 at 16:03 UTC |