If you read it as do any of 1,2,3,4 match any of 1,2; then the answer is Yes 1 matches 1 and 2 matches 2, so the result is (1,2):

print eigenstates( any(1,2,3,4) == any(1,2) );; 1 2

The confusing one is eigenstates( any(1,2,3,4) != any(1,2) )

To me that reads as do any of these not match any of those. Stepping through you get

  1. 1 does not match 2, so add 1 to the result.
  2. 2 does not match 1, so add 2 to the result.
  3. 3 does not match 1 so add 3 to the result.
  4. 3 does not match 2 so add 3 to the result.
  5. 4 does not match 1 so add 4 to the result.
  6. 4 does not match 2 so add 4 to the result.

So the result is (1, 2, 3, 3, 4, 4), but similar states collapse, so (1, 2, 3, 4).

So all of the first 'set' do not match at least one of the second set. But that's not what you get:

print eigenstates( any(1,2,3,4) != any(1,2) );; 1 2

Doing it the other way around, you get:

print eigenstates( any(1,2) != any(1,2,3,4) );; 4 1 3 2

Which also doesn't make sense because 3 & 4 are not even a part of the first set. (And I don't think the order is defined, so that's not a clue.)

Which tends to imply that the result of any(set1) != any(set2) means anything from set 2 that can not match something in set one, which is all of set2. And that just seems wrong to me.

There's probably some deeply meaningful reason for that, but it is certainly unintuative. At which point I gave up trying to understand.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^3: sudoku via superpositions by BrowserUk
in thread sudoku via superpositions by jettero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.