OAM_KIST package
Submodules
OAM_KIST.holography module
- OAM_KIST.holography.encode_hologram(Amp, Phase, X, Y, pixel_pitch, d, N_steps=0, M=1, prepare=False, measure=False, save=False, path='', name='', use_inv_sinc_minus=False)[source]
phase mask for given amplitude and phase map of superimposed OAM mode.
입력받은 위상, 진폭 정보를 논문 공식에 대입하여 이 상태를 인코딩하는 SLM 홀로그램을 생성합니다. Fundamental Gaussian 모드와의 분리를 위해서 간격이 d 픽셀인 그레이팅이 적용됩니다. 상태 준비에 사용될지, 측정에 사용될지에 따라서 그레이팅의 방향이 바뀝니다. 변수 parity가 이것을 반영합니다. 생성된 홀로그램을 저장할 수 있습니다.
- Parameters:
Amp (np.ndarray[float]) – amplitude map of superimposed OAM mode. 0. <= *Amp <= 1.
Phase (np.ndarray[float]) – phase map of superimposed OAM mode. -pi < *Phase <= pi
X (np.ndarray[float]) – x dependent meshgrid.
Y (np.ndarray[float]) – y dependent meshgrid.
pixel_pitch (float) – pixel size. specified at device document
d (float) – grating width. dimension in # of pixel
N_steps (float) – number of steps per grating with period d. N_steps=0 is equal to N_steps=d (continuous)
M (int) – phase depth. M is basically 1
prepare (bool) – decide whether to prepare.
measure (bool) – decide whether to measure.
save (bool) – decide whether to save.
path (string) – directory path for images. needed only when arg save is True
name (string) – filename of this image. needed only when arg save is True
use_inv_sinc_minus (bool) – whether to use inverse sinc in domain [-pi,0] or not.
- Returns:
returns carculated hologram. if arg save is False(default), a hologram in numpy ndarray. And if not, hologram is saved in the directory addording to arg path.
- Return type:
np.ndarray[float] or None
Example
>>> import numpy as np >>> slm_res = [1920, 1080] >>> slm_pitch = 8e-1 >>> input_w0 = 0.8e-3 >>> grating_width, grating_step, phase_depth = 8, 8, 1 >>> grating_parameter = [grating_width, grating_step, phase_depth] >>> target_l = [-3, -1, 1, 3] >>> target_p = np.zeros_like(target_l) >>> target_weights = [0.4, 0.03, 0.07, 0.5] >>> img_path, img_name = "./img", "superposition_oam" >>> superposition_args = [slm_res, slm_pitch, input_w0, target_l, target_p, target_weights, True, False] >>> fields = generate_oam_superposition(*superposition_args) >>> hologram_args = [*fields, slm_pitch, *grating_parameter, True, False] >>> prepare_hologram = encode_hologram(*hologram_args) >>> hologram_args = hologram_args.append([True, img_path, img_name, False]) >>> encode_hologram(*hologram_args)
- OAM_KIST.holography.encode_hologram_405(Amp, Phase, X, Y, pixel_pitch, d, N_steps=0, M=1, prepare=False, measure=False, save=False, path='', name='', use_inv_sinc_minus=False)[source]
phase mask for given amplitude and phase map of superimposed OAM mode.
입력받은 위상, 진폭 정보를 논문 공식에 대입하여 이 상태를 인코딩하는 SLM 홀로그램을 생성합니다. Fundamental Gaussian 모드와의 분리를 위해서 간격이 d 픽셀인 그레이팅이 적용됩니다. 상태 준비에 사용될지, 측정에 사용될지에 따라서 그레이팅의 방향이 바뀝니다. 변수 parity가 이것을 반영합니다. 생성된 홀로그램을 저장할 수 있습니다.
- Parameters:
Amp (np.ndarray[float]) – amplitude map of superimposed OAM mode. 0. <= *Amp <= 1.
Phase (np.ndarray[float]) – phase map of superimposed OAM mode. -pi < *Phase <= pi
X (np.ndarray[float]) – x dependent meshgrid.
Y (np.ndarray[float]) – y dependent meshgrid.
pixel_pitch (float) – pixel size. specified at device document
d (float) – grating width. dimension in # of pixel
N_steps (float) – number of steps per grating with period d. N_steps=0 is equal to N_steps=d (continuous)
M (int) – phase depth. M is basically 1
prepare (bool) – decide whether to prepare.
measure (bool) – decide whether to measure.
save (bool) – decide whether to save.
path (string) – directory path for images. needed only when arg save is True
name (string) – filename of this image. needed only when arg save is True
use_inv_sinc_minus (bool) – whether to use inverse sinc in domain [-pi,0] or not.
- Returns:
returns carculated hologram. if arg save is False(default), a hologram in numpy ndarray. And if not, hologram is saved in the directory addording to arg path.
- Return type:
np.ndarray[float] or None
Example
>>> import numpy as np >>> slm_res = [1920, 1080] >>> slm_pitch = 8e-1 >>> input_w0 = 0.8e-3 >>> grating_width, grating_step, phase_depth = 8, 8, 1 >>> grating_parameter = [grating_width, grating_step, phase_depth] >>> target_l = [-3, -1, 1, 3] >>> target_p = np.zeros_like(target_l) >>> target_weights = [0.4, 0.03, 0.07, 0.5] >>> img_path, img_name = "./img", "superposition_oam" >>> superposition_args = [slm_res, slm_pitch, input_w0, target_l, target_p, target_weights, True, False] >>> fields = generate_oam_superposition(*superposition_args) >>> hologram_args = [*fields, slm_pitch, *grating_parameter, True, False] >>> prepare_hologram = encode_hologram(*hologram_args) >>> hologram_args = hologram_args.append([True, img_path, img_name, False]) >>> encode_hologram(*hologram_args)
- OAM_KIST.holography.generate_oam_superposition(res, pixel_pitch, beam_w0, l_modes, p_modes, weights, prepare=True, measure=False, displacement=[0, 0])[source]
Creat E field of superimposed OAM mode (Interferogram method)
- Parameters:
res (list[int]) – resolution of SLM. [x resolution, y resolution]
pixel_pitch (float) – pixel size. specified at device document
beam_w0 (float) – beam-waist at z=0.
l_modes (list[int]) – selected l indices for superposion. list with length 1 for eigen mode
p_modes (list[int]) – selected p indices for superposion. list with length 1 for eigen mode
weights (list[float]) – weights for selected l modes.
prepare (bool) – whether to prepare the OAM superposition before generating superposition
measure (bool) – whether to measure the OAM superposition before generating superposition
- Returns:
information about E field and meshgrid i.e. superimosed
- Return type:
np.ndarray[float], np.ndarray[float], np.ndarray[float], np.ndarray[float]
Example
>>> import numpy as np >>> slm_res = [1920, 1080] >>> slm_pitch = 8e-1 >>> input_w0 = 0.8e-3 >>> target_l = [-3, -1, 1, 3] >>> target_p = np.zeros_like(target_l) >>> target_weights = [0.4, 0.03, 0.07, 0.5] >>> superposition_args = [slm_res, slm_pitch, input_w0, target_l, target_p, target_weights, True, False] >>> fields = generate_oam_superposition(*superposition_args)
OAM_KIST.utils module
Module contents
- OAM_KIST.encode_hologram(Amp, Phase, X, Y, pixel_pitch, d, N_steps=0, M=1, prepare=False, measure=False, save=False, path='', name='', use_inv_sinc_minus=False)[source]
phase mask for given amplitude and phase map of superimposed OAM mode.
입력받은 위상, 진폭 정보를 논문 공식에 대입하여 이 상태를 인코딩하는 SLM 홀로그램을 생성합니다. Fundamental Gaussian 모드와의 분리를 위해서 간격이 d 픽셀인 그레이팅이 적용됩니다. 상태 준비에 사용될지, 측정에 사용될지에 따라서 그레이팅의 방향이 바뀝니다. 변수 parity가 이것을 반영합니다. 생성된 홀로그램을 저장할 수 있습니다.
- Parameters:
Amp (np.ndarray[float]) – amplitude map of superimposed OAM mode. 0. <= *Amp <= 1.
Phase (np.ndarray[float]) – phase map of superimposed OAM mode. -pi < *Phase <= pi
X (np.ndarray[float]) – x dependent meshgrid.
Y (np.ndarray[float]) – y dependent meshgrid.
pixel_pitch (float) – pixel size. specified at device document
d (float) – grating width. dimension in # of pixel
N_steps (float) – number of steps per grating with period d. N_steps=0 is equal to N_steps=d (continuous)
M (int) – phase depth. M is basically 1
prepare (bool) – decide whether to prepare.
measure (bool) – decide whether to measure.
save (bool) – decide whether to save.
path (string) – directory path for images. needed only when arg save is True
name (string) – filename of this image. needed only when arg save is True
use_inv_sinc_minus (bool) – whether to use inverse sinc in domain [-pi,0] or not.
- Returns:
returns carculated hologram. if arg save is False(default), a hologram in numpy ndarray. And if not, hologram is saved in the directory addording to arg path.
- Return type:
np.ndarray[float] or None
Example
>>> import numpy as np >>> slm_res = [1920, 1080] >>> slm_pitch = 8e-1 >>> input_w0 = 0.8e-3 >>> grating_width, grating_step, phase_depth = 8, 8, 1 >>> grating_parameter = [grating_width, grating_step, phase_depth] >>> target_l = [-3, -1, 1, 3] >>> target_p = np.zeros_like(target_l) >>> target_weights = [0.4, 0.03, 0.07, 0.5] >>> img_path, img_name = "./img", "superposition_oam" >>> superposition_args = [slm_res, slm_pitch, input_w0, target_l, target_p, target_weights, True, False] >>> fields = generate_oam_superposition(*superposition_args) >>> hologram_args = [*fields, slm_pitch, *grating_parameter, True, False] >>> prepare_hologram = encode_hologram(*hologram_args) >>> hologram_args = hologram_args.append([True, img_path, img_name, False]) >>> encode_hologram(*hologram_args)
- OAM_KIST.generate_oam_superposition(res, pixel_pitch, beam_w0, l_modes, p_modes, weights, prepare=True, measure=False, displacement=[0, 0])[source]
Creat E field of superimposed OAM mode (Interferogram method)
- Parameters:
res (list[int]) – resolution of SLM. [x resolution, y resolution]
pixel_pitch (float) – pixel size. specified at device document
beam_w0 (float) – beam-waist at z=0.
l_modes (list[int]) – selected l indices for superposion. list with length 1 for eigen mode
p_modes (list[int]) – selected p indices for superposion. list with length 1 for eigen mode
weights (list[float]) – weights for selected l modes.
prepare (bool) – whether to prepare the OAM superposition before generating superposition
measure (bool) – whether to measure the OAM superposition before generating superposition
- Returns:
information about E field and meshgrid i.e. superimosed
- Return type:
np.ndarray[float], np.ndarray[float], np.ndarray[float], np.ndarray[float]
Example
>>> import numpy as np >>> slm_res = [1920, 1080] >>> slm_pitch = 8e-1 >>> input_w0 = 0.8e-3 >>> target_l = [-3, -1, 1, 3] >>> target_p = np.zeros_like(target_l) >>> target_weights = [0.4, 0.03, 0.07, 0.5] >>> superposition_args = [slm_res, slm_pitch, input_w0, target_l, target_p, target_weights, True, False] >>> fields = generate_oam_superposition(*superposition_args)