- #1
castusalbuscor
- 16
- 0
Hi, I've been trying to write a program to solve a propagation of a wave packet using the time dependent schrodinger equation.
and I noticed I would need to use complex numbers.
I know that I need to use #include<complex>
I declare my array, and I started with a simple 1-d array.
complex<double>a[2]
When inputting data to the array I know that I would need something like this:
a[0] = (1,5);
a[1] = (2,8);
however when I output the data I only get:
a[0] = (5,0)
a[1] = (8,0)
Any idea how I can get around it?
And what about taking the complex conjugate of an array?
and I noticed I would need to use complex numbers.
I know that I need to use #include<complex>
I declare my array, and I started with a simple 1-d array.
complex<double>a[2]
When inputting data to the array I know that I would need something like this:
a[0] = (1,5);
a[1] = (2,8);
however when I output the data I only get:
a[0] = (5,0)
a[1] = (8,0)
Any idea how I can get around it?
And what about taking the complex conjugate of an array?