2

I have tried the wave front of a twisted light that has a helix shape, to describe the wavefront i try to the confine it to the $\cos[\ell \phi -z]==1$ case but i just fount a gray plot so I change it to $0.95<\cos[\ell \phi -z]<1.05$, and i could find the shape, but it takes so long time to plot it and of course the helixes are not flat,

 LG[r_, \[Phi]_, p_, l_, w_] := If[0.98 < Cos[l \[Phi] - z] < 1.02, 
                                   E^(-r^2/w^2)  E^(I l \[Phi]) Exp[-I z], 0]

Module[{l = 2, p = 0, xMax = 3, zMax}, zMax = Pi l; DensityPlot3D[Re[LG[Sqrt[x^2 + y^2], ArcTan[x, y], p, l, 1]], {x, -xMax,xMax}, {y, -xMax, xMax}, {z, -zMax, zMax}, PlotPoints -> 60, AxesLabel -> {"x", "y", "phase"}, PerformanceGoal -> "Quality",ColorFunction -> "AvocadoColors"]]

enter image description here

If u have any advice how to make it more efficient, I would be so thankfull

1 Answers1

3

The depth of helix could be regulated with using function Boole[1 - h <= Cos[z - l ArcTan[x, y]] <= 1 + h] as follows

LG[r_, \[Phi]_, p_, l_, w_, z_] := 
 E^(-r^2/w^2) E^(I l \[Phi]) Exp[-I z]

Module[{l = 2, p = 0, xMax = 3, h = .01, zMax}, zMax = Pi l; DensityPlot3D[ Re[LG[Sqrt[x^2 + y^2], ArcTan[x, y], p, l, 1, z]] Boole[ 1 - h <= Cos[z - l ArcTan[x, y]] <= 1 + h], {x, -xMax, xMax}, {y, -xMax, xMax}, {z, -zMax, zMax}, AxesLabel -> {"x", "y", "phase"}, PlotPoints -> 100, PlotRange -> All, Boxed -> False, OpacityFunction -> .2, ColorFunction -> "AvocadoColors", PerformanceGoal -> "Quality"]]

Figure 1

Nevertheless it is not looks fine and also the code is slow. So we can use fast code plotting helix with some ColorFunction[] dependent on LG:

Module[{l = 2, p = 0},
 ParametricPlot3D[ {Cos[u] Sin[v], Sin[u] Sin[v], l u}, {u, 0, 
   2 Pi}, {v, -Pi, Pi}, Mesh -> None, 
  ColorFunction -> 
   Function[{x, y, z}, 
    Hue[Re[LG[Sqrt[x^2 + y^2], ArcTan[x, y], p, l, 1, z]]]], 
  Boxed -> False, BoxRatios -> {1, 1, 1}, PlotPoints -> 100]]  

Figure 2

Alex Trounev
  • 44,369
  • 3
  • 48
  • 106
  • Perhaps you can also answer OP's previous question?: https://mathematica.stackexchange.com/q/202641/1871 – xzczd Jun 09 '21 at 11:48
  • @xzczd Ok! It is done. Please, see on https://mathematica.stackexchange.com/questions/202641/plot-of-laguerre-gaussian-wavefront/249405#249405 – Alex Trounev Jun 09 '21 at 15:23