A fast and precise DFT wavelet code

gauss_to_daub.f90 File Reference

Gaussian to Daubechies projection routines. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gauss_to_daub (hgrid, factor, gau_cen, gau_a, n_gau, nmax, n_left, n_right, c, err_norm, ww, nwork, periodic)
Project gaussian functions in a mesh of Daubechies scaling functions Gives the expansion coefficients of : factor*x**n_gau*exp(-(1/2)*(x/gau_a)**2) INPUT.
subroutine gauss_to_scf
Once the bounds LEFTS(0) and RIGHTS(0) of the expansion coefficient array are fixed, we get the expansion coefficients in the usual way: get them on the finest grid by quadrature then forward transform to get the coeffs on the coarser grid. All this is done assuming nonperiodic boundary conditions but will also work in the periodic case if the tails are folded.
subroutine fold_tail
One of the tails of the Gaussian is folded periodically We assume that the situation when we need to fold both tails will never arise.
subroutine gauss_to_daub_k (hgrid, kval, ncplx, factor, gau_cen, gau_a, n_gau, nmax, n_left, n_right, c, ww, nwork, periodic)
Project gaussian functions in a mesh of Daubechies scaling functions Gives the expansion coefficients of : factor*x**n_gau*exp(-(1/2)*(x/gau_a)**2) Multiply it for the k-point factor exp(Ikx) For this reason, a real (cos(kx)) and an imaginary (sin(kx)) part are provided INPUT.
subroutine apply_w (cx, c, leftx, rightx, left, right, h)
APPLYING THE MAGIC FILTER ("SHRINK").
subroutine forward_c (c, c_1, left, right, left_1, right_1)
FORWARD WAVELET TRANSFORM WITHOUT WAVELETS ("SHRINK").
subroutine forward (c, cd_1, left, right, left_1, right_1)
CONVENTIONAL FORWARD WAVELET TRANSFORM ("SHRINK").

Detailed Description

Gaussian to Daubechies projection routines.

Definition in file gauss_to_daub.f90.

Function Documentation

 subroutine apply_w ( real(wp),dimension(leftx:rightx),intent(in) cx, real(wp),dimension(left:right),intent(out) c, integer,intent(in) leftx, integer,intent(in) rightx, integer,intent(in) left, integer,intent(in) right, real(gp),intent(in) h )

APPLYING THE MAGIC FILTER ("SHRINK").

Definition at line 506 of file gauss_to_daub.f90.

References n.

Referenced by gauss_to_daub(), and gauss_to_scf().

Here is the caller graph for this function:

 subroutine fold_tail ( )

One of the tails of the Gaussian is folded periodically We assume that the situation when we need to fold both tails will never arise.

Definition at line 484 of file gauss_to_daub.f90.

Referenced by gauss_to_daub(), and gauss_to_daub_k().

Here is the caller graph for this function:

 subroutine forward ( real(wp),dimension(left:right),intent(in) c, real(wp),dimension(left_1:right_1,2),intent(out) cd_1, integer,intent(in) left, integer,intent(in) right, integer,intent(in) left_1, integer,intent(in) right_1 )

CONVENTIONAL FORWARD WAVELET TRANSFORM ("SHRINK").

Definition at line 557 of file gauss_to_daub.f90.

References m.

Referenced by gauss_to_daub(), and gauss_to_scf().

Here is the caller graph for this function:

 subroutine forward_c ( real(wp),dimension(left:right),intent(in) c, real(wp),dimension(left_1:right_1),intent(out) c_1, integer,intent(in) left, integer,intent(in) right, integer,intent(in) left_1, integer,intent(in) right_1 )

FORWARD WAVELET TRANSFORM WITHOUT WAVELETS ("SHRINK").

Definition at line 532 of file gauss_to_daub.f90.

References m.

Referenced by gauss_to_daub(), and gauss_to_scf().

Here is the caller graph for this function:

 subroutine gauss_to_daub ( real(gp),intent(in) hgrid, real(gp),intent(in) factor, real(gp),intent(in) gau_cen, real(gp),intent(in) gau_a, integer,intent(in) n_gau, integer,intent(in) nmax, integer,intent(out) n_left, integer,intent(out) n_right, real(wp),dimension(0:nmax,2),intent(out) c, real(gp),intent(out) err_norm, real(wp),dimension(0:nwork,2),intent(inout) ww, integer,intent(in) nwork, logical,intent(in) periodic )

Project gaussian functions in a mesh of Daubechies scaling functions Gives the expansion coefficients of : factor*x**n_gau*exp(-(1/2)*(x/gau_a)**2) INPUT.

Parameters:
 hgrid step size factor normalisation factor gau_cen center of gaussian function gau_a parameter of gaussian n_gau x**n_gau (polynomial degree) nmax size of the grid nwork size of the work array (ww) >= (nmax+1)*17 periodic the flag for periodic boundary conditions

OUTPUT

Parameters:
 n_left,n_right interval where the gaussian is larger than the machine precision C(,:,1) array of scaling function coefficients: C(,:,2) array of wavelet coefficients: WW(,:,1),WW(,:,2) work arrays that have to be 17 times larger than C err_norm normalisation error

Definition at line 30 of file gauss_to_daub.f90.

References apply_w(), c, fold_tail(), forward(), forward_c(), gauss_to_scf(), m, max, min, n, and periodic.

Referenced by crtonewave(), and wavetogau().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine gauss_to_daub_k ( real(gp),intent(in) hgrid, real(gp),intent(in) kval, integer,intent(in) ncplx, real(gp),intent(in) factor, real(gp),intent(in) gau_cen, real(gp),intent(in) gau_a, integer,intent(in) n_gau, integer,intent(in) nmax, integer,intent(out) n_left, integer,intent(out) n_right, real(wp),dimension(ncplx,0:nmax,2),intent(out) c, real(wp),dimension(0:nwork,2,ncplx),intent(inout) ww, integer,intent(in) nwork, logical,intent(in) periodic )

Project gaussian functions in a mesh of Daubechies scaling functions Gives the expansion coefficients of : factor*x**n_gau*exp(-(1/2)*(x/gau_a)**2) Multiply it for the k-point factor exp(Ikx) For this reason, a real (cos(kx)) and an imaginary (sin(kx)) part are provided INPUT.

Parameters:
 hgrid step size factor normalisation factor gau_cen center of gaussian function gau_a parameter of gaussian n_gau x**n_gau (polynomial degree) nmax size of the grid nwork size of the work array (ww) >= (nmax+1)*17 periodic the flag for periodic boundary conditions kval value for the k-point ncplx number of components in the complex direction (must be 2 if kval /=0)

OUTPUT

Parameters:
 n_left,n_right interval where the gaussian is larger than the machine precision C(,:,1) array of scaling function coefficients: C(,:,2) array of wavelet coefficients: WW(,:,1),WW(,:,2) work arrays that have to be 17 times larger than C err_norm normalisation error
Warning:
In this version, we dephase the projector to wrt the center of the gaussian this should not have an impact on the results since the operator is unchanged

Definition at line 272 of file gauss_to_daub.f90.

References c, fold_tail(), gauss_to_scf(), max, min, and periodic.

Referenced by crtproj(), gaussians_to_wavelets_orb(), and gaussians_to_wavelets_orb_h().

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine gauss_to_scf ( )

Once the bounds LEFTS(0) and RIGHTS(0) of the expansion coefficient array are fixed, we get the expansion coefficients in the usual way: get them on the finest grid by quadrature then forward transform to get the coeffs on the coarser grid. All this is done assuming nonperiodic boundary conditions but will also work in the periodic case if the tails are folded.

Definition at line 352 of file gauss_to_daub.f90.

References apply_w(), forward(), forward_c(), m, and n.

Referenced by gauss_to_daub(), and gauss_to_daub_k().

Here is the call graph for this function:

Here is the caller graph for this function: