# Wavefunction tutorial

## Requirements

• nanotools

• RESCU+

### Pseudopotentials

I will need the following pseudopotentials.

• C_AtomicData.mat

### Wavefunction calculation

RESCU+’s solvers are invoked calling the solve method

calc.solve()


The method writes all parameters to a JSON file, then calls the relevant (Fortran) program, then loads the data back into the calculator. The output of rescuplus goes to nano_wvf_out.h5 and nano_wvf_out.json. As other real space data, the local DOSes are stored in nano_wvf_out.h5 similarly with density, i.e. under /wavefunctions/#/field where # is an index running over all k-points. If spin is accounted for, then the paths to the spin-up and spin-down wavefunctions are /wavefunctions/spin-up/#/field and /wavefunctions/spin-down/#/field respectively. Besides, the k-point fractional coordinates and grid information are found in /wavefunctions/#/kpoint and /wavefunctions/#/cell.

### Target specific eigenstates

It is sometimes useful to target specific states in the band structure. In large scale calculations, for example, where one might be interested in a few states, it is not necessary to compute the real space representation of thousands of eigenstates. Taking the above system as example, we can compute the wavefunctions of the 4th and 5th band at k-point [.1,.2,.3] as follows

from nanotools import Wavefunction as WF
import numpy as np
calc = WF.from_totalenergy("nano_scf_out.json")
calc.system.kpoint.set_fractional_coordinates([[.1,.2,.3]])
calc.solver.eig.target_irange = [3,4]
calc.solve()


We invoke the Kpoint object’s method set_fractional_coordinates to directly set the k-points to [.1,.2,.3]. We also set the eigensolver parameter target_irange to [3,4]. Note that target_irange is an index range, and hence all states between target_irange[0] and target_irange[1] will be computed.