# Visualizing outputs

This tutorial is based on "First runs with BigDFT" lesson. You should have done it to generate the wavefunctions of the N_{2} molecule.

## Visualise wavefunctions

The wavefunctions are output by choosing a non zero value for parameter `output_wf` in the `input.dft` file. Several formats are available, but in each, only the non-null coefficient of the Daubechies wavelet representation are saved. This represents a compressed way of storing the wavefunctions (and roughly correspond to a dump of what is stored in memory during the calculation). In case you want to visualize the wavefunctions, you should translate these data in a real space grid. To post-process the wavefunctions, one need to get their value on a real space grid.

This is done by using `bigdft-tool` with the *-a export-wf* action:

user@garulfo:~/N2/$ ./bigdft-tool --name=LDA -a export-wf data-LDA/wavefunction-k001-NR.b0001

where “LDA” is, in this case, the naming prefix. It creates four files in the current directory.

`wavefunction-[...].xxxx_avg_{x,y,z}`: which are the projections of the wavefunction value along the given axes.`wavefunction-[...].xxxx.cube`: which is the values of the wavefunction (either real or imaginary part) on a regular real space mesh.

One can then visualise the wavefunction expansions with their favorite program. Let's take V_Sim as an example. Open V_Sim with the following command line (using the cube file as a file for atomic coordinates and the same cube file for a scalar field):

user@garulfo:~/N2/$ v_sim -f wavefunction-k001-NR.b0001.cube wavefunction-k001-NR.b0001.cube

Go to the "iso-surface" tab and click on the "add" button on the right. It will create an iso-surface representing the half value position of the first orbital. One can use the "open" button on top-right of the tab to choose another cube file. Let's load all our five wavefunctions (after exporting them to cube files as for the first one). Then, select each of them and click on the add button to plot iso-surfaces.

One can remove plotted iso-surfaces by clicking on the "remove" button on the right or simply hide them by unchecking the box on the line of the iso-surface. One may use this File:N2 v sim.res to obtain the same rendering as for the screenshots. The orbitals should look like these:

As on the eigenvalues printed at the end of the calculation, one can see that the orbitals labelled 3 and 4 (the two π orbitals) are clearly degenerated:

e( 1)= -1.03032489370326E+00 2.0000 e( 2)= -4.95465225967267E-01 2.0000 e( 3)= -4.30176175111339E-01 2.0000 e( 4)= -4.30175870652628E-01 2.0000 e( 5)= -3.80429461838816E-01 2.0000

**Exercise**: Plot also the orbitals obtained in the Hartree-Fock calculation. Using the average on the z axis, compare the expansion of the σ orbitals.