Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defineBasis (for DynamicPolarizability) double counts extraLevels if nMin < ground state n #72

Closed
jagerber48 opened this issue Jun 15, 2021 · 2 comments
Assignees
Labels

Comments

@jagerber48
Copy link

jagerber48 commented Jun 15, 2021

The defineBasis method within DynamicPolarizability class double counts energy levels depending on nMin and nMax passed in as a result of the extraLevels check.

It appears that extraLevels for an atom finds any levels that have principle quantum number smaller than the ground state, but, which nonetheless have energy higher than the ground state and are dipole coupled to the ground state. These extraLevels are always added into the basis for DynamicPolarizability calculation. This check is useful and has helped us avoid missing coupling to some states in the past. For the case of Rubidium87 the ground state has n=5 but there are some n=4 levels included in extraLevels. If one passes in nMin=4 to defineBasis then these states are double counted. This has led to incorrect values for calculations.

from arc import Rubidium87, DynamicPolarizability
atom = Rubidium87()
n = 5
l = 1
j = 3/2
calc = DynamicPolarizability(atom, 5, 1, 3/2)
print('with nMin = 5:')
calc.defineBasis(5, 6)
print(calc.basis)

print('with nMin = 4:')
calc.defineBasis(4, 6)
print(calc.basis)

gives

with nMin = 5:
[[5, 0, 0.5, 0.5], [5, 2, 1.5, 0.5], [5, 2, 2.5, 0.5], [6, 0, 0.5, 0.5], [6, 2, 1.5, 0.5], [6, 2, 2.5, 0.5], [4, 2, 2.5], [4, 2, 1.5]]
with nMin = 4:
[[4, 0, 0.5, 0.5], [4, 2, 1.5, 0.5], [4, 2, 2.5, 0.5], [5, 0, 0.5, 0.5], [5, 2, 1.5, 0.5], [5, 2, 2.5, 0.5], [6, 0, 0.5, 0.5], [6, 2, 1.5, 0.5], [6, 2, 2.5, 0.5], [4, 2, 2.5], [4, 2, 1.5]]

This issue could be resolved by checking if the existing state is already included in the basis whenever adding new states to the basis.

I have not checked if this issue occurs anywhere else in the code but it may be likely.

@jagerber48 jagerber48 changed the title defineBasis (for DynamicPolarizability) double counts extraLevels if nMin < ground state defineBasis (for DynamicPolarizability) double counts extraLevels if nMin < ground state n Jun 15, 2021
nikolasibalic added a commit that referenced this issue Jun 15, 2021
@nikolasibalic nikolasibalic self-assigned this Jun 15, 2021
@nikolasibalic
Copy link
Owner

Hi @jagerber48 ,

Many thanks for reporting this! It should be fixed now (202447b) in version 3.0.19 available on PyPI.

I had to switch to new CI pipeline also, so if you have any problems with new installation, let me know. What I tested locally worked fine.

@jagerber48
Copy link
Author

Hello @nikolasibalic, thank you for working on and maintaining this great package!

Your fix looks good. I'll let you know if I have issues with the new install, though not sure when I'll try it.

This fix solves the issues in my eyes. Am I the one who closes the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants