real_fields.twodsi
Submodules
real_fields.twodsi.classical_algorithms_2dsi_real_fields module
- class real_fields.twodsi.classical_algorithms_2dsi_real_fields.GeneralizedProjection(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, **kwargs)[source]
Bases:
RetrievePulses2DSIwithRealFields,GeneralizedProjectionImplements the Generalized Projection Algorithm.
DeLong et al., Opt. Lett. 19, 2152-2154 (1994)
- no_steps_descent
the numer of descent steps per iteration
- Type:
int
- optimize_spectral_phase_directly
- Type:
bool
- class real_fields.twodsi.classical_algorithms_2dsi_real_fields.PtychographicIterativeEngine(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, **kwargs)[source]
Bases:
RetrievePulses2DSIwithRealFields,PtychographicIterativeEngineImplements a version of the Ptychographic Iterative Engine (PIE).
A. Maiden et al., Optica 4, 736-745 (2017) T. Schweizer, “Time-Domain Ptychography and its Applications in Ultrafast Science”, PhD Thesis, Bern (2021)
- alpha
a regularization parameter
- Type:
float
- pie_method
specifies the PIE variant. Can be one of None, PIE, ePIE, rPIE. Where None indicates that the pure gradient is used.
- Type:
None, str
- optimize_spectral_phase_directly
- Type:
bool
- class real_fields.twodsi.classical_algorithms_2dsi_real_fields.COPRA(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, **kwargs)[source]
Bases:
RetrievePulses2DSIwithRealFields,COPRAImplements a version of the Common Pulse Retrieval Algorithm (COPRA).
Geib et al., Optica 6, 495-505 (2019)
- class real_fields.twodsi.classical_algorithms_2dsi_real_fields.LSF(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, **kwargs)[source]
Bases:
RetrievePulses2DSIwithRealFields,LSFImplements a version of the Linesearch FROG Algorithm (LSF). Despite its name the algorithm is NOT restricted to FROG.
Krook and V. Pasiskevicius, Opt. Express 33, 33258-33269 (2025)
- no_sections
number of sections to split the search line into
- Type:
int
- number_of_disection_iterations
as the name says
- Type:
int
- direction_mode
can be random or continuous
- Type:
str
- ratio_points_for_continuous
smaller value means more randomness/eratic
- Type:
int
- only_allow_improvements
if true, only steps that decrease the error will be accepted
- Type:
bool
real_fields.twodsi.general_algorithms_2dsi_real_fields module
- class real_fields.twodsi.general_algorithms_2dsi_real_fields.DifferentialEvolution(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, strategy='best1_bin', selection_mechanism='greedy', mutation_rate=0.5, crossover_rate=0.7, **kwargs)[source]
Bases:
DifferentialEvolutionBASE,RetrievePulses2DSIwithRealFieldsImplements a Differential-Evolution Algorithm. Based on Qiang, J., Mitchell, C., A Unified Differential Evolution Algorithm for Global Optimization, 2014, https://www.osti.gov/servlets/purl/1163659
- strategy
the mutation and selection strategy, analogous to scipy’s differential evolution.
- Type:
str
- mutation_rate
the mutation rate
- Type:
float
- crossover_rate
the crossover rate
- Type:
float
- selection_mechanism
the selection mechanism, can be greedy or global, defined in select_population().
- Type:
str
- temperature
a temperature value for the global selection mechanism
- Type:
float
- class real_fields.twodsi.general_algorithms_2dsi_real_fields.Evosax(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, solver=None, **kwargs)[source]
Bases:
EvosaxBASE,RetrievePulses2DSIwithRealFieldsEmploys the evosax package to perform the optimization.
Robert Tjarko Lange, evosax: JAX-based Evolution Strategies, arXiv preprint arXiv:2212.04180 (2022)
- solver
any evosax-solver should work
- Type:
evosax-solver
- solver_params
user defined parameters for the evosax-solver, if None the default params set in evosax are used
- Type:
any
- solver_kwargs
some evosax-solver require additional input arguments. These can be supplied via this aattribute.
- Type:
dict
- class real_fields.twodsi.general_algorithms_2dsi_real_fields.AutoDiff(delay, frequency, measured_trace, nonlinear_method, spectral_filter1, spectral_filter2, cross_correlation=False, f_range_fields=(None, None), f_range_pulse=(None, None), f_max_all_fields=None, solver=None, **kwargs)[source]
Bases:
AutoDiffBASE,RetrievePulses2DSIwithRealFieldsEmploys the optimistix package to perform the optimization via Automatic-Differentiation.
J. Rader, T. Lyons and P.Kidger, Optimistix: modular optimisation in JAX and Equinox, arXiv:2402.09983 (2024) DeepMind et al., The DeepMind JAX Ecosystem, http://github.com/google-deepmind (2020)
- solver
solvers need to be initialized
- Type:
optimistix-solver, optax-solver
- alternating_optimization
if true, the optimizer alternates between amplitude and phase
- Type:
bool
- optimize_group_delay
if true, the group delay will be optimized instead of the spectral phase
- Type:
bool