Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

More state functionality#294

Merged
johannes-moegerle merged 3 commits intopairinteraction:masterpairinteraction/pairinteraction:masterfrom
johannes-moegerle:more-state-functionalityjohannes-moegerle/pairinteraction:more-state-functionalityCopy head branch name to clipboard
Aug 29, 2025
Merged

More state functionality#294
johannes-moegerle merged 3 commits intopairinteraction:masterpairinteraction/pairinteraction:masterfrom
johannes-moegerle:more-state-functionalityjohannes-moegerle/pairinteraction:more-state-functionalityCopy head branch name to clipboard

Conversation

@johannes-moegerle
Copy link
Contributor

Make it possible to create superpositions of single atom states.

This should then look something like:

state1 = pi.StateAtom(ket1, basis)
# Alternatively, you can use:
# state1 = basis.get_corresponding_state(ket) 

state2 = pi.StateAtom(ket2, basis)

state_plus = (state1 + state2).normalize()

(For pair states this is more complicated, and thus postponed to the future)

@johannes-moegerle johannes-moegerle force-pushed the more-state-functionality branch from 7fdaee8 to d5641ad Compare August 13, 2025 17:59
@hmenke
Copy link
Member

hmenke commented Aug 14, 2025

Is it possible to do something like this?

state_plus = (cos(alpha)*state1 + 1j*sin(alpha)*state2).normalize()

@johannes-moegerle
Copy link
Contributor Author

Is it possible to do something like this?

state_plus = (cos(alpha)*state1 + 1j*sin(alpha)*state2).normalize()

to have complex numbers one of course has to use import pairinteraction.complex as pi
but then this works:

alpha = np.pi / 4
print((np.cos(alpha) * state1 + 1j * np.sin(alpha) * state2).normalize())
# output: StateAtom(0.71+0.00j |Sr88_singlet:60,59_59,58⟩ + 0.00+0.71j |Sr88_singlet:60,58_58,58⟩)


@johannes-moegerle johannes-moegerle force-pushed the more-state-functionality branch 2 times, most recently from 280e81b to 0f0ca4a Compare August 27, 2025 13:55
src/pairinteraction/_wrapped/state/state_atom.py Outdated Show resolved Hide resolved
src/pairinteraction/_wrapped/state/state_atom.py Outdated Show resolved Hide resolved
src/cpp/src/basis/Basis.cpp Outdated Show resolved Hide resolved
@johannes-moegerle johannes-moegerle force-pushed the more-state-functionality branch from 0f0ca4a to 7dbdfe1 Compare August 29, 2025 07:40
@seweber seweber force-pushed the more-state-functionality branch from 7dbdfe1 to a45c058 Compare August 29, 2025 12:28
@seweber seweber self-requested a review August 29, 2025 12:29
@sonarqubecloud
Copy link

@johannes-moegerle johannes-moegerle merged commit 51dea08 into pairinteraction:master Aug 29, 2025
30 checks passed
@johannes-moegerle johannes-moegerle deleted the more-state-functionality branch August 29, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.