@@ -97,13 +97,14 @@ def __init__(
9797 _s_r = 0.5
9898 for _n in range (n [0 ], n [1 ] + 1 ):
9999 for _l_r in range (_n ):
100- if self .species .is_allowed_shell (_n , _l_r , 0 ) != self .species .is_allowed_shell (_n , _l_r , 1 ):
101- logger .warning (
102- "For l=%d, n=%d one of the singlet/triplet states is not allowed. "
103- "In JJ coupling the state does not exist, thus skipping this shell" ,
104- * (_l_r , _n ),
105- )
106- if not all (self .species .is_allowed_shell (_n , _l_r , s_tot ) for s_tot in [0 , 1 ]):
100+ allowed = [self .species .is_allowed_shell (_n , _l_r , s ) for s in [0 , 1 ]]
101+ if not all (allowed ):
102+ if any (allowed ):
103+ logger .warning (
104+ "For l=%d, n=%d one of the singlet/triplet states is not allowed. "
105+ "In JJ coupling the state does not exist, thus skipping this shell" ,
106+ * (_l_r , _n ),
107+ )
107108 continue
108109 for _j_r in np .arange (abs (_l_r - _s_r ), _l_r + _s_r + 1 ):
109110 for _j_tot in range (int (abs (_j_r - _j_c )), int (_j_r + _j_c + 1 )):
@@ -130,13 +131,14 @@ def __init__(
130131 _s_r = 0.5
131132 for _n in range (n [0 ], n [1 ] + 1 ):
132133 for _l_r in range (_n ):
133- if self .species .is_allowed_shell (_n , _l_r , 0 ) != self .species .is_allowed_shell (_n , _l_r , 1 ):
134- logger .warning (
135- "For l=%d, n=%d one of the singlet/triplet states is not allowed. "
136- "In FJ coupling the state does not exist, thus skipping this shell" ,
137- * (_l_r , _n ),
138- )
139- if not all (self .species .is_allowed_shell (_n , _l_r , s_tot ) for s_tot in [0 , 1 ]):
134+ allowed = [self .species .is_allowed_shell (_n , _l_r , s ) for s in [0 , 1 ]]
135+ if not all (allowed ):
136+ if any (allowed ):
137+ logger .warning (
138+ "For l=%d, n=%d one of the singlet/triplet states is not allowed. "
139+ "In FJ coupling the state does not exist, thus skipping this shell" ,
140+ * (_l_r , _n ),
141+ )
140142 continue
141143 for _j_r in np .arange (abs (_l_r - _s_r ), _l_r + _s_r + 1 ):
142144 for _f_c in np .arange (abs (_j_c - i_c ), _j_c + i_c + 1 ):
0 commit comments