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

Electron occupation bug #22

Open
ImJudgement7497 opened this issue Jul 2, 2024 · 1 comment
Open

Electron occupation bug #22

ImJudgement7497 opened this issue Jul 2, 2024 · 1 comment

Comments

@ImJudgement7497
Copy link

For the simple particle in a box system with no interaction, iDEA.methods.non_interacting.solve() gives a single body state with occupancy of the up and down electrons at a given k value.

However at some multiplet states of this system (for example the 6th and 7th excited state), the occupancy remains the same between states, and does not exchange spin configurations with each other (i.e. state 6 has orbital configuration for up, down respectively ([1], [2]) but state 7 has ([1], [2]) not ([2], [1]).

Running the below see_bug.py script and looking at the resulting bug_results.txt will show what states have the same occupancy, where they should be exchanged as described.

import iDEA
import numpy as np

# iDEA initalisation 
l = 5
points = 100
x = np.linspace(0, l, points)
v_ext = np.zeros(len(x))
v_int = np.zeros([len(x), len(x)])
pib_double = iDEA.system.System(x, v_ext, v_int, electrons = "ud")
occupied_info = []
string_lines = []

for i in range(30):
    t = iDEA.methods.non_interacting.solve(pib_double, k=i)
    up_occ_index = t.up.occupied # index of occupied orbitals
    down_occ_index = t.down.occupied
    occupied_info.append([up_occ_index, down_occ_index])

for i in range(len(occupied_info)):

    if occupied_info[i] == occupied_info[i-1]:
        string_lines.append(f"State {i-1} and {i} have the same occupancy")

with open("bug_results.txt", 'w') as file:
    for line in string_lines:
        file.write(line + '\n')

Thank you!

@ImJudgement7497
Copy link
Author

checking this request: https://github.com/iDEA-org/iDEA/pull/16/files

it seems like when doing a local install from a cloned repository, the changes in the pull request went through fine.
However when doing an install from pip, the changes do not go through, and this is why the bug happens.

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

No branches or pull requests

1 participant