Propagation in one dimension

The same physics on a line, which is where the splitting order is easiest to read.

Field at $z$ = 1.00e-03 m, $|\psi|^2$, Phase $\mathrm{arg}(\psi)$
/home/runner/work/NLSE/NLSE/NLSE/solvers/nlse.py:182: UserWarning: The CUPY backend is not installed here, so CPU will be used instead — the fastest one available. Install cupy to use CUPY, or pass backend='CPU' to silence this.
  self._backend: Backend = get_backend(backend, grid_size=(NX, NY))
/home/runner/work/NLSE/NLSE/NLSE/solvers/nlse.py:380: UserWarning: delta_z=7.78e-05 exceeds split-step accuracy limit (3.10e-05). Reducing to 2.79e-05.
  delta_z = self._capped_delta_z(delta_z, A, method)





Propagation:   0%|          | 0.00/100 [00:00<?, ?%/s]




Propagation: 100%|██████████| 100/100 [00:01<00:00, 50.7%/s]





Time spent to solve : 1.970673361000081 s (CPU)

import numpy as np
from NLSE import NLSE_1d

PRECISION_COMPLEX = np.complex64
PRECISION_REAL = np.float32
N = 2048
n2 = -1.6e-9
waist = 2.23e-3
window = 4 * waist
puiss = 1.05
Isat = 10e4  # saturation intensity in W/m^2
L = 1e-3
alpha = 20


def main() -> None:
    simu = NLSE_1d(alpha, puiss, window, n2, None, L, NX=N, Isat=Isat, backend="CUPY")
    simu.puiss2 = 10e-3
    simu.n22 = 1e-10
    simu.k2 = 2 * np.pi / 795e-9
    E_0 = np.exp(-(simu.X**2) / waist**2).astype(PRECISION_COMPLEX)
    simu.out_field(E_0, L, verbose=True, plot=True, splitting="lie")


if __name__ == "__main__":
    main()

Total running time of the script: (0 minutes 2.448 seconds)

Gallery generated by Sphinx-Gallery