如何用MATLAB快速复现论文中的涡旋光束

论文复现

话不多说,直接上图:(有需要的小伙伴直接微信搜索公众号:“XD悟理”,后台回复“复现1”就可以得到完整的代码)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

% 绘图操作
figure(1)
subplot(2,2,1)
pcolor(x,y,normalizeI);
set(gca,'fontname','times new roman','fontsize',10);
clim([0,1]);
shading interp;
colormap hot;
colorbar;

% figure(2)
subplot(2,2,2)
pcolor(x,y,I_Er);
set(gca,'fontname','times new roman','fontsize',10);
xlabel('\itx(\rm\lambda)','fontname','times new roman','fontsize',15); %x方向标注
ylabel('\ity(\rm\lambda)','fontname','times new roman','fontsize',15); %y方向标注
axis([Xmin,Xmax,Ymin,Ymax]); %区间范围
set(gca,'YTick',Xmin:Tickx:Xmax,'XTicklabel',{-2:1:2}); 
set(gca,'XTick',Ymin:Ticky:Ymax,'YTicklabel',{-2:1:2});
clim([0,1]);
shading interp;
colormap hot;
colorbar;

subplot(2,2,3)
pcolor(x,y,I_Ep);
set(gca,'fontname','times new roman','fontsize',10);
xlabel('\itx(\rm\lambda)','fontname','times new roman','fontsize',15); %x方向标注
ylabel('\ity(\rm\lambda)','fontname','times new roman','fontsize',15); %y方向标注
axis([Xmin,Xmax,Ymin,Ymax]); %区间范围
set(gca,'YTick',Xmin:Tickx:Xmax,'XTicklabel',{-2:1:2}); 
set(gca,'XTick',Ymin:Ticky:Ymax,'YTicklabel',{-2:1:2});
clim([0,1]);
shading interp;
colormap hot;
colorbar;

% figure(3)
subplot(2,2,4)
h=plot(x(1,:),I_Ez(:,(size(I_Ez,1)+1)/2),x(1,:),I_Er(:,(size(I_Er,1)+1)/2),x(1,:),I_Ep(:,(size(I_Ep,1)+1)/2));
legend('|E_z|^{2}','|E_r|^{2}','|E_p|^{2}');
% 修改线形
h(1).Color = 'r';  %这里说明修改的颜色蓝色,可以使用RGB三原色
h(2).Color = '0 0.4470 0.7410';
h(3).Color = '0.4940 0.1840 0.5560';
h(1).LineWidth = 1.2;h(2).LineWidth = 1.2;h(3).LineWidth = 1.2;
h(1).Marker = 'hexagram';h(2).Marker = '*';h(3).Marker = 'o';
h(1).MarkerSize = 0.8;
h(2).MarkerSize = 3;
h(3).MarkerSize = 3;

ax = gca;  %获得坐标轴的属性
ax.XLim = [Xmin,Xmax];
% ax.YLim = [-3,3];
ax.XTick = Xmin:Tickx:Xmax;
% ax.YTick = -2:1:2;
ax.XTickLabel = -2:1:2;
% ax.YTickLabel = -2:1:2;
ax.FontSize = 12;
ax.LineWidth = 1.0;
ax.XColor =  '0 0 0';
ax.YColor  = '0 0 0';
ax.FontName = 'times new roman';
ax.XLabel.String = '\itx(\rm\lambda)';
ax.XLabel.FontSize = 15;
ax.YLabel.String = 'Normalized intensity component';
ax.YLabel.FontSize = 15;
ax.Legend.Box = 'off';
ax.Legend.FontName = 'times new roman';
ax.Legend.Location = 'northwest';
ax.Legend.FontSize = 15;
ax.Color = [1 1 1];
  • 4
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 19
    评论
根据提供的引用内容,可以使用相同位错的叉形光栅叠加和计算全息法来制备相反拓扑荷涡旋光束的叠加态。具体步骤如下: 1.使用相同位错的叉形光栅叠加制备双OAM涡旋光的叠加态。可以使用MATLAB的光学工具箱(Optics Toolbox)来模拟光束的传播和叠加。具体步骤如下: ```matlab % 定义参数 wavelength = 633e-9; % 波长 k = 2*pi/wavelength; % 波矢量 f = 100e-3; % 焦距 N = 512; % 采样点数 L = 10e-3; % 采样区域大小 dx = L/N; % 采样间隔 x = (-N/2:N/2-1)*dx; % 采样点坐标 [X,Y] = meshgrid(x); % 采样点网格 % 定义叉形光栅参数 p = 10e-6; % 光栅周期 d = 0.5*p; % 光栅深度 theta = pi/4; % 光栅方向 % 生成叉形光栅 grating = d*(cos(2*pi*X/p)+cos(2*pi*Y/p)).*exp(-1i*k*d*sin(theta)*(X+Y)); % 生成高斯平面波 w0 = 1e-3; % 光束半径 R = inf; % 曲率半径 z = 0; % 传播距离 G = gaussianBeam(X,Y,w0,R,z,wavelength); % 叠加光栅和高斯平面波 E1 = G.*exp(1i*k*z); E2 = grating.*G.*exp(1i*k*z); E = E1 + E2; % 显示结果 figure; subplot(1,3,1); imagesc(x*1e3,x*1e3,abs(G).^2); axis image; colormap jet; colorbar; title('高斯平面波'); subplot(1,3,2); imagesc(x*1e3,x*1e3,abs(grating)); axis image; colormap jet; colorbar; title('叉形光栅'); subplot(1,3,3); imagesc(x*1e3,x*1e3,abs(E).^2); axis image; colormap jet; colorbar; title('叠加光束'); ``` 2.使用计算全息法产生涡旋光束。可以使用MATLAB的光学工具箱(Optics Toolbox)和计算全息函数(Computer Generated Hologram, CGH)来实现。具体步骤如下: ```matlab % 定义参数 wavelength = 633e-9; % 波长 k = 2*pi/wavelength; % 波矢量 f = 100e-3; % 焦距 N = 512; % 采样点数 L = 10e-3; % 采样区域大小 dx = L/N; % 采样间隔 x = (-N/2:N/2-1)*dx; % 采样点坐标 [X,Y] = meshgrid(x); % 采样点网格 % 定义涡旋光束参数 l = 1; % 轨道角动量 w0 = 1e-3; % 光束半径 R = inf; % 曲率半径 z = 0; % 传播距离 G = vortexBeam(X,Y,l,w0,R,z,wavelength); % 计算全息函数 CGH = hologram(G,X,Y,wavelength,f); % 加载到空间光调制器上 loadSLM(CGH); ``` 以上两个步骤可以结合起来,使用相同位错的叉形光栅叠加和计算全息法来制备相反拓扑荷涡旋光束的叠加态。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值