nikolasibalic / ARC-Alkali-Rydberg-Calculator

Object-oriented Python library for computation of properties of highly-excited Rydbeg states of alkali and divalent atoms.
https://atomcalc.org
BSD 3-Clause "New" or "Revised" License
91 stars 80 forks source link

Can not call method getDipoleMatrixElementHFStoFS #102

Closed Vanimiaou closed 2 years ago

Vanimiaou commented 2 years ago

Hello,

I have a question regarding the method 'getDipoleMatrixElementHFStoFS'. I have seen this method listed in some Alkali atoms classes such as 'Caesium()', 'Rubidium()', but when I try:

Caesium().getDipoleMatrixElementHFStoFS

I got the following error: ' 'Caesium' object has no attribute 'getDipoleMatrixElementHFStoFS' '

I get the same error with other atoms such as Rubidium. I can still call other methods in the same class such as 'getDipoleMatrixElement' or 'getTransitionFrequency'. Can you help me with it? Thank you very much in advance

nikolasibalic commented 2 years ago

Hi @Vanimiaou ,

Have you tried running examples given the example IPython notebook that details these functions? There are few examples with getDipoleMatrixElementHFStoFS there.

Vanimiaou commented 2 years ago

Hello,

I run with the Cesium() class as shown in the IPython notebook:

from arc import *

cs = Cesium()
rme = cs.getDipoleMatrixElementHFStoFS(6, 1, 1.5, 5, 5, 80, 0, 0.5, 0.5, -1)
print("Cs 6P3/2 |5,5> to 80S1/2 |1/2,1/2> for q=-1 (sigma-) : 0.0043 ea0, rme = %f ea0"
      % (rme))

and still have the same error 'Cesium' object has no attribute 'getDipoleMatrixElementHFStoFS' similarly to earlier when I tried the Caesium() class

Same with Rubidium87() instead of Rubidium(). I am also still able to run getDipoleMatrixElement or getTransitionFrequency methods.

I checked on another PC that I had ARC installed recently and had the same error. I found out that I also can not run getSphericalMatrixElementHFStoFS

Thank you very much for your help!!

nikolasibalic commented 2 years ago

Hi @Vanimiaou

Are you sure you have the latest package? The support for HFS is added only recently. Try pip install --upgrade ARC-Alkali-Rydberg-Calculator - you should get latest ARC (3.1.9) that has HFS. Also, in case you have multiple Python installations, you might need to update ARC with pip for that installation (using e.g. pip3 install ...).

You can make sure that you have latest version of ARC by running in Python

from importlib.metadata import version
version('ARC-Alkali-Rydberg-Calculator`')

This should print 3.1.9 (current latest version).

Let me know if this resolves (or doesn't) the issue!

Vanimiaou commented 2 years ago

Sorry for the late reply! Thank you, upgrading solve the issue, sorry I did not notice that the methods are only available on the newest version. Thank you very much for these nice functions!