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

utils.ac_zeeman_shift: fix slicing #55

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions atomic_physics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ def ac_zeeman_shift(atom: ap.Atom, state: int, f_RF: float):

E = atom.E[states]
M = atom.M[states]
R = atom.M1[states]
R = atom.M1[states, states]
Copy link
Member

@pathfinder49 pathfinder49 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is right. in the following lines we do:

rabi = R / consts.hbar
w = rabi[state, _state][0]

As we set state -= states.start, shouldn't the first axis of R have the orignial dimension?

The code reads more like we'd want something like:

R = atom.M1[:, states]

Though I haven't checked the atomic physics on that.

Aside: I'm a bit confused by the minus sign in state -= states.start

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w = rabi[state, _state][0] yeah, that's not needed, not sure why it's there. Should just be w = rabi[state, _sate]

rabi = R / consts.hbar

acz = np.zeros(3)
for q in [-1, 0, +1]:
Mpr = M + q
for _state in np.argwhere(M[state] == Mpr):
freq = E[_state] - E[state]
w = rabi[state, _state][0]
w = rabi[state, _state]
acz[q + 1] += 0.5 * w ** 2 * (freq / (freq ** 2 - (f_RF) ** 2))
return acz
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "atomic_physics"
version = "1.0.1"
version = "1.0.2"
description = "Nascent toolkit for calculating state energies, transition matrix elements, rate equations, obe solver, etc"
authors = ["hartytp <[email protected]>"]

Expand Down