Skip to content

Commit

Permalink
returning previous form of 1b exporting of matrix elements(no permuta…
Browse files Browse the repository at this point in the history
…tions)
  • Loading branch information
migueldelafuente1 committed Nov 7, 2023
1 parent e3b7d2d commit a287718
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
13 changes: 11 additions & 2 deletions helpers/TBME_Runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ def _sortQQNNFromTheValenceSpace(self):
q_numbs = list(combinations_with_replacement(q_numbs, 2))

self._twoBodyQuantumNumbersSorted = q_numbs

all_permut_ = []
for a,b in self._twoBodyQuantumNumbersSorted:
all_permut_.append((a,b))
if a != b:
all_permut_.append((b,a))
all_permut_.sort()
self._allPermutations_twoBodyQuantumNumbers = all_permut_
self._allPermutations_twoBodyQuantumNumbers = self._twoBodyQuantumNumbersSorted

def _compute1BodyMatrixElements(self, kin=False, force=None):
"""
Expand Down Expand Up @@ -415,7 +424,7 @@ def _compute1BodyMatrixElements(self, kin=False, force=None):
else:
return

for q_numb in self._twoBodyQuantumNumbersSorted:
for q_numb in self._allPermutations_twoBodyQuantumNumbers:
bra = QN_1body_jj(*readAntoine(q_numb[0], l_ge_10=True))
ket = QN_1body_jj(*readAntoine(q_numb[1], l_ge_10=True))

Expand Down Expand Up @@ -1009,7 +1018,7 @@ def _print_10b_file(self, title=''):
core_energy = getattr(core, CoreParameters.energy, '0.0')

strings_ = [title, core_energy,] # title
for a, b in self._twoBodyQuantumNumbersSorted:
for a, b in self._allPermutations_twoBodyQuantumNumbers:
a = castAntoineFormat2Str(a, l_ge_10=True)
b = castAntoineFormat2Str(b, l_ge_10=True)
val_ab_p, val_ab_n = 0.0, 0.0
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
pass
# TODO: Run the program from a file 'input.xml' next to the main

#_runner = TBME_SpeedRunner(filename='input_B1.xml')
# _runner = TBME_SpeedRunner(filename='input_B1.xml')
# _runner = TBME_Runner(filename='input.xml')
# _runner = TBME_SpeedRunner(filename='input.xml')
# _ = 0
# _runner = TBME_Runner(filename='input_D1S.xml')
# _runner.run()

_runner = TBME_SpeedRunner(filename='input.xml', verbose=True)
_runner = TBME_SpeedRunner(filename='input.xml', verbose=False)
# _runner = TBME_SpeedRunner(filename='input_D1S.xml', verbose=False)
_runner.run()

Expand Down Expand Up @@ -238,4 +238,4 @@
# BrinkBoeker.turnDebugMode(False)
# _runner = TBME_Runner(filename='input.xml')
# _runner.run()


4 changes: 2 additions & 2 deletions matrix_elements/CentralForces.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def setInteractionParameters(cls, *args, **kwargs):
b_len = float(kwargs.get(_b))
cls.PARAMS_SHO[_b] = b_len
cls.PARAMS_SHO[_A] = int(kwargs.get(_A))
hbaromega = (Constants.HBAR_C**2) / (Constants.M_NUCLEON * (b_len**2))
hbaromega = (Constants.HBAR_C**2) / (Constants.M_MEAN * (b_len**2))
cls.PARAMS_SHO[_ho] = hbaromega

def _run(self):
Expand All @@ -1061,7 +1061,7 @@ def _run(self):
elif (n_a == n_b - 1):
val = (n_b * (2*n_b + l_b + 0.5))**.5
elif (n_a == n_b + 1):
val = ((n_b + 1) * (2*n_b + l_b + 1.5))**.5
val = (n_a * (2*n_a + l_a + 0.5))**.5

self._value = 0.5 * val * self.PARAMS_SHO[SHO_Parameters.hbar_omega]

Expand Down
1 change: 1 addition & 0 deletions matrix_elements/MultipoleForces.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def _run(self):
XLog.write('nas_me', ket=self.ket.shellStatesNotation)

self._value = 0.0
if ((self.bra.j + self.ket.j) // 2) % 2 == 1: return

L = self.PARAMS_FORCE[CentralMEParameters.n_power]
C = self.PARAMS_FORCE[CentralMEParameters.constant]
Expand Down

0 comments on commit a287718

Please sign in to comment.