Create input file¶
Overview¶
- We use
.ymlformat for input files which has a dictionary-like structure. It has the following main sections: mode: str (optional), one ofsimulation,postprocessor (default)simulation_postprocessType of calculation to perform.
fields: dict of dictsParameters of background fields.
grid: dictGrid parameters.
integrator: dictType of amplitude to calculate (total vacuum emission or linearized in the probe field).
performance: dictPerformance-related parameters.
postprocess: dictPostprocessing parameters (which observables to calculate from the complex amplitudes).
quvac-simulation-parallel additionally requires section cluster_params describing
parameters of parallelization. Similarly, quvac-gridscan requires a section gridscan (parameters
being scanned and slurm job parameters), quvac-optimization requires a section optimization
(parameters to setup optimization experiment: optimized variables, metrics, sampling strategy, …).
fields¶
This section of .yml file is constructed as {'field_1': {...}, 'field_2': {...}, ...} where each dictionary of field parameters has the field_type parameter and
other parameters specific to the chosen field type.
field_type is constructed via the combination of the field name (dipole, paraxial_gaussian, laguerre_gaussian)
and how it is simulated (analytic, maxwell). For instance, to use the analytic expression of paraxial Gaussian for all time steps, choose paraxial_gaussian_analytic;
to use the dipole pulse expression for initialization and use linear Maxwell equations for later time steps, choose dipole_maxwell.
Currently there are two special fields that are supported only as an analytic expression: eb_inhomogeneity, plane_wave.
For the full list of available keywords, refer to quvac.field.ANALYTIC_FIELDS and quvac.field.SPATIAL_MODEL_FIELDS.
Field parameters |
Field types |
||
|---|---|---|---|
dipole |
paraxial_gaussian |
laguerre_gaussian |
|
|
Focus location in space |
||
|
Focus location in time |
||
|
Energy |
||
|
Wavelength |
||
|
Duration |
||
|
Virtual dipole moment orientation |
Optical axis orientation |
|
|
– |
Polarization angle |
|
|
Phase delay at the focus |
||
|
– |
Waist size |
|
|
– |
Paraxial expansion order |
|
|
– |
Field amplitude (if W is not specified) |
|
|
– |
– |
Radial index of the Laguerre-Gaussian mode |
|
– |
– |
Azimuthal index of the Laguerre-Gaussian mode |
|
|
– |
|
|
Temporal envelope type ( |
– |
|
grid¶
- Required keys are:
modestrMode of grid creation (
dynamicorstatic).
- Keys for
staticmode: box_xyztuple of floatBox size for the spatial grid.
Nxyztuple of intNumber of grid points along each spatial dimension.
NtintNumber of temporal points.
box_tfloat or tuple of floatTime duration or start and end times for the temporal grid.
- Keys for
dynamicmode: collision_geometrystrSpecifies the collision geometry (‘x’, ‘y’, ‘z’).
transverse_factorfloatFactor to scale the transverse size.
longitudinal_factorfloatFactor to scale the longitudinal size.
time_factorfloatFactor to scale the time duration.
spatial_resolutionfloat or list of float, optionalControls the spatial resolution.
time_resolutionfloat, optionalControls the temporal resolution.
ignore_idxlist of int, optionalIndices of fields to ignore for dynamic grid creation.
integrator (optional)¶
- Keys:
type: strvacuum_emission(calculate the total vacuum emission amplitude) orvacuum_emission_channels(calculate the amplitude linearized in the probe field)
probe_pump_idx: dict- Indices of probe and pump fields.
probe: list of intIndices of the probe field, by default [0].
pump: list of intIndices of the pump field, by default [1].
performance (optional)¶
- Keys:
precision: strNumerical precision for calculations:
float32or (by default)float64.
nthreads: intNumber of threads to use for
numexprlibrary, by default all available CPUs.
pyfftw_threads: intNumber of threads to use for
pyfftwlibrary, by default equal tonthreads.
test_run: boolWhether to do a test run to estimate the resources for the full calculation.
test_timesteps: intNumber of timesteps for a test run, by default 5.
use_wisdom: boolWhether to use existing wisdom file for
pyfftwplanning.
postprocessing (optional)¶
- This section is relevant only when
modeispostprocessorsimulation_postprocess. Relevant keys for the polarization-insensitive signals: calculate_xyz_backgroundbool, optionalWhether to calculate the background spectra on Cartesian grid, by default False.
bgr_idxint, optionalIndex of the background field, by default None.
calculate_sphericalbool, optionalWhether to calculate the spectra on spherical grid, by default False.
spherical_paramsdict, optionalParameters for the spherical grid, by default None.
calculate_discerniblebool, optionalWhether to calculate the discernible signal, by default False.
discernibilitystr, optionalType of discernibility, (by default)
angularorspectral.
- Relevant keys for the polarization-sensitive signals:
perp_field_idxint, optionalIndex of the perpendicular field, by default 1.
perp_typestr, optionalType of perpendicular polarization,
optical_axisorlocal_axis, by default None.
calculate_sphericalbool, optionalWhether to calculate the spectra on spherical grid, by default False.
spherical_paramsdict, optionalParameters for the spherical grid, by default None.
stokesbool, optionalWhether to calculate Stokes parameters, by default False.
cluster_params (for quvac-simulation-parallel)¶
- Keys:
cluster_type: str,Where perform calculations,
localorslurm.
number_of_time_intervals: intNumber of time intervals to split the amplitude, by default 2.
max_parallel_jobs: intMaximal number of jobs to submit simultaneously, by default equal to
number_of_time_intervals.
sbatch_params: dictSubmission parameters for a single job. Possible keys:
slurm_partition,cpus_per_task,memory,walltime. By default,quvac.config.DEFAULT_SLURM_PARAMS.
gridscan (for quvac-gridscan)¶
- Keys:
create_grids: boolFlag to create grids given [start, end, n_steps].
fields: dictParameters over which to perform grid scan.
cluster_params: dictcluster_type: strWhere perform calculations,
localorslurm.
max_parallel_jobs: intMaximal number of submitted jobs in parallel.
sbatch_params: dictSubmission parameters for a single job.
optimization (for quvac-optimization)¶
- Keys:
name: strOptimization name.
parameters: dictOptimized parameters given as lists [start, end].
energy_fields: dict- Fields participating in the energy optimization (to check that the fixed budget is not violated):
fields: list of intFields for which the fixed energy budget constraint should be satisfied.
optimized_fields: list of intFields being optimized.
scales: dictScales for optimized parameters. For instance, parameter could be the duration with bounds
[20,50]and the provided scale1e-15corresponds to femtoseconds.
cluster_params: dictSubmission parameters for a single job.
n_trials: intNumber of trials to perform.
objective: strObjective function. By default, objectives are assumed to be maximized, put
-in front of it to indicate that it needs to be minimized (e.g.,"-signal"would mean “minimize metric calledsignal”). Multi-objective optimization could be also specified this way, e.g."signal, computational_cost". For more details, check ax tutorials.
objectives_params: dict- Objective parameters:
detectors: dict or list of dictsDetector parameters (
phi0,theta0for the center of detector,dphi,dthetafor its size).
track_metrics: list of strAdditional metrics to track.
parameter_constraints: list of strOptimized parameter constraints, for example
a + b + c <= 1.
generation_strategy_type: ‘quality’ or ‘fast’Generation strategy for sampling next trials.
gs_initialization_random_seed: intInitial random seed for the generation strategy for reproducible experiments.
noiseless_observations: boolWhether observations are considered noisy or not.