TRIQS / triqs

a Toolbox for Research on Interacting Quantum Systems
https://triqs.github.io
GNU General Public License v3.0
134 stars 69 forks source link

Hilbert transform and normalization #19

Open tayral opened 10 years ago

tayral commented 10 years ago

Hi, The current Hilbert transform assumes that \rho(\epsilon) is a dos object, i.e. that it is normalized. One could want, however, to perform the Hilbert transform of other objects, e.g. objects that are not normalized (for instance to find the Kramers-Kronig conjugate of Re F(\omega) where F(\omega) is analytical...). Moreover, the mathematical definition of a Hilbert transform does not require normalization. I would thus suggest switching off the __normalize() method in dos/hilbert_transform.py. I tried and it gives correct results. I also think that \Sigma should be =0 by default. Best Thomas

mferrero commented 10 years ago

OK, we could put an extra flag in the constructor: normalize_dos defaulted to True. This would keep backward compatibility.

tayral commented 10 years ago

On 09/30/2013 11:54 AM, Michel Ferrero wrote:

OK, we could put an extra flag in the constructor: normalize_dos defaulted to True. This would keep backward compatibility.

— Reply to this email directly or view it on GitHub https://github.com/TRIQS/triqs/issues/19#issuecomment-25348837.

OK. If one wants to set Sigma=None as default (which is the most natural case for using a Hilbert transform), the following problem pops up: one does not know the sizes N1 and N2 anymore (they were previously extracted from N1 and N2). When one writes

HT=HilbertTransform(dos)
g <<= HT(...)

is there a way for HT() to know about g.N1 and g.N2 ?

mferrero commented 10 years ago

One would have to change the way HilbertTransform works right now and make it a descriptor for the Green's functions. This would actually make some sense. It's easy to do but it won't be possible to do the assignment in 2 steps like above. One would have to write directly something like:

g <<= HilbertTransform(dos, ... other_options ...)

This breaks the API and older scripts won't work. We can do it when we move to TRIQS 1.1.0. @parcollet, @tayral Do we do it?

pseth commented 9 years ago

Do we want to do this for v1.2?

tayral commented 9 years ago

In principle there is an easy workaround (by normalizing the density and multiplying by the norm in the end. In any case the doc should be clear about the precondition on the density. I will take a look asap.

tayral commented 9 years ago

How about this old issue? Has the Hilbert transform been rewritten in c++ yet? I still think it would be nice to have a general Hilbert transform without a requirement on the norm of the rho(\omega).

parcollet commented 9 years ago

Not yet... To be done.