lightpipes icon indicating copy to clipboard operation
lightpipes copied to clipboard

Reducing computations by considering only x-z plane

Open feature-engineer opened this issue 5 years ago • 3 comments

In most cases, it would suffice to only look at what happens in one spatial dimension (x) along the optical axis (z).

This would greatly speed up calculations and reduce the amount of memory used.

Is there a way to create such a 1d field and propagate it?

e.g.

x = np.linspace(-WORLD_SIZE/2, WORLD_SIZE/2, GRID_POINTS)
f = np.exp(-x**2)

f would be our gaussian field.. Currently we get f = np.exp(-y**2+x**2) as far as I can tell...

feature-engineer avatar Mar 26 '20 14:03 feature-engineer

I'm going to try to make a new version with different # of gridpoints in x and y. Suggestions are welcome!

Fred van Goor

FredvanGoor avatar Mar 28 '20 14:03 FredvanGoor

Hi feature-engineer, this depends on the details I guess. A 1D simulation is not the same as a 2D Nx1 simulation. In your case, do you assume infinite extent in the other dimension (simulating e.g. x-z-plane with infinite y) or radial/cylindrical symmetry (r-z-plane simulation)? For example using the Forward() function (or writing down the 2D integrals by hand) will spread the intensity in 3D space, so effectively your simulation is just a "slit" source and a "slit" observer but most light diffracts away from the observer. Maybe the shape will be the same as in the infinitely extended case, but the intensity will be wrong. For the radially symmetric case I'm not sure of the necessary corrections right now. For the Forvard(), if I am informed correctly, the Fourier method uses periodic boundary conditions, effectively generating the infinite extent in the x- and y-dimension. But you would have to double-check that in the manual.

In any case, a simulation with different X and Y dimensions can very much make sense and shouldn't be hard to implement, so maybe someone will take care of that in the (near) future.

ldoyle avatar Apr 06 '20 01:04 ldoyle

In most cases, a radial symmetry is enough. Especially with x_shift/y_shift=0 and tx/ty=0 A Hankel transform can be used to handle this case.

Otherwise, there might be a way to compute only one quarter of the grid, and apply a symmetry conditions on the border(?). as done with FEM simulations?

jmmelko avatar Feb 09 '21 14:02 jmmelko