{'fraction_non_alphanumeric': 0.024597014925373133, 'fraction_numerical': 0.007402985074626865, 'mean_word_length': 4.768595041322314, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Perfectly Matched Layer for nonlinear and matter waves

We discuss how the Perfectly Matched Layer (PML) can be adapted to numerical simulations of nonlinear and matter wave systems, such as Bose-Einstein condensates. We also present some examples which illustrate the benefits of using the PML in the simulation of nonlinear and matter waves.


Introduction
The Perfectly Matched Layer, or PML, is an absorbing boundary condition (ABC) which was introduced in a paper by Berenger [1]. ABCs are necessary when solving partial differential equations (PDEs) using finite-difference time-domain (FDTD) methods or finite element methods (FEM) over an open region. An efficient ABC will save computer memory and processing time by truncating the domain and will minimize numerical reflections from the domain truncation. The PML is reflectionless in theory, though some small reflection does occur in practice due to discretization. The magnitude of this reflection is considerably smaller than that of other ABCs, however (for one comparison, see Ref. [2]). It has been extensively used in the field of electromagnetics (see Refs. [3,4,5,6,7] for example) and has also found application in acoustical and geophysical work [8,9,10,11,12]. To our knowledge, a PML has never been applied in numerical simulations of matter waves, such as Bose-Einstein condensates.
Imagine that we wish to simulate fluid flowing through a tube with a constriction and becoming supersonic, such as happens in a rocket engine or a Laval nozzle, see Fig. 1. Such a system could be used as a laboratory Ù Figure 1: Schematic illustration of a supersonic nozzle. The flow velocity u exceeds the speed of sound at the throat of the nozzle analogue of a black hole [13,14], using a Bose-Einstein condensate for the fluid and laser light to provide the constriction. Acoustic waves which have passed the constriction cannot propagate back fast enough to return through it because of the fluid's supersonic flow. We can say that a sonic horizon, which is analogous to the event horizon of a black hole and should share many of its properties, such as the production of Hawking-like radiation, is formed at the narrowest point in the tube. A supersonic nozzle is difficult to model computationally, because if we would impose the usual periodic boundary conditions we would need to slow down the flow to subsonic speed. The process of turning a supersonic flow to a subsonic one is even more unstable than the converse [15] and so periodic boundary conditions are unsuitable. This is where the PML technique becomes useful. Placing a perfectly 'black' layer at the supersonic end of the system allows us to model the condensate flow with much greater physical accuracy, by absorbing the supersonic matter waves and so simulating their propagation into free space.
Another situation where the PML proves useful is in the simulation of the generation and propagation of waves with attractive nonlinear interaction, such as solitons. The use of a PML layer at the edge of the computational domain can absorb the solitons, allowing us to ignore their fate and to focus on the area of interest. The PML technique could be applied to the modelling of soliton propagation in a BEC [16] or in glass fibres [17], for example.

Theory and implementation 2.1 Theory
The concept of the PML for nonlinear and matter waves is similar to that for electromagnetic waves. The essential idea is the use of transformations which map propagating solutions onto exponentially decaying evanescent waves in complex space. Thus, waves travelling in the PML change from propagation in real space to propagation in imaginary space. The idea of using complex space for waves originated with Deschamps [18] and the PML was first interpreted as a complex coordinate stretching by Chew and Weedon [19]. Here we show how these ideas can be applied to nonlinear and matter waves. Consider first the standard linear Schrödinger equation in one dimension, which can be written as where m, the mass, has been split into two spatially dependent functions n. Suppose that n changes value from 1 at where the term inside the exponential is positive for waves moving to the left and negative for waves moving to the right. We can choose n to be, for example, where the exponential is positive or negative depending on the direction of propagation of the waves in question. x 0 is the position where the PML starts and a is a parameter which determines the sharpness of the transition between 1 and i, which should be reasonably gradual, though our simulations indicate that the transition may be quite steep without any serious effects. This implies that a matter wave may be stopped relatively rapidly. Our introduction of n is equivalent to making the transformation and writing Essentially, we have transformed to a coordinate system that causes waves to exponentially decay as they approach −∞. The nonlinear Schrödinger equation, also known as the Gross-Pitaevskii equation when used for matter waves, is written, after scaling through proper coefficient choices, If ǫ is positive, the equation represents repulsive interactions, such as in a dark soliton or BEC; if negative, the equation represents attractive interactions, as in a bright soliton. The PML can be extended to deal with both these cases and also with matter waves provided the incoming wavefront is close to zero. If this condition is met, the PML acts to keep the incoming wave small and so the system is approximately in the linear regime. We perform a coordinate transformation in the same fashion as Eq. (5) and so we can write

Implementation
We used a FDTD approach, discretizing via the Crank-Nicolson method [20]. This method has the advantage of being unconditionally stable due to its implicit nature and is second-order. The system to be solved becomes where ν(x) = 1/n(x). The tridiagonal system so produced is solved using the tridiagonal matrix algorithm or Thomas algorithm [21]. The drawback to this discretization scheme is that it requires an additional level of detail, at half-steps in space. This implies the need for a greater number of array elements and hence more computer operations and memory storage. More complicated simulations, such as a condensate being forced through a nozzle by a piston, can take over 12 hours to complete on a Pentium 4 3Ghz PC.

Attractive interaction: Travelling soliton
In a 1D computational domain 100 space units wide, travelling solitons are generated by a boundary condition on the right-hand side. The virtual start point and velocity of the soliton can be specified by the user. As can be seen from the simulation data, the soliton travels until it reaches the PML boundary at x = 10 where it gets 'stuck', begins to be absorbed and starts to spread out. The peak value of ρ = |ψ| 2 quickly falls to less than 0.03% of the initial value.

Repulsive interaction: Free expansion of a BEC
The simulation results show a condensate expanding without instabilities in a domain 100 space units in size, even with a relatively small PML (5 space units on the left-and right-hand sides). Without the PML, monotonically growing instabilities occur in the expanding condensate and threaten the stability of the program. When we compared the expansion with the PML in place to expansion in a computational domain large enough that the expanding condensate does not touch its sides, no appreciable difference was evident, which indicates that the PML is functioning correctly.

Conclusion
As our numerical simulations have shown, the Perfectly Matched Layer can be used to good effect in nonlinear and matter wave simulations by truncating the domain, both for repulsive and attractive interactions. The PML can be put to a wide variety of uses, for example in the modelling of sonic analogues of a black hole, expanding BECs or soliton pulses propagating in free space and fibres. One interesting feature is that the transition between real n and imaginary n may be relatively sharp in practice, which indicates that even supersonic condensates may be stopped quite abruptly. Finally, the PML is of course capable of being extended to problems in more than one dimension.
Here the variable x in Eqs. (1) and (2) should be changed to refer to the normal direction of the boundary, while all other coordinates are unchanged.