Merged from WaveFunctionP