diff --git a/crispy/gui/quanty.py b/crispy/gui/quanty.py index e54315d7..e6cfdcb0 100644 --- a/crispy/gui/quanty.py +++ b/crispy/gui/quanty.py @@ -1334,8 +1334,6 @@ def plot(self): data = np.zeros_like(data) if 'RIXS' in self.calculation.experiment: - # Keep the aspect ratio for RIXS plots. - # self.getPlotWidget().setKeepDataAspectRatio(flag=True) self.getPlotWidget().setGraphXLabel('Incident Energy (eV)') self.getPlotWidget().setGraphYLabel('Energy Transfer (eV)') @@ -1375,7 +1373,6 @@ def plot(self): z, origin=origin, scale=scale, reset=False) else: - # self.getPlotWidget().setKeepDataAspectRatio(flag=False) self.getPlotWidget().setGraphXLabel('Absorption Energy (eV)') self.getPlotWidget().setGraphYLabel( 'Absorption Cross Section (a.u.)') diff --git a/crispy/resources/modules/quanty/templates/3d_1s2p_C3v.lua b/crispy/resources/modules/quanty/templates/3d_1s2p_C3v.lua index c7aa526a..5a0c8ed7 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s2p_C3v.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s2p_C3v.lua @@ -445,22 +445,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s2p_D4h.lua b/crispy/resources/modules/quanty/templates/3d_1s2p_D4h.lua index c920d40e..da4221cf 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s2p_D4h.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s2p_D4h.lua @@ -597,22 +597,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s2p_Oh.lua b/crispy/resources/modules/quanty/templates/3d_1s2p_Oh.lua index d131ee82..d3ff286b 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s2p_Oh.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s2p_Oh.lua @@ -551,22 +551,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s2p_Td.lua b/crispy/resources/modules/quanty/templates/3d_1s2p_Td.lua index a136c795..0a645fe2 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s2p_Td.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s2p_Td.lua @@ -432,22 +432,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_2p_1s, Ty_2p_1s, Tz_2p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s3p_C3v.lua b/crispy/resources/modules/quanty/templates/3d_1s3p_C3v.lua index 488a2ad4..dc589dfe 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s3p_C3v.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s3p_C3v.lua @@ -445,22 +445,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s3p_D4h.lua b/crispy/resources/modules/quanty/templates/3d_1s3p_D4h.lua index 79bc04dc..518b5ac2 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s3p_D4h.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s3p_D4h.lua @@ -597,22 +597,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s3p_Oh.lua b/crispy/resources/modules/quanty/templates/3d_1s3p_Oh.lua index 79eb81e8..f34ee36e 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s3p_Oh.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s3p_Oh.lua @@ -551,22 +551,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_1s3p_Td.lua b/crispy/resources/modules/quanty/templates/3d_1s3p_Td.lua index e81ba667..68de284b 100644 --- a/crispy/resources/modules/quanty/templates/3d_1s3p_Td.lua +++ b/crispy/resources/modules/quanty/templates/3d_1s3p_Td.lua @@ -432,22 +432,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 5 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}) do - for k, T_out in ipairs({Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Txy_1s_3d, Txz_1s_3d, Tyz_1s_3d, Tx2y2_1s_3d, Tz2_1s_3d}, {Tx_3p_1s, Ty_3p_1s, Tz_3p_1s}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 5 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_2p3d_C3v.lua b/crispy/resources/modules/quanty/templates/3d_2p3d_C3v.lua index 3be72a4d..4b93ca71 100644 --- a/crispy/resources/modules/quanty/templates/3d_2p3d_C3v.lua +++ b/crispy/resources/modules/quanty/templates/3d_2p3d_C3v.lua @@ -418,22 +418,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}) do - for k, T_out in ipairs({Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_2p3d_D4h.lua b/crispy/resources/modules/quanty/templates/3d_2p3d_D4h.lua index a4308061..bbb89d61 100644 --- a/crispy/resources/modules/quanty/templates/3d_2p3d_D4h.lua +++ b/crispy/resources/modules/quanty/templates/3d_2p3d_D4h.lua @@ -561,22 +561,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}) do - for k, T_out in ipairs({Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_2p3d_Oh.lua b/crispy/resources/modules/quanty/templates/3d_2p3d_Oh.lua index 237a1e24..48646022 100644 --- a/crispy/resources/modules/quanty/templates/3d_2p3d_Oh.lua +++ b/crispy/resources/modules/quanty/templates/3d_2p3d_Oh.lua @@ -515,22 +515,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}) do - for k, T_out in ipairs({Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/3d_2p3d_Td.lua b/crispy/resources/modules/quanty/templates/3d_2p3d_Td.lua index 7c40321e..f845c6da 100644 --- a/crispy/resources/modules/quanty/templates/3d_2p3d_Td.lua +++ b/crispy/resources/modules/quanty/templates/3d_2p3d_Td.lua @@ -405,22 +405,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}) do - for k, T_out in ipairs({Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_3d, Ty_2p_3d, Tz_2p_3d}, {Tx_3d_2p, Ty_3d_2p, Tz_3d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/4d_2p4d_C3v.lua b/crispy/resources/modules/quanty/templates/4d_2p4d_C3v.lua index 9566e8a7..d9d4ce02 100644 --- a/crispy/resources/modules/quanty/templates/4d_2p4d_C3v.lua +++ b/crispy/resources/modules/quanty/templates/4d_2p4d_C3v.lua @@ -418,22 +418,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}) do - for k, T_out in ipairs({Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/4d_2p4d_D4h.lua b/crispy/resources/modules/quanty/templates/4d_2p4d_D4h.lua index 43e13ceb..8f7ab263 100644 --- a/crispy/resources/modules/quanty/templates/4d_2p4d_D4h.lua +++ b/crispy/resources/modules/quanty/templates/4d_2p4d_D4h.lua @@ -561,22 +561,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}) do - for k, T_out in ipairs({Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/4d_2p4d_Oh.lua b/crispy/resources/modules/quanty/templates/4d_2p4d_Oh.lua index 051ac30b..47a060f5 100644 --- a/crispy/resources/modules/quanty/templates/4d_2p4d_Oh.lua +++ b/crispy/resources/modules/quanty/templates/4d_2p4d_Oh.lua @@ -515,22 +515,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}) do - for k, T_out in ipairs({Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/4d_2p4d_Td.lua b/crispy/resources/modules/quanty/templates/4d_2p4d_Td.lua index b87d5e6c..3c7d00e4 100644 --- a/crispy/resources/modules/quanty/templates/4d_2p4d_Td.lua +++ b/crispy/resources/modules/quanty/templates/4d_2p4d_Td.lua @@ -405,22 +405,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}) do - for k, T_out in ipairs({Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_4d, Ty_2p_4d, Tz_2p_4d}, {Tx_4d_2p, Ty_4d_2p, Tz_4d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/5d_2p5d_C3v.lua b/crispy/resources/modules/quanty/templates/5d_2p5d_C3v.lua index 6d4edc05..609d3110 100644 --- a/crispy/resources/modules/quanty/templates/5d_2p5d_C3v.lua +++ b/crispy/resources/modules/quanty/templates/5d_2p5d_C3v.lua @@ -418,22 +418,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}) do - for k, T_out in ipairs({Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/5d_2p5d_D4h.lua b/crispy/resources/modules/quanty/templates/5d_2p5d_D4h.lua index 51c322f3..7982a5fd 100644 --- a/crispy/resources/modules/quanty/templates/5d_2p5d_D4h.lua +++ b/crispy/resources/modules/quanty/templates/5d_2p5d_D4h.lua @@ -561,22 +561,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}) do - for k, T_out in ipairs({Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/5d_2p5d_Oh.lua b/crispy/resources/modules/quanty/templates/5d_2p5d_Oh.lua index d619fe08..74168849 100644 --- a/crispy/resources/modules/quanty/templates/5d_2p5d_Oh.lua +++ b/crispy/resources/modules/quanty/templates/5d_2p5d_Oh.lua @@ -515,22 +515,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}) do - for k, T_out in ipairs({Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}}) diff --git a/crispy/resources/modules/quanty/templates/5d_2p5d_Td.lua b/crispy/resources/modules/quanty/templates/5d_2p5d_Td.lua index 5b173b43..4d9f756d 100644 --- a/crispy/resources/modules/quanty/templates/5d_2p5d_Td.lua +++ b/crispy/resources/modules/quanty/templates/5d_2p5d_Td.lua @@ -405,22 +405,31 @@ NE2 = $NE2 G = 0 -totalCalculations = 3 * 3 * #Psis_i +totalCalculations = #Psis_i calculation = 1 for i, Psi in ipairs(Psis_i) do - for j, T_in in ipairs({Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}) do - for k, T_out in ipairs({Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}) do - io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) - if CalculationRestrictions == nil then - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] - else - G = G + CreateResonantSpectra(H_m, H_f, T_in, T_out, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] - end - calculation = calculation + 1 - end + io.write(string.format('Running calculation %d of %d.\n', calculation, totalCalculations)) + if CalculationRestrictions == nil then + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}}) * dZ[i] + else + G = G + CreateResonantSpectra(H_m, H_f, {Tx_2p_5d, Ty_2p_5d, Tz_2p_5d}, {Tx_5d_2p, Ty_5d_2p, Tz_5d_2p}, Psi, {{'Emin1', Emin1}, {'Emax1', Emax1}, {'NE1', NE1}, {'Gamma1', Gamma1}, {'Emin2', Emin2}, {'Emax2', Emax2}, {'NE2', NE2}, {'Gamma2', Gamma2}, {'restrictions1', CalculationRestrictions}}) * dZ[i] + end + calculation = calculation + 1 +end + +Gtot = 0 +ishift = 0 + +-- The number of operators in times the number of operators out. +for i = 1, 3 * 3 do + Indices = {} + for i = 1, NE1 + 1 do + table.insert(Indices, i + ishift) end + Gtot = Gtot + Spectra.Element(G, Indices) + ishift = ishift + NE1 + 1 end -G.Print({{'file', '$BaseName.spec'}}) +Gtot.Print({{'file', '$BaseName.spec'}})