Message Boards Message Boards

0
|
2415 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I display complex numbers as x+iy rather than Re^(i \theta)?

Posted 3 years ago

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!

POSTED BY: Andrew Projansky
3 Replies

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
POSTED BY: Hans Dolhaine
Posted 3 years ago

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}}
POSTED BY: Bill Nelson

Worked like a charm. Thank you!

POSTED BY: Andrew Projansky
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract