11.07.2015 Views

A Quantum Optics Toolbox for Matlab 5

A Quantum Optics Toolbox for Matlab 5

A Quantum Optics Toolbox for Matlab 5

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A <strong>Quantum</strong> <strong>Optics</strong> <strong>Toolbox</strong> <strong>for</strong> <strong>Matlab</strong> 5 5dims Hilbert space dimensions of each object in the arraysize Size of the array, specifying the number of membersshape Shape of each object in the array as a two-dimensional matrixdata Data <strong>for</strong> the quantum object stored as a “‡attened” two-dimensional matrixFor the most part, the user need not be too concerned about manipulating these …elds, as they arehandled by the toolbox routines. In order to examine these …elds, one may enter>> psi.dims[4] [1]>> psi.size1 1>> psi.shape4 1>> psi.data(1,1) 0.8000(4,1) 0.6000The user can examine, but not modify the contents of these …elds. The dims …eld is the cell array{[4],[1]}, which means that the objects are matrices of size 4 £ 1; which are column vectors. The size…eld is [1,1] since there is only one object in the array. The shape …eld indicates that each object is ofsize 4£1; which at this stage may appear to duplicate the in<strong>for</strong>mation in the dims …eld, but the distinctionwill become clearer as we proceed. Finally the data themselves, i.e., the numbers 0.8, 0.0, 0.0 and 0.6,are stored as a single column in the data …eld as a sparse matrix (i.e., only the non-zero elements arestored explicitly). Note that it is also possible to use dims(psi), size(psi) and shape(psi) to accessthe above in<strong>for</strong>mation.In order to produce a unit ket in an N dimensional Hilbert space, the toolbox function basis(N,indx)creates a quantum object with a single one in the component speci…ed by indx. Thus we have, <strong>for</strong> example,>> basis(4,2)ans = <strong>Quantum</strong> objectHilbert space dimensions [ 4 ] by [ 1 ]01002. Tensor product of spacesOften, we are concerned with systems which are composed of two or more subsystems. Suppose thereare two subsystems <strong>for</strong> which the dimension of the state space <strong>for</strong> the …rst alone is m andthatofthesecond alone is n: The dimension of the Hilbert space <strong>for</strong> the composite system is mn. If the …rstsystem is prepared in state c =[c1; :::; cm] and the second system is independently prepared in the stated =[d1; :::; dn], the joint state is given by the tensor product of the states which has components[c1*d1; ... ; c1*dn; c2*d1; ... ; c2*dn; ... ; cm*d1; ... ; cm*dn]Within the toobox, the construction of the tensor product is carried out as shown in the followingexample:>> psi1 = qo([0.6; 0.8]);>> psi2 = qo([0.8; 0.4; 0.2; 0.4]);>> psi = tensor(psi1,psi2)psi = <strong>Quantum</strong> objectHilbert space dimensions [ 2 4 ] by [ 1 1 ]0.48000.24000.12000.24000.64000.32000.16000.3200

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!