Save wavefunction