6. Examples

In ChASE, we provides multiple examples which will help the user to get familiar with the library. In this section, we give an introduction about these examples.

Note

  1. All the first three examples are compiled if user installs ChASE with the option -DBUILD_WITH_EXAMPLES=ON.

  2. In order to build the example 2_input_output, the module Boost should be uploaded from the software stack or installed by the user.

  3. The example 3_installation shows how to link ChASE by user’s application through CMake. This example will not build automatically together with the compilation/installation of ChASE. It has to be compiled independently by the user.

6.1. 0. Hello World

The first example in this section is 0_hello_world. This example constructs a simple Clement matrix and find a given number of its eigenpairs.

6.2. 1. Sequence of Eigenproblems

The second example in this section is 1_sequence_eigenproblems. The purpose of this example is to illustrate how ChASE can be used to solve a sequence of eigenproblems. This example is quite similar to the previous one. The only difference is that after solving one problem, the elements of related Clement matrix are perturbed, and the new matrix is used to construct a new eigenproblem. This example can be used as template where the matrices in the sequences (of 2 or more eigenproblems) are read from disk instead of being generated by the code in the example.

6.3. 2. Parallel I/O and Configuration

The third example in this section 2_input_output is quite similar to two previous ones. The differences are: 1) the configuration of parameters of ChASE from command line (supported by Boost); 2) the parallel I/O which loads the local matrices into the computing nodes in parallel.

6.4. 3. Installation and Linking

The fourth example 3_installation shows the way to link ChASE to other applications, for more information, please visit Compiling with CMake.

6.5. 4. C/Fortran interface

The fourth example 4_interface shows multiple examples to use C and Fortran interface. For more information about the C/Fortran interface, please visit Interface to C/Fortran.