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 - The Fusion of Science and Community**

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 Complex Exponential

Loading...

Similar Threads - Fortran Complex Exponential | Date |
---|---|

Runtime error 112 | Oct 17, 2015 |

[Fortran] Help Reading Complex 2D data | Jul 14, 2015 |

Mesh 2d of a complex geometry with FORTRAN | Jun 29, 2015 |

[Fortran] Quick question about complex exponentials | Jun 11, 2015 |

Complex number in fortran 90 | May 17, 2015 |

**Physics Forums - The Fusion of Science and Community**