QMsolve seeks to provide a solid and easy to use solver, capable of solving the Schrödinger equation for one and two particles, and creating descriptive and stunning visualizations of its solutions both in 1D, 2D, and 3D.
pip install qmsolve
3D plotting requires to have installed Mayavi. To install Mayavi directly along with QMsolve, you can type:
pip install qmsolve[with_mayavi]
The way this simulator works is by discretizing the Hamiltonian with an arbitrary potential,
specified as a function of the particle observables. This is achieved with the
Hamiltonian.solve method efficiently diagonalizes the Hamiltonian and outputs the energies and the eigenstates of the system.
Finally, the eigenstates can be plotted with the use of the
visualization.superpositions method features the possibility of interactively visualizing a superposition of the computed eigenstates and studying the time dependence of the resulting wavefunction.
For a quick start, take a look to the examples found in the examples subdirectory.
To perform the simulations, just run from the corresponding Python scripts on the command prompt.
In the two interactive particle examples from above you can check how in the non interactive case the energy levels are equally spaced and degenerated, however in the interactive case the degeneracy is broken. As a starting point I suggest you to modify the confinement and the interaction potential to see what happens!
To use GPU acceleration in your 3D simulations, add the argument
method ='lobpcg-cupy' in the Hamiltonian
solve method. For example:
eigenstates = H.solve( max_states = 50, method ='lobpcg-cupy')