Sunday, July 17, 2016

Correlation between lazy evaluation in programming and quantum mechanics

Yeahhh! I understand! The essence of quantum mechanics is that the location of a particle is lazy in the sense that it's always undefined. Until we force it to change its state and become known. And action forcing it to change its state from anything to a certain one is measurement or observation.

Now, compare it to laziness in programming and in particular to lazy evaluation in Haskell: the size of a lazy array is undefined and it can be anything.  Only when a certain number of elements is requested from it, it gets evaluated and becomes certain. In other words, when we observe it, it changes its state.  Isn't it beautiful?

No comments :

Post a Comment