Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: Nested Quantum::Superpositions

by welchavw (Pilgrim)
on Nov 07, 2003 at 14:49 UTC ( #305308=note: print w/replies, xml ) Need Help??

in reply to Re: Nested Quantum::Superpositions
in thread Nested Quantum::Superpositions

Ok. Realizing that all(1,4)!= all(1,4) helps me a bunch - thanks to all posters. As a followup, it seems to me that the docs must be in error when they imply that the following code could ever work...

$ideal = any( all("tall", "rich", "handsome"), all("rich", "old"), all("smart","Australian","rich") ); while (@features = get_description) { if (any(@features) eq $ideal) { print "True love"; } }

After all, I think that it has been illustrated that an "n-all" where n>1 cannot eq anything. Am I wrong?

update: Of course, I am wrong about this. I must have had those Friday-morning blinders on. An "n-all" cannot eq an "n-all" of the same order (update: except if ni=C for 0<=i<=ordern-1 (e.g. all(1,1,1) == all(1,1,1)), but that doesn't mean that an any can't match "n-all" of order > 1. My bad.

upupdate: Fantastic! Now, I actually understand the Q::S operators. Many thanks to Tilly (and also for reporting the docs bug). I really had to struggle to get used to distributing the operator joining each composite superposition across the cross-products (or something like that!). Then, everything clicked (here's to hoping it stays clicked). Q::S is really a neat package, IMHO, but a bit of a mind-bender initially.


Replies are listed 'Best First'.
Re: Re: Re: Nested Quantum::Superpositions
by TheDamian (Priest) on Nov 07, 2003 at 21:07 UTC
    Q::S is really a neat package, IMHO, but a bit of a mind-bender initially.
    Obviously for their inventor too, since he apparently couldn't even get a simple example right in the docs! ;-)

    I'm sure the module's new maintainer will update them accordingly for the next release.

    Meanwile I do appreciate the bug report. One of the projects I'm currently working on is finalizing the semantics of Perl 6 junctions, which are an evolution of quantum superpositions. One of my goals is to simplify those semantics to make them a little more intuitive/predictable, and a lot less mind-bending.

    Being able to watch your learning process in this thread has been of real value to me in doing that. Thank-you.

    And thanks to tilly for the usual masterful explanations, for the bug report, and especially for drawing my (all too thinly spread) attention to this thread.

      Just a bit more of mind-bending: is there a solution the the equation: x = all(1,4)?
        Just a bit more mind-bending: is there a solution the the equation: x = all(1,4)?

        That isn't all that mind-bending actually:

        use Quantum::Superpositions; my $x = all(any(1,4),any(1,4)); #also: all(any(1,4),any(1,4)) if($x == all(1,4)){ print "Solved\n"; }
Re: Re: Re: Nested Quantum::Superpositions
by tilly (Archbishop) on Nov 07, 2003 at 15:19 UTC
    Let's try it.
    use Quantum::Superpositions; my $all = all("smart","Australian","rich"); my $any = any("smart","Australian","rich"); print "Yes 1\n" if $all eq $any; print "Yes 2\n" if $any eq $all; __END__ Yes 1
    Reading this as I suggested above explains the result. Unfortunately the documentation doesn't clarify this important point, and worse yet, gets it backwards in its example. I'll send a bug report to the current maintainer (Steven Lembark).

    UPDATE: Reported. (BTW I find it charming that "True love" is impossible to find...)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://305308]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2018-07-19 10:13 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (406 votes). Check out past polls.