Problems? Is your data what you think it is? PerlMonks

### Re: sudoku via superpositions

by pKai (Priest)
 on Jun 29, 2007 at 09:58 UTC ( #624070=note: print w/replies, xml ) Need Help??

in reply to sudoku via superpositions

... to give me a super postion of 1 .. 4
```D:\>perl -MQuantum::Superpositions -e "print eigenstates(any(1..4)!=an
+y(2,3))"
32
D:\>perl -MQuantum::Superpositions -e "print eigenstates(any(2,3)!=any
+(1..4))"
4132

Seems that processing any()<op>any() is not symmetric. Doing it the other way round, you'll get your desired result.

No idea though, if its of any use in solving Sudokus.

Replies are listed 'Best First'.
Re^2: sudoku via superpositions
by jettero (Monsignor) on Jun 29, 2007 at 17:48 UTC
This is really interesting stuff. I played around with they asymmetry of it, but I didn't get any closer. The any(1,2,3,4) result would (it seems to me) have to "know" that it wasn't one of the any(1,2) to be of any value...

Perhaps I'm just picturing it wrong.

-Paul

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.

Create A New User
Node Status?
node history
Node Type: note [id://624070]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2021-04-10 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?

No recent polls found

Notices?