pairinteraction / pairinteraction

A Rydberg Interaction Calculator
https://pairinteraction.github.io/
GNU General Public License v3.0
41 stars 31 forks source link

Crash when unchecking "Plot states with same transformation behaviour ..." #113

Closed Patschke closed 4 years ago

Patschke commented 4 years ago

Short description:

The program crashes when unchecking the "Plot states with same transformation behaviour ..." checkbox in the Symmetries menu.

Long description:

Settings Complete settings are: General: * Rb 51 S 1/2 m=1/2 * Rb 51 P 1/2 m=1/2 * resolution 200 steps Fields: * all 0 * diamagnetic interaction checked Interaction: * distance 10µmto 0.2µm * angle 0° * multipole order 8 Basis (default settings): * Delta E = 40GHz, Delta n = 3, Deltal = 3, Delta j = -1, Delta m = -1 * Delta E = 10GHz * no further restrictions checked Symmetries: * automatically checked * plot states with same transformation... unchecked
Full console log ``` [patrick@PatricksDesktop ~]$ start_pairinteraction_gui Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. One-atom Hamiltonian, construct diagonal Hamiltonian One-atom Hamiltonian, basis size without restrictions: 350 One-atom Hamiltonian, basis size with restrictions: 60 One-atom Hamiltonian, save single atom basis One-atom Hamiltonian, precalculate matrix elements One-atom Hamiltonian, count number of entries within the field Hamiltonian One-atom Hamiltonian, construct field Hamiltonian One-atom Hamiltonian, compress field Hamiltonian One-atom Hamiltonian, processe Hamiltonians One-atom Hamiltonian, 1. Hamiltonian loaded One-atom Hamiltonian, all Hamiltonians processed Two-atom Hamiltonian, build pair state basis Two-atom Hamiltonian, basis size without restrictions: 3600 Two-atom Hamiltonian, determine symmetrized subspaces Two-atom Hamiltonian, build up the list of necessary pair states Two-atom Hamiltonian, basis size with restrictions: 608 Two-atom Hamiltonian, save pair state basis Two-atom Hamiltonian, initialize interaction Hamiltonians Two-atom Hamiltonian, get one-atom states needed for the pair state basis Two-atom Hamiltonian, precalculate matrix elements for kappa = 1 Two-atom Hamiltonian, precalculate matrix elements for kappa = 2 Two-atom Hamiltonian, precalculate matrix elements for kappa = 3 Two-atom Hamiltonian, precalculate matrix elements for kappa = 4 Two-atom Hamiltonian, precalculate matrix elements for kappa = 5 Two-atom Hamiltonian, precalculate matrix elements for kappa = 6 Two-atom Hamiltonian, count number of entries within the interaction Hamiltonians Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^3 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^3 Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^4 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^4 Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^5 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^5 Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^6 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^6 Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^7 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^7 Two-atom Hamiltonian, construct interaction Hamiltonian that belongs to 1/R^8 Two-atom Hamiltonian, compress interaction Hamiltonian that belongs to 1/R^8 Two-atom Hamiltonian, process Hamiltonians Two-atom Hamiltonian, construct contribution of combined one-atom Hamiltonians Two-atom Hamiltonian, construct transformed interaction matrices Two-atom Hamiltonian, 1. Hamiltonian loaded Traceback (most recent call last): File "/home/patrick/pairinteraction/build/pairinteraction_gui/pairinteraction/app.py", line 1607, in checkForData energies = eigensystem.energies File "/home/patrick/pairinteraction/build/pairinteraction_gui/pairinteraction/loader.py", line 88, in energies self._energies = np.real(self.readMatrix(f).diagonal()) File "/usr/lib/python3.8/site-packages/scipy/sparse/compressed.py", line 533, in diagonal raise ValueError("k exceeds matrix dimensions") ValueError: k exceeds matrix dimensions Abgebrochen (Speicherabzug geschrieben) ```
System setup I'm running arch linux, and build from pairinteraction from source by running: ``` git clone https://github.com/pairinteraction/pairinteraction --recursive mkdir pairinteraction/build cd pairinteraction/build cmake make python setup.py develop ``` (Written from memory, but you get the idea - I did not find any instructions on how to install it if one does not like pip, but I think this should be fine?)
Steps to reproduce crash Run `start_pairinteraction_gui`, configure settings as above and hit the "Calculate potential" button. If I uncheck the "Plot states with same transformation behaviour ..." checkbox everything runs fine.

I was just playing around with all settings a bit, this is nothing I need - but I thought I should report it nevertheless. If you need any further information (e.g. on my system, ...) to reproduce this issue, I'm happy to provide them.

hmenke commented 4 years ago

Thanks for reporting. We're going to look into it.

seweber commented 4 years ago

I figured out the problem. For the specified basis settings, there are symmetry sectors which contain no states. In these symmetry sectors, the Hamiltonians are zero dimensional. In principal, this shouldn't matter. However, the used version of scipy prohibits the calculation of the diagonal of a zero-dimensional sparse matrix, see https://github.com/scipy/scipy/issues/11949.

The issue will be fixed in the next release of pairinteraction. Thanks again for the comprehensive bug report!

Patschke commented 4 years ago

Thanks for looking into that issue and for providing this usefull tool!