CP2K – a computer program for the future

Finding and accessing alternative energy sources is the goal of many scientists worldwide. Simulations on high-performance computers such as the CSCS supercomputer “Monte Rosa” have an important role to play. One of the essential programs for this type of simulation is CP2K.

October 20, 2011 - by Simone UlmerCSCS

The growing demand for energy from the world’s population represents a continuing challenge for researchers and engineers. Following the earthquake in Japan and the ensuing nuclear catastrophe in Fukushima, Switzerland and other countries are keen to avoid nuclear power, so new, alternative energy sources are being called for more than ever. Finding them, storing their energy and using it efficiently will require technical advances and scientific breakthroughs.

Using computers to explore new energy sources

An important contribution to exploring alternative energy sources – such as innovative fuels or solar cells – can be made by supercomputers such as those made available to Swiss scientists at CSCS (Swiss National Supercomputing Centre). With the help of the “Monte Rosa” supercomputer, scientists can simulate new materials and their molecular properties. While quantum mechanics can deliver the theory about the chemical, electrical and physical properties of a material, only digital simulations can show the potential benefits of new chemical compounds. By means of these simulations, researchers can investigate how physical conditions such as temperature and pressure can break down chemical compounds or create new ones.

One of the most important codes for this type of simulation is the CP2K (Car-Parrinello 2000 project), which is developed in an international collaboration. The molecular scientist Jürg Hutter, Professor at the University of Zurich, began developing CP2K about ten years ago in collaboration with the research group led by Michele Parrinello, Professor of Computational Science at ETH Zurich and the Università della Svizzera italiana.

A: A structured two-dimensional surface. These so-called nanomeshes can be used as a type of template for developing new materials. The picture shows the structure of boron nitride on rhodium. B: Boron nitride on rhodium with intercalated hydrogen

Fifteen years previously, Michele Parrinello had developed the Car-Parrinello method with Roberto Car. At that time, the Car-Parrinello Molecular Dynamics method and its implementation in the CPMD program helped bring about a breakthrough in the digital simulation of molecular processes: thanks to the method developed by these scientists, it was possible for the first time to calculate both the dynamics of a molecule and its electron structure simultaneously and relatively quickly and easily on a computer. For each position of the nuclei, the program produces quantum mechanical comparisons, allowing their electron structure to be approximated.

However, ten years ago Hutter and Parrinello realised that new algorithms would be required in order to be able to compute even bigger systems. Thus CP2K was born.

In both programs, the distribution of electrons in a molecule is determined by what are called wave functions. In order to calculate these wave functions efficiently, they are represented using basis functions. CP2K uses different basis functions from CPMD: the ones in CP2K have been greatly improved, so that they can successfully compute large molecules. While the number of variables and computing stages to be calculated has been kept as low as possible, the individual stages are more complex than in the CPMD program.

Material transitions with a lot going for them

CP2K can be used to simulate large and complex chemical systems, such as the interfaces in material transitions from solid to liquid or from liquid to gas. “We look at what happens when different materials come together in specific conditions, how their structure changes and the dynamics of the molecules,” says Jürg Hutter. His team switched entirely from the original Car-Parrinello program to CP2K for simulating molecular changes a few years ago. CP2K is freely available for all researchers and is used in all kinds of different fields, as for example in the chemical-pharmaceutical industry.

“When you’re looking for new materials, simulations with CP2K can often support experimental work which can be very time-consuming or inconclusive,” says Hutter. As a molecular scientist, he researches interfaces such as a single layer of boron nitride on the metal rhodium. These so-called “nanomeshes” create structured two-dimensional surfaces. The idea is that a nanomesh like this can be a template which, through its chemical structure or morphology, can determine the shape of a new material that researchers want to create. Materials of this kind can be used in nanotechnology.

Hutter is currently working with scientists from the Swiss Federal Institute for Materials Testing and Research (EMPA) on the catalysis of CO2 conversion in methanol. They are investigating how CO2 reacts with nickel on cerium dioxide, one of the main catalysts in the conversion of CO2 in fuel.

An atomistic model of the active interface in a prototype Grätzel cell shows the dye, the solvent and the oxide. The grey contour plot represents the electron prior to injection into the oxide.

Using simulation to understand the Grätzel cell

Joost VandeVondele, senior research assistant in Hutter’s team, is using CP2K to study special solar cells known as Grätzel cells. Grätzel cells function on a similar principle to photosynthesis and are a typical example of an interface: a solid body on one side and a solvent on the other, with a dye in between. How this electrochemical dye-sensitised solar cell – which is currently achieving levels of efficiency of 11.2% in the laboratory – actually works is not entirely understood. However, in order to be able to build cells that are more efficient, the process of how the dyes and solvents interact with the surface and with light, and thus generate electricity, needs to be clarified.

VandeVondele is studying this using computer simulations, in which he takes account of as many parameters as possible which could affect the functioning of the Grätzel cell. This means that the models are enormously complex, and the researchers say they can only be modelled on the latest supercomputers using special programs like CP2K. “The better we can understand the cells by using these simulations, the more efficiently we can carry out and control our experiments in future,” emphasises Joost VandeVondele. This is why, in parallel to the simulations, other research groups are working hard on experiments in the laboratory to study how the cells work. They use different dyes, or change the solvents that are used, or the surface structures of the cells.

Multiple applications

As CP2K is based on innovative technology which can compute large and complex molecules more accurately and efficiently, Hutter and VandeVondele are convinced that the research will open up entirely new opportunities. The program is flexible and can be used not only in materials research but in many different fields of physics, chemistry and biology. “What we are simulating in my group is only a tiny fraction of the possible applications,” stresses Hutter.

The CP2K program now consists of nearly a million lines of code and is continuously being developed by international teams. It uses many different algorithms and complex numerical structures. It is hard to target these to current computer architectures, so in the last two years Hutter and his team have been focussing on optimising the program for use on the still new computer architectures that are based on multicore processors, where there are several processors on one chip, or graphic processors (GPUs),

When the program is fully implemented on the new architectures, it will enable more extensive simulations to be carried out than the Car-Parrinello program. It will use massive parallel computer resources more efficiently and work better on the ever-increasing number of processors. However, when it is best to use which program will ultimately depend on the particular question being investigated. That is why both are important simulation tools, which enable scientists to use the latest generation of computers at CSCS to make an important contribution to current research, and not only in the energy sector.