quantum computing, monads, and FP in general

Bill Halchin bhalchin@hotmail.com
Sat, 05 Oct 2002 02:34:51 +0000


<html><div style='background-color:'><DIV>
<P><BR><BR></P>
<DIV>
<DIV></DIV>
<P>Hello,</P></DIV>
<P>Byron wrote: "However, the </P></DIV>
<DIV></DIV>
<DIV></DIV>
<P>&gt;computational burden of doing this is massive, supposedly too </P>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<P>&gt;massive for current digital computers." </P>
<DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp; The main reason for the parallelism of QC is that we are dealing with tensor spaces. The ACM publised in Computing Surveys a very nice overview of QC:</P>
<DIV></DIV>
<P><A href="http://xxx.lanl.gov/abs/quant-ph/9809016">http://xxx.lanl.gov/abs/quant-ph/9809016</A>.</P>
<DIV></DIV>
<P>This survey explains the role of tensor spaces in the parallel speed up with QCs.</P>
<DIV></DIV>
<P>Regards, Bill Halchin</P>
<DIV></DIV>
<P><BR><BR>&nbsp;</P>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>&gt;From: Byron Hale <BYRON.HALE@EINFO.COM>
<DIV></DIV>
<DIV></DIV>&gt;To: "Bill Halchin" <BHALCHIN@HOTMAIL.COM>
<DIV></DIV>
<DIV></DIV>&gt;Subject: Re: quantum computing, monads, and FP in general 
<DIV></DIV>
<DIV></DIV>&gt;Date: Fri, 04 Oct 2002 18:44:12 -0700 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;It's my understanding that quantum theory is rather contradictory, 
<DIV></DIV>
<DIV></DIV>&gt;as it stands. It's capable of predictions, but not a very neat 
<DIV></DIV>
<DIV></DIV>&gt;package, logically. There are controversies. Quantum computing, 
<DIV></DIV>
<DIV></DIV>&gt;itself, is somewhat controversial. However, it appears to be 
<DIV></DIV>
<DIV></DIV>&gt;justified experimentally by a recent factorization of "15." 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;BIll Halchin is right that quantum computing is considered 
<DIV></DIV>
<DIV></DIV>&gt;reversible. The idea of collapse of a wave function providing 
<DIV></DIV>
<DIV></DIV>&gt;information does appear to be contradictory, although some may rush 
<DIV></DIV>
<DIV></DIV>&gt;to save any apparent contradictions. As I understand quantum logic, 
<DIV></DIV>
<DIV></DIV>&gt;it can be represented by a certain non-distributive lattice and as 
<DIV></DIV>
<DIV></DIV>&gt;Bill says, by composition of matrices, so perhaps we don't have to 
<DIV></DIV>
<DIV></DIV>&gt;worry so much about the details of quantum theory. 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;As for wave functions, they might be represented as sampled 
<DIV></DIV>
<DIV></DIV>&gt;functions, lazily, in infinite "lists." My understanding of quantum 
<DIV></DIV>
<DIV></DIV>&gt;computing is that whole distributions are computed, not just a 
<DIV></DIV>
<DIV></DIV>&gt;single possible outcome. Then one is only concerned with computing 
<DIV></DIV>
<DIV></DIV>&gt;the sampled probability distribution of the outcomes. However, the 
<DIV></DIV>
<DIV></DIV>&gt;computational burden of doing this is massive, supposedly too 
<DIV></DIV>
<DIV></DIV>&gt;massive for current digital computers. 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;Byron Hale 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;At 01:06 AM 10/5/2002 +0000, you wrote: 
<DIV></DIV>
<DIV></DIV>&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Hello, 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; One very thing to keep in mind about quantum computing is 
<DIV></DIV>
<DIV></DIV>&gt;&gt;that all computations are reversible because the evolution over 
<DIV></DIV>
<DIV></DIV>&gt;&gt;time of a quantum system is represented by unitary operators (in a 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Hilbert space) on elements in the particular HS. In QC, the spaces 
<DIV></DIV>
<DIV></DIV>&gt;&gt;are finite dimensional where elements are quibits and the operators 
<DIV></DIV>
<DIV></DIV>&gt;&gt;are represented by matrices. "classical" programming is anything 
<DIV></DIV>
<DIV></DIV>&gt;&gt;but reversible. My .02 for what it us worth. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Regards, Bill Halchin 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;From: Hal Daume III 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;To: Haskell Mailing List 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;CC: Rob Pierry ,Ryan Barrett 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Subject: quantum computing, monads, and FP in general 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Date: Fri, 4 Oct 2002 16:46:44 -0700 (PDT) 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Hi All, 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;I realize most people are currently at PLI and that this might 
<DIV></DIV>
<DIV></DIV>&gt;&gt;not be the 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;most appropriate place to bring up such questions. Nevertheless, 
<DIV></DIV>
<DIV></DIV>&gt;&gt;there 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;are smarter and more knowledgable people on this mailing list 
<DIV></DIV>
<DIV></DIV>&gt;&gt;than most 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;other places I know of, so here it goes. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Does anyone know if anyone has tried to model quantum computing 
<DIV></DIV>
<DIV></DIV>&gt;&gt;in a 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;monadic sense. What I mean is this: 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Let's say we had a quantum computer. This basically gives us a 
<DIV></DIV>
<DIV></DIV>&gt;&gt;bunch of 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;complex numbers on which we can perform calculations. Sort of an 
<DIV></DIV>
<DIV></DIV>&gt;&gt;extreme 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;SIMD situation, though the type of operations we can perform are 
<DIV></DIV>
<DIV></DIV>&gt;&gt;only 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;unitary matrix multiplications. Let's forget this for now. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;There are two primary characteristics of quantum computations: 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 1) once you observe the result, you lose everything else and 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; can't say "well, let's go back" 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 2) observing the result is probabilistic. that is, each possible 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; solution has an associated probability (it's squared amplitude) 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; and the probability of getting a solution back is equal to 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; this. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;This strikes me as a very monad-like setup. We can have a monad 
<DIV></DIV>
<DIV></DIV>&gt;&gt;P, where 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;a value of type 'P a' is a distribution over all elements of type 
<DIV></DIV>
<DIV></DIV>&gt;&gt;a with 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;associated probabilities. That is, 'P Bool' is a probability 
<DIV></DIV>
<DIV></DIV>&gt;&gt;space with 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;two elements, True and False, each with an associated 
<DIV></DIV>
<DIV></DIV>&gt;&gt;probability. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;We need a bind operation. This is essentially associated with the 
<DIV></DIV>
<DIV></DIV>&gt;&gt;sorts 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;of unitary matrix multiplications we can perform. So, we can 
<DIV></DIV>
<DIV></DIV>&gt;&gt;write 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;something like 'a `bind` f' where a is a distribution over as and 
<DIV></DIV>
<DIV></DIV>&gt;&gt;f is a 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;function which takes some a to a distribution over bs. Then, the 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;probability associated in the new distribution with a value x of 
<DIV></DIV>
<DIV></DIV>&gt;&gt;type b is 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;simply the sum over all possible way of getting to it. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;So, for instance, suppose we had a flat distribution of type P 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Bool; call 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;it 'flat'. We then had a function of type 'Bool -&gt; P Bool' which 
<DIV></DIV>
<DIV></DIV>&gt;&gt;took a 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;boolean and with 50% probability returned it as is and with 50% 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;probability flipped its value. Call this function 'maybeFlip'. 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Now, 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;'flat `bind` maybeFlip' produces a new probability distribution 
<DIV></DIV>
<DIV></DIV>&gt;&gt;equal to 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;'flat' (basically because there's a 50% probability of flat 
<DIV></DIV>
<DIV></DIV>&gt;&gt;spitting out 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;True, which gets to be True with 50% probability and False with 
<DIV></DIV>
<DIV></DIV>&gt;&gt;50% 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;probability; similar reasoning if flat spits out False gives an 
<DIV></DIV>
<DIV></DIV>&gt;&gt;overall 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;probability for True of 50% and False of 50%). 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;When we deal with actual complex numbers and can have negatives, 
<DIV></DIV>
<DIV></DIV>&gt;&gt;things 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;become more interesting, but the reasoning remains essentially 
<DIV></DIV>
<DIV></DIV>&gt;&gt;the same. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;The 'return' funciton would simply return its argument with 
<DIV></DIV>
<DIV></DIV>&gt;&gt;probability 1 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;and everything else with probability 0 (read probability = 
<DIV></DIV>
<DIV></DIV>&gt;&gt;amplitude). 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Though I haven't formally verified it, I'm almost positive this 
<DIV></DIV>
<DIV></DIV>&gt;&gt;obeys the 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;monad laws (the only non-trivial verification is on the 
<DIV></DIV>
<DIV></DIV>&gt;&gt;distributivity 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;law, but I think it will work out). 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;The only work I've seen regarding programming quantum computers 
<DIV></DIV>
<DIV></DIV>&gt;&gt;is the 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;'Quantum Programming' paper from Sanders and Zuliani at MPC (I 
<DIV></DIV>
<DIV></DIV>&gt;&gt;think) and 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;they took an imperate approach, essentially augmenting Dijkstra's 
<DIV></DIV>
<DIV></DIV>&gt;&gt;GCL 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;programming language to pGCL by giving it probabilism. Perhaps 
<DIV></DIV>
<DIV></DIV>&gt;&gt;it's just 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;my personal bias, but functional programming seems to be a more 
<DIV></DIV>
<DIV></DIV>&gt;&gt;natural 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;fit. I also like the thin connection between lazy evaluation and 
<DIV></DIV>
<DIV></DIV>&gt;&gt;the 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;important role observation has in quantum computing. 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Obviously I don't know much about monads and I know even less 
<DIV></DIV>
<DIV></DIV>&gt;&gt;about 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;quantum computing. Does anyone know if anyone has taken the 
<DIV></DIV>
<DIV></DIV>&gt;&gt;approach 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;outlined above or anything similar or can point out that I'm just 
<DIV></DIV>
<DIV></DIV>&gt;&gt;way off 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;track.... 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Thanks! 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; - Hal 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;-- 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Hal Daume III 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; "Computer science is no more about computers | hdaume@isi.edu 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; than astronomy is about telescopes." -Dijkstra | 
<DIV></DIV>
<DIV></DIV>&gt;&gt;www.isi.edu/~hdaume 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;_______________________________________________ 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Haskell mailing list 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;Haskell@haskell.org 
<DIV></DIV>
<DIV></DIV>&gt;&gt; &gt;http://www.haskell.org/mailman/listinfo/haskell 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt; 
<DIV></DIV>
<DIV></DIV>&gt;&gt;---------- 
<DIV></DIV>
<DIV></DIV>&gt;&gt;Chat with friends online, try MSN Messenger: Click Here 
<DIV></DIV>
<DIV></DIV>&gt;&gt;_______________________________________________ Haskell mailing 
<DIV></DIV>
<DIV></DIV>&gt;&gt;list Haskell@haskell.org 
<DIV></DIV>
<DIV></DIV>&gt;&gt;http://www.haskell.org/mailman/listinfo/haskell 
<DIV></DIV>
<DIV></DIV>
<DIV></DIV></div><br clear=all><hr>MSN Photos is the easiest way to share and print your photos: <a href='http://g.msn.com/1HM1ENUS/c156??PI=44364'>Click Here</a><br></html>