tmancal74 / quantarhei

Open Quantum System Theory for Molecular Systems
MIT License
21 stars 16 forks source link

Core.frequency for odd numer #98

Closed gharib85 closed 5 years ago

gharib85 commented 5 years ago

if (self.length % 2) != 0: raise Exception("Cannot create upper-half TimeAxis"

https://github.com/whaley-group-berkeley/QSpectra/blob/master/qspectra/simulate/utils.py Also for symmetry FIXME: No choice of symmetry provided !!!! for k in range(0, t.length-1): yy[w.length-k-1] = numpy.conj(y[k+1]) While in Qspectra just add zeros

tmancal74 commented 5 years ago

Thanks for pointing this out. It is not a real issue, it is by design. Did you try to use the FrequencyAxis object? The thing above is a listing of its code. You should first try to find if it fails in any usage.

TimeAxis and FrequencyAxis objects in Quantarhei are closely related. In the documentation of the TimeAxis you can read that there are two types of TimeAxis objects. By default, TimeAxis (of type upper-half) is used to represent time dependent functions with certain symmetry. This symmetry is used in Fourier transform of that function. FrequencyAxis also comes in these two flavors, but by default it is of the type complete. It behaves exactly like you would expect, and it does not complain about odd number of points. So the issue you submitted is non-existent, because

FrequencyAxis(0.0, 101, 1.0)

passes happily, actually without zero-padding anything. Objects in Quantarhei stay the way user defines them, if possible.

Only when it is insisted on the type upper-half for the FrequencyAxis, Quantarhei does not allow you to specify odd number of points, because the the FrequencyAxis should by definition have 2*N points, where N is the number of points for the corresponding upper-half of the TimeAxis. Zero-padding does not help here, it would only create umbiguity.

The documentation can be found here: https://quantarhei.readthedocs.io/en/latest/classes/time.html https://quantarhei.readthedocs.io/en/latest/classes/frequency.html

I consider this issue solved, and I would like to close it. Please, submit comments if you want, I will close the issue in 48 hours.

tmancal74 commented 5 years ago

No more comments appeared, so I am closing the issue and consider it solved.