Hey everyone,
I'm a bit newer to Mathematica, and am running across an issue. I am trying to calculate the determinant of matrices of the form
mat = Table[(e^(2 *I* Pi/n))^(i*j), {i, 0, n-1}, {j, 0, n-1}];
but all results are displaying in the form Re^(i \theta) rather than in a component form. This seems inefficient; for example, for n=4 the simplified determinant on Mathematica is some chain of exponentials, while if you simplify by hand and plug in components properly, you get a succinct answer of -16i. Is there anyway to specifiy that Mathematica writes complex values from a table in component form, so that calculations based on that table/matrix like determinants look more presentable?
Thanks so much everyone!
In your Table you should use E to get the exponential function.
And you may want to have a look at this
n = 5; mat = Table[(E^(2 I Pi/n))^(i*j), {i, 0, n - 1}, {j, 0, n - 1}]; dd = Det[mat] dd1 = dd /. a_. Exp[b_ Complex[0, x_] ] -> a (Cos[x b] + Im Sin[x b]) dd1 // Expand dd // FullSimplify
Use E instead of e?
In[1]:= n=4; mat=Table[(E^(2 I Pi/n))^(i*j), {i, 0, n-1}, {j, 0, n-1}] Out[2]= {{1,1,1,1},{1,I,-1,-I},{1,-1,1,-1},{1,-I,-1,I}}
Worked like a charm. Thank you!