Anda di halaman 1dari 3

Matlab Code Needed Overall Specification

We need 4 procedures to be programmed. Each procedure makes changes to an array of 16 numbers, psi(i,j,k,m) where i, j,k and m can each take on two possible values,1 or 2. The four procedures are: (1) A procedure called BELL. It has one argument, an integer from one to 4, called STATE (2) A procedure called PROJECT. It has two arguments: (a) an integer SUB between 1 and 4; (b) a real number theta, usually between zero and pi. (3) A procedure called ROTATE, has the same two arguments. (4) A procedure called START which has no arguments. Once these are available, we need to be able to try little experiments. For example, we could run a MatLab program: START BELL 1 PROJECT 1 .2 PROJECT 3 .9 Or START PROJECT 1 .2 BELL 1 PROJECT 3 2 We can compare what psi looks like at the end of these two experiments. If they are different, it would have huge implications. It could mean faster than light communication. These really are computer simulations of experiments we could do with light. If the procedures are coded correctly, the sum of the squares of all the elements of psi will always equal one. However, BELL, PROJECT and START have two steps:(a) generate an intermediate value of the array psi; (b) divide by the sum of the squares of all the values in psi. If that sum of squares is less than .0001, the procedure should stop and return an error message to the user.

Specification of BELL
The procedure BELL performs a task which physicists would call Bell State Projection. In words the array psi is projected to one of the four classic Bell States, for the indices j and m. The integer STATE tells you which of the four Bell states to use. This procedure uses an array it keeps around inside, called Bell_State(j,m). Bell-State is basically just a two by two matrix. If the user chooses STATE = 1, Bell_State is the matrix 1 0 0 1 If he or she chooses STATE = 2, the Bell_State is the matrix 1 0 0 -1 If he or she chooses STATE = 3, it is 0 1 1 0 If he or she chooses STATE = 4, it is 0 1 -1 0

The first step in BELL is to read in the users choice for STATE, and set the array Bell-State to match that choice. The second step, the big work, is to do projection proper. It operates by: FOR EACH CHOICE OF i AND k, from 1 to 2: 1. Calculate the real number MATCH as the sum of psi(i,j,k,m)*Bell_State(j,m), over j=1 to 2 and m=1 to 2 2. Then set psi(i,j,k,m) to MATCH*Bell_State(j,m) After this is done, for all i and j, the final step is to normalize the array psi so that the sum of squares of its elements is one. Maybe the easiest way to do this is to write and call a subordinate procedure called NORMALIZE. Normalize first calculate the square length, by adding up psi(i,j,k,m)*psi(i,j,k,m) over all combinations of i, j, k and m. But if that sum is less than .0001, it returns an error message; the whole simulation stops. If it is not less than .0001, Normalize divides every element of psi by the square root of the square length. For your entertainment this procedure describes what is done by a kind of device which physicists call aBell State Analyzer.

Specification of PROJECT
The procedure PROJECT performs what physicists would call a linear polarization projection. The user supplies two arguments : (a) SUB, which specifies which of the four indices i, j, k or m is to be projected on; and (b) theta, which describes which angle or direction the array will be projected to. If SUB is 1, the procedure should project psi to angle theta along index i. If SUB is 2, it should project psi to angle theta along index j. And so on. Here I will specify what to do if the user chooses SUB = 1, but its basically the same idea for SUB = 2, 3 and 4. If the user picks SUB=1, then projection proper is as follows: FOR each value of j, k and m from 1 to 2: 1. calculate the real number MATCH = (cosine theta)*psi(1,j,k,m)+(sine theta)*psi(2,j,k,m) 2. set psi(1,j,k,m) = (cosine theta)*MATCH 3. set psi(2,j,k,m)= (since theta)*MATCH Then after this is all done, just call NORMALIZE, the same procedure you already wrote for BELL. For your entertainment this procedure describes what is done by a simple kind of device called a polarizer or linear polarizer. The g lasses we wear when we watch a 3D IMAX movie are polarizers.

Specification of ROTATE
The procedure ROTATE performs what physicists would call a rotation of the angle of polarization. As with PROJECT, the user supplies an argument SUB, which tells you whether he wants rotation of i, j, k or m. For PROJECT, I gave you the example where the user picked SUB=1, which means to project in the index i. Here, I will consider the example of ROTATE if the user picks SUB of 2, which means to rotate in the j index. ROTATE requires storage for an intermediate vector, v(n), where n is 1 or 2. (In other words, this vector is just an array of two numbbers.) If the user picks SUB of two, the procedure is:

FOR each value of i, k and m: 1. Set v(1) = (cosine theta)*psi(i,1,k,m)+(sine theta)*psi(i,2,k,m) 2. Set v(2) = (- sine theta)*psi(i,1,k,m)+(cosine theta)*psi(i,2,k,m) 3. Set psi(i,1,k,m)=v(1) 4. Set psi(i,2,k,m)=v(2) There is no need for normalization, because trigonometry guarantees that the length of psi will not be changed by this operation.

Specification of START
Initially, set psi(i,j,k,m) to zero n all elements. Then set psi = 1 in all cells which satisfy i=j and k=m. Then normalize. For your entertainment this value of psi represents what is called a four photon wave function, as generated as the starting point for an experiment reported by the famous physicist Zielinger. This simple simulation system can tell us what quantum mechanics would predict for his experiment (assuming ideal or perfect polarizers and such), and for other experiments he COULD have performed.

Anda mungkin juga menyukai