qiu_classical_simulation.wave_optics.parameters
¶
The parameters of a lens experiment: a Gaussian beam through a plano-convex lens.
A Gaussian beam of a waist given by its FWHM enters a plano-convex lens, sliced along
the optical axis into thin transparent plates, and then propagates freely behind it.
The transverse field is sampled on 2**num_qubits points of a window of
transverse_length, which the lens fills.
Classes:
-
ExperimentParameters–The parameters of a lens experiment, from which all others are derived.
Attributes:
-
LEGACY_KEYS–Former names of stored parameters, mapped to the current ones.
-
LEGACY_DEFAULTS(dict[str, Any]) –Values of parameters missing in older results, which always used them.
LEGACY_KEYS
module-attribute
¶
LEGACY_KEYS = {'timestamp': 'experiment_datetime', 'reverse_order': 'lens_reverse_order'}
Former names of stored parameters, mapped to the current ones.
LEGACY_DEFAULTS
module-attribute
¶
Values of parameters missing in older results, which always used them.
ExperimentParameters
dataclass
¶
ExperimentParameters(vacuum_wavelength: float, beam_FWHM: float, focal_length: float, refractive_index: float, propagation_after_lens: float, transverse_length: float, num_of_steps_after_lens: int, lens_slices: int, num_qubits: int, max_delta: float, lens_reverse_order: bool, fresnel_approximation: bool, scale_down_phases: bool, direct_propagator: bool, experiment_datetime: datetime = now(), uuid: str = (lambda: hex)())
The parameters of a lens experiment, from which all others are derived.
Methods:
-
validity_problems–Return the violated conditions of the sampling and the paraxial regime.
-
is_valid–Whether the parameters satisfy the conditions of
validity_problems. -
to_dict–Return the parameters, with the derived lens geometry, as JSON values.
-
from_dict–Create the parameters from stored values, e.g. of
to_dict.
Attributes:
-
vacuum_wavelength(float) – -
beam_FWHM(float) – -
focal_length(float) – -
refractive_index(float) – -
propagation_after_lens(float) – -
transverse_length(float) – -
num_of_steps_after_lens(int) – -
lens_slices(int) – -
num_qubits(int) –The number of qubits
nof the2**ntransverse samples. -
max_delta(float) –The maximum phase per cycle of the sample-based phase protocol.
-
lens_reverse_order(bool) –If True, the beam enters through the plane side of the lens.
-
fresnel_approximation(bool) –If True, the lens surface is approximated by a paraboloid.
-
scale_down_phases(bool) –If True, the phases of the lens slices are reduced modulo
2 pi. -
direct_propagator(bool) –If True, free propagation is applied directly, else with the phase protocol.
-
experiment_datetime(datetime) – -
uuid(str) – -
k0(float) –The vacuum wavenumber.
-
reduced_wavelength(float) –The wavelength inside the lens.
-
radius_of_curvature(float) –The radius of curvature of the convex surface, from the lensmaker's equation.
-
lens_diameter(float) –The diameter of the lens, filling the transverse window.
-
lens_radius(float) –The transverse radius of the lens.
-
lens_thickness(float) –The thickness of the lens at its center.
-
dimension(int) –The number of transverse samples.
-
delta_x(float) –The transverse sampling period.
-
gaussian_mean(float) –The transverse position of the beam's center, the center of the window.
-
gaussian_beam_waist(float) –The waist radius of the beam, from its FWHM.
-
lens_slice_thickness(float) –The thickness of each lens slice.
-
step_size_after_lens(float) –The length of each free propagation step behind the lens.
-
lens_slice_positions(NDArray[float64]) –The depths of the midpoints of the lens slices, from the vertex.
-
lens_transverse_radii(list[float]) –The transverse radii of the lens slices, from the vertex.
-
x_axis(PositionAxis) –The transverse position axis, from 0 to
transverse_length. -
k_axis(AngularWavenumberAxis) –The angular wavenumber axis of the angular spectrum, in the FFT ordering.
-
initial_beam_profile(AlgebraicSignal) –The field of the Gaussian beam entering the lens.
-
initial_state(NDArray[complex128]) –The normalized amplitudes of the beam entering the lens.
-
lens_signals(list[AlgebraicSignal]) –The phase signals of the lens slices, from the vertex.
-
ordered_lens_signals(list[AlgebraicSignal]) –The phase signals of the lens slices, in the order the beam passes them.
num_qubits
instance-attribute
¶
num_qubits: int
The number of qubits n of the 2**n transverse samples.
max_delta
instance-attribute
¶
max_delta: float
The maximum phase per cycle of the sample-based phase protocol.
lens_reverse_order
instance-attribute
¶
lens_reverse_order: bool
If True, the beam enters through the plane side of the lens.
fresnel_approximation
instance-attribute
¶
fresnel_approximation: bool
If True, the lens surface is approximated by a paraboloid.
scale_down_phases
instance-attribute
¶
scale_down_phases: bool
If True, the phases of the lens slices are reduced modulo 2 pi.
direct_propagator
instance-attribute
¶
direct_propagator: bool
If True, free propagation is applied directly, else with the phase protocol.
experiment_datetime
class-attribute
instance-attribute
¶
uuid
class-attribute
instance-attribute
¶
radius_of_curvature
cached
property
¶
radius_of_curvature: float
The radius of curvature of the convex surface, from the lensmaker's equation.
lens_diameter
cached
property
¶
lens_diameter: float
The diameter of the lens, filling the transverse window.
gaussian_mean
cached
property
¶
gaussian_mean: float
The transverse position of the beam's center, the center of the window.
gaussian_beam_waist
cached
property
¶
gaussian_beam_waist: float
The waist radius of the beam, from its FWHM.
lens_slice_thickness
cached
property
¶
lens_slice_thickness: float
The thickness of each lens slice.
step_size_after_lens
cached
property
¶
step_size_after_lens: float
The length of each free propagation step behind the lens.
lens_slice_positions
cached
property
¶
The depths of the midpoints of the lens slices, from the vertex.
lens_transverse_radii
cached
property
¶
The transverse radii of the lens slices, from the vertex.
x_axis
cached
property
¶
x_axis: PositionAxis
The transverse position axis, from 0 to transverse_length.
k_axis
cached
property
¶
k_axis: AngularWavenumberAxis
The angular wavenumber axis of the angular spectrum, in the FFT ordering.
initial_beam_profile
cached
property
¶
initial_beam_profile: AlgebraicSignal
The field of the Gaussian beam entering the lens.
initial_state
cached
property
¶
initial_state: NDArray[complex128]
The normalized amplitudes of the beam entering the lens.
lens_signals
cached
property
¶
lens_signals: list[AlgebraicSignal]
The phase signals of the lens slices, from the vertex.
ordered_lens_signals
cached
property
¶
ordered_lens_signals: list[AlgebraicSignal]
The phase signals of the lens slices, in the order the beam passes them.
validity_problems
¶
Return the violated conditions of the sampling and the paraxial regime.
Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/parameters.py
65 66 67 68 69 70 71 72 73 74 75 76 77 | |
is_valid
¶
is_valid() -> bool
Whether the parameters satisfy the conditions of validity_problems.
Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/parameters.py
79 80 81 | |
to_dict
¶
Return the parameters, with the derived lens geometry, as JSON values.
Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/parameters.py
216 217 218 219 220 221 222 | |
from_dict
classmethod
¶
Create the parameters from stored values, e.g. of to_dict.
Values of results stored under former names (LEGACY_KEYS) are renamed, and
LEGACY_DEFAULTS fill in parameters which older results did not store.
Parameters:
-
values(dict[str, Any]) –The stored values; unknown keys, e.g. derived ones, are ignored.
-
defaults(dict[str, Any] | None, default:None) –Values for parameters missing in
values, e.g. those an older simulation did not store but used.
Returns:
-
ExperimentParameters–The parameters.
Raises:
-
KeyError–If parameters are missing in
values,defaultsandLEGACY_DEFAULTS.
Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/parameters.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |