# MPL – A message passing library

The Message Passing Interface (MPI) Standard defines a message passing library, which serves as the basis for many high-performance computing applications today. It provides portable scalable functions for data exchange in parallel computations for various parallel computing architectures. Originally application programing interfaces had been defined for C and Fortran as well as for C++. In… Continue reading MPL – A message passing library

Uncategorized

# Cell phone supercomputers

In “Physics of the Future” Michio Kaku states “Today your cell phone has more computer power than all of the NASA back in 1969, when it placed two astronauts on the moon.” and in the fictional movie “Iron Sky” the space ship “Götterdämmerung” is operated by a smart phone. So what is actually the computational… Continue reading Cell phone supercomputers

C++

# C++11/14 for scientific computing V

$\boldsymbol{\lambda}$ functions Anonymous functions, often called $\lambda$ functions, are a common feature of scientific programming languages, e.g., Male and Matlab. They are particularly usefull when functions are employed, which take other functions as arguments.  For example, a numerical root finding algorithm requires to specify a function as an input parameter. C++11 introduces $\lambda$ functions to… Continue reading C++11/14 for scientific computing V

C++

# C++11/14 for scientific computing IV

Random numbers C++98 inherited from C the standard functions rand and srand and the macro RAND_MAX for generating pseudo-random numbers. These functions suffer several problems. For example, it has been never specified which algorithm is used in rand to produce pseudo-random numbers. Thus, in C and in C++98 the outcome of a Monte Carlo simulation… Continue reading C++11/14 for scientific computing IV

C++

# C++11/14 for scientific computing III

Mathematical functions C++11/14 introduces several new mathematical functions, which are all overloaded for the types float, double and long double and that are defined in the header file cmath. The following table summerizes the new functions. Basic operations remainder signed remainder of the division operation remquo signed remainder as well as the three last bits… Continue reading C++11/14 for scientific computing III

C++

# C++11/14 for scientific computing II

Complex numbers The template class std::complex and functions for complex numbers (defined in the header file complex) have been extended in C++11/14. The new function std::proj returns the projection of the complex number $z$ onto the Riemann sphere. The functions std::asin, std::acos and std::atan calculate the inverse of the sine, cosine and tangent for complex… Continue reading C++11/14 for scientific computing II

C++

# C++11/14 for scientific computing I

In 2011 a new standard for the C++ programming language has been published, which is commonly referred to as C++11. This new standard introduces many new language features and standard library functions. Many of these new features have been introduced to make C++ more flexible and to make C++ more easy to use.  Bjarne Stroustrup… Continue reading C++11/14 for scientific computing I

Uncategorized

# Integer overflow

YouTube Error: An integer overflow occurred. On YouTube a video has been watched more than 2,147,483,647 times, a number that can not been represented by a (signed) 32-bit integer.

numerical methods

# Calculating the Hermite functions

The Hermite functions appear as the solutions of the quantum mechanical harmonic oscillator. But they have applications in many other fields and applications, e.g., pseudospectral methods. The Hermite functions $h_n(x)$ are defined as$$\label{eq:h}h_n(x) = \frac{1}{\sqrt{\sqrt{\pi} 2^n n!}} \mathrm{e}^{-x^2/2} H_n(x) \,,$$ where $H_n(x)$ denotes the $n$th Hermite polynomial defined via the recurrence relation$$H_{n}(x) = 2xH_{n-1}(x)-2(n-1)H_{n-2}(x)$$ with… Continue reading Calculating the Hermite functions

numerical methods

# The Lanczos algorithm

Finding the eigenvalues and eigenvectors of large hermitian matrices is a key problem of (numerical) quantum mechanics. Often, however, the matrices of interest are much too large to employ exact methods. A popular and powerful approximation method is based on the Lanczos algorithm. The Lanczos algorithm determines an orthonormal basis of the Kyrlov sub-space \$\mathcal{K}_k(\Psi,… Continue reading The Lanczos algorithm