Hi, so I need to write a fortran code with 2, 2x2 matrices.(adsbygoogle = window.adsbygoogle || []).push({});

These matrices are in the form of B=(1 exp(i)(theta) 0 0) and D=(0 0 exp(i)(theta) 1) where i is sqrt of -1 and theta is an angle between 0 and 2pi.

I've expanded the exponential so it reads cos(theta)+isin(theta) and let theta=pi/2

I've delcared i as complex in the form of i=(0.0,1.0) however as the matrices are declared as real with real components in them (ie: 0.0, 1.0) an error appears stating that "You cannot mix types in an array constructor (Complex(Kind=1)) in a real(Kind=1) constructor."

Is it possible to mix types in an array constructor or can I have the whole array as complex?

Any help would be much appreciated.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Fortran Complex Exponential

**Physics Forums | Science Articles, Homework Help, Discussion**