                                                                       (cuDoubleComplex*)psi_it,
                                                                       wt,
                                                                       it_density_matrix);
+            cuda_check_last_error(__FILE__, __LINE__);
         }
         case 0:
         {

                                                                      (cuDoubleComplex*)psi_it,
                                                                      wt,
                                                                      it_density_matrix);
        }
    }
}



                                                                  map, 
                                                                  (cuDoubleComplex*)fft_buffer,
                                                                  (cuDoubleComplex*)data);
    cuda_check_last_error(__FILE__, __LINE__);
}

//== __global__ void cufft_normalize(int size, cuDoubleComplex* buffer)
//== {
//==     int i = blockIdx.y;
//==     int ir = blockDim.x * blockIdx.x + threadIdx.x;
//== 
//==     if (ir < size) 
//==     {
//==         buffer[array2D_offset(ir, i, size)] = 
//==             cuCdiv(buffer[array2D_offset(ir, i, size)], make_cuDoubleComplex(double(size), 0));
//==     }
//== }

extern "C" void cufft_forward_transform(void* fft_buffer)
{
