Skip to content

Commit

Permalink
cleanup of todos
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzifrancesco committed Jan 22, 2025
1 parent 40a157d commit 0f9db5a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pynlin/raman/pytorch/gain_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def optimize(
self.pump_wavelengths, *self.wavelength_scaling
)
signal_spectrum = dBm(self.forward( # the physics works in Watt
pump_wavelengths, watt(self.pump_powers))) # FIXME : where are the signal
pump_wavelengths, watt(self.pump_powers)))
loss = loss_function(signal_spectrum, _target_spectrum) # the loss function is in dBm
loss.backward()
torch_optimizer.step()
Expand Down
2 changes: 0 additions & 2 deletions pynlin/raman/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,6 @@ def optim_fun(x0):

# Compute the phonon occupancy factor
Hinv = np.exp(h_planck * np.abs(frequency_shifts) / (kB * temperature)) - 1
# FIXME evidentemente stiamo considerando onde che hanno la stessa frequenza. Dobbiamo
# sommare l'effetto solo sullo stesso modo, e lasciare che il coupling misceli tutto.
eta = 1 + 1 / Hinv
np.fill_diagonal(eta, 0)
# print(eta)
Expand Down
4 changes: 3 additions & 1 deletion scripts/modules/nlin_fB.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,6 @@ def antonio_rescale_min(dgd):
plt.xscale('log')
plt.ylabel(r'channel-pair NLIN [km$^2$/ps$^2$]')
plt.tight_layout()
plt.savefig(f"media/dispersion/partial_NLIN_fB.png", dpi=dpi)
plt.savefig(f"media/dispersion/partial_NLIN_fB.png", dpi=dpi)

# TODO start again from here!!
3 changes: 1 addition & 2 deletions scripts/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ def repropagate_numpy(fiber,
cf.launch_power = signal_power
cfg.save_struct_to_toml("./input/config.toml", cf)
output_file = f"results/ct_solution{signal_power}_gain_{cf.raman_gain}.npy"



signal_wavelengths = wdm.wavelength_grid()

if not os.path.exists(output_file) or recompute:
Expand Down

0 comments on commit 0f9db5a

Please sign in to comment.