Skip to content

Fix bug in allowing arrays of density into two-photon continuum calculation - #480

Merged
wtbarnes merged 1 commit into
mainfrom
fix-2p-density-shape
Oct 23, 2026
Merged

wtbarnes merged 1 commit into
mainfrom
fix-2p-density-shape

Conversation

@wtbarnes

Copy link
Copy Markdown
Owner

Fixes #475

This fixes a bug in how the density is broadcasted with the level populations array in Ion.two_photon. This resulted in a problem both for arrays of density greater than 1 and when the couple-density-to-temperature option was used. Both should now work.

This PR also does a more careful job of indexing the level populations and the selected energy levels, similar to what is done in the contribution function.

@wtbarnes wtbarnes added continuum Ion Anything related to the Ion object bugfix Fixes a bug. PRs with this label may be backported. backport 0.8 on-merge: backport to 0.8 labels Oct 23, 2026
@wtbarnes
wtbarnes merged commit 185e87c into main Oct 23, 2026
18 of 19 checks passed
@wtbarnes
wtbarnes deleted the fix-2p-density-shape branch October 23, 2026 20:00
wtbarnes added a commit that referenced this pull request Oct 23, 2026
…on continuum calculation (#481)

Co-authored-by: Will Barnes <will.t.barnes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 0.8 on-merge: backport to 0.8 bugfix Fixes a bug. PRs with this label may be backported. continuum Ion Anything related to the Ion object

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ion.two_photon fails for more than one density, including with couple_density_to_temperature=True

1 participant