Re: 2X2 arrays

• To: mathgroup at smc.vnet.net
• Subject: [mg74660] Re: 2X2 arrays
• From: dh <dh at metrohm.ch>
• Date: Fri, 30 Mar 2007 02:57:26 -0500 (EST)
• References: <eufpvj\$7ee\$1@smc.vnet.net>

```
Hi,

if I understand you correctly, then the 3 loops are actually an

additional Outer operation. You could write this as:

MatrixForm[Outer[Outer[Times, #1, #2, #3] & , {a1, a2, a3, a4},

{a1, a2, a3, a4}, {a1, a2, a3, a4}, 2]]

Daniel

> Hi,

>

> I am wondering how to initialize a set of 2X2 arrays in an array.

> for example:

> a1=1/Sqrt[2]{{1,1},{1,-1}}

> a2=1/Sqrt[2]{{1,0},{0,1}}

> a3=1/Sqrt[2]{{1+I,0},{0,1-I}}

> a4=1/Sqrt[2]{{1,1-I},{1,1+I}}

>

> to declare in an array so that I can compute the following.

>

> To use nested For loop to compute the tensor product.

>

> I want the equivalent of:

>

>    For[i=1,i<5,i++,

>        For[j=1,j<5,j++,

>            For[k=1,k<5,k++,

>                            Print[Outer[Times,a[i],a[j],a[k]]]]]]

>

> Thanks for your sincere help,

> Sima.

>

> ___________________________________

> IIT Kharagpur, http://www.iitkgp.ac.in

>

>

>

>

>

>

```

• Prev by Date: Re: Re: Which Mathematica product
• Next by Date: Re: Closing All Input Cells at Once
• Previous by thread: Re: 2X2 arrays
• Next by thread: Re: 2X2 arrays