Re: Tweaking junctions

2010-11-01 Thread Dave Whipp
Buddha Buck wrote: Is it too late in this discussion to point out that, in non-perl usage, eigenstates are associated with the operator, not with the value fed into the operator? [cut] So asking for the eigenstates of a quantum superposition is asking the wrong object for the property. Probab

Re: Tweaking junctions

2010-11-01 Thread Buddha Buck
On Mon, Nov 1, 2010 at 7:24 AM, Moritz Lenz wrote: > On 10/22/2010 06:16 AM, Damian Conway wrote: >> That is, a C<$value> is an eigenstate of a C<$junction> if-and-only-if: >> >>     $value !~~ Junction  &&  $value ~~ $junction > > In general this definition makes it impossible to return a list of

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
Food for thought, a few non-junction solutions: On 10/22/2010 06:16 AM, Damian Conway wrote: > # Find the list of common elements in two lists... > sub intersection (@list1, @list2) { > (any(@list1) & any(@list2).eigenstates; > } sub intersection(@list1, @list2) { uniq gat

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 11/01/2010 12:41 PM, Damian Conway wrote: > Moritz wrote: > >>> $value !~~ Junction && $value ~~ $junction >> >> In general this definition makes it impossible to return a list of >> eigenstates from the junction. Just think of junctions containing Code >> objects. > > Well, that's a d

Re: Tweaking junctions

2010-11-01 Thread Damian Conway
Moritz wrote: >>     $value !~~ Junction  &&  $value ~~ $junction > > In general this definition makes it impossible to return a list of > eigenstates from the junction. Just think of junctions containing Code > objects. Well, that's a deficiency in smartmatching: that Callable ~~ Code doesn't ch

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 10/22/2010 06:16 AM, Damian Conway wrote: > That is, a C<$value> is an eigenstate of a C<$junction> if-and-only-if: > > $value !~~ Junction && $value ~~ $junction In general this definition makes it impossible to return a list of eigenstates from the junction. Just think of junctions con