help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Complex Conjugate of a Function


From: James Sherman Jr.
Subject: Re: Complex Conjugate of a Function
Date: Thu, 9 Oct 2008 02:10:54 -0400

A few comments/questions.

On Thu, Oct 9, 2008 at 12:36 AM, Thomas Markovich <address@hidden> wrote:
Ok,

So heres what I have found that works. The complex conjugate of e^ix
is the same as taking the complex conjugate of the answer from that
function.
 
This seems to me to the very definition of what you mean by "conjugate of a function".  Formally (mathematically) speaking, conjugate is a function that maps complex numbers to another complex number, so conjugate of a function isn't valid unless you define it like you did.


and I have found that conj(some vector) ends up being defined.
This is because in octave, the conj function operates on an element by element basis, this isn't a mathematical conjugate definition.  conj(some vector) = vector of the conjugates of each term.

 
I have
also discovered that I can just do, assuming that k is my vector
generated from b(x):

 conj(k) .* diff(k) - k .* diff(conj(k))

And this should give me the probability current. Anyways, what I am
struggling with now is, how do I define b(x) with x being [-2*pi: .
01 : 2*pi] (-2*pi < x < 2*pi) to get into a vector k. What I have now
is k = [b(x)]; but have tried everything I can think of.
All the function diff is doing is taking the difference between successive elements in a vector, or in essence dy.  However, to estimate the derivative at a particular point in the function(empirically), you also need to calculate dx, so you would also want to (I assume) do something more like
conj(k).*diff(k)./diff(x) - k.*diff(conj(k))./diff(x)

This won't work either, because of how the function diff works.  If we let z = diff(w) where z and w are vectors and w is of length 3, then we get
z(1) = w(2)-w(1)
z(2) = w(3)-w(2)

But there is no way to calculate z(3) since that would require knowledge of w(4) which doesn't exist.  So, z will have length of one less than w.  So, back to your example, we have no way (unless you make some other assumptions) of how to estimate the derivative at the last point, so I think what you are aiming for is, by letting m be k without its last element:
m = k(1:end-1); 
conj(m).*diff(k)./diff(x) - m.*diff(conj(k))./diff(x)

At least this is what I think you're getting at (I don't know anything about probability current of wave functions).  If this is true, I think it would be far better to symbolically calculate the derivative function of b, so that you could directly calculate the derivative of b and not use the approximation of the derivative by way of using diff.  It is just a sum of exponentials, so the derivative should be straightforward, though maybe tedious, to calculate.

Hope this helps.

James Sherman

 



On Oct 8, 2008, at 3:24 PM, Thomas Markovich wrote:

> Hi,
>
> I am using octave and I am trying to find the probability current of
> of a set of wave functions. To do this though, I get
>
> (¥*) d/dx(¥) - ¥(d/dx(¥*))
>
> I have tried to use both functions, conj and ' to find the conjugate
> but octave gives me the following error.
>
> octave-3.0.2:59> conj(b(x))
> ans =
>
> Columns 1 through 6:
>
>   0.792789 - 0.000000i   0.521003 - 0.044985i   0.361599 -
> 0.061587i   0.263736 - 0.026430i   0.163356 + 0.047835i   0.013050 +
> 0.086010i
>
> Columns 7 through 12:
>
>  -0.173588 + 0.028121i  -0.377793 - 0.064103i  -0.673954 -
> 0.079818i  -1.212822 - 0.014479i  -2.150759 + 0.048640i  -3.688296 +
> 0.059676i
>
> Column 13:
>
>  -6.190114 + 0.027294i
>
> error: conj: argument undefined
>
> Any help would would be much appreciated.
>
> Thomas Markovich
> Undergraduate Research Assistant
> University of Houston


_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]