Scenario API¶
scenario
¶
Simulation scenario configuration and setup.
This module defines four scenario types for different analysis needs:
- Simple: Single-point calculation (scalar angles and frequency)
- Incident: Angle sweep at multiple frequencies (kx-ω plots)
- Azimuthal: Sample rotation at fixed incident angle (β-ω plots)
- Dispersion: k-space map at fixed frequency (kx-ky plots)
Each scenario type automatically sets up appropriate angle and frequency arrays with correct dimensions for batch processing.
Classes:
-
ScenarioSetup–Abstract class for a scenario setup
ScenarioSetup
¶
Bases: ABC
Abstract class for a scenario setup
Initialize scenario configuration for simulation.
Parameters:
-
data(dict[str, Any]) –Dictionary with 'type' and scenario-specific parameters
Raises:
-
NotImplementedError–If scenario type is not recognized
Example
data = {"type": "Simple", "incidentAngle": 45.0, ... "azimuthal_angle": 0.0, "frequency": 1460.0} scenario = ScenarioSetup(data)
Methods:
-
create_scenario–Create scenario-specific angle and frequency arrays.
-
create_incident_scenario–Create incident angle sweep scenario.
-
create_azimuthal_scenario–Create azimuthal rotation scenario at fixed incident angle.
-
create_dispersion_scenario–Create k-space dispersion scenario at fixed frequency.
-
create_simple_scenario–Create single-point scenario with scalar values.
-
create_full_sweep_scenario–Create full 3D parameter sweep: frequency × incident_angle × azimuthal_angle.
Source code in hyperbolic_optics/scenario.py
create_scenario
¶
Create scenario-specific angle and frequency arrays.
Dispatches to appropriate scenario creation method based on type.
Raises:
-
NotImplementedError–If scenario type is not implemented
Source code in hyperbolic_optics/scenario.py
create_incident_scenario
¶
Create incident angle sweep scenario.
Sets up 360 incident angles from -π/2 to π/2 for analyzing angle-dependent reflectivity across the material's frequency range.
Note
Frequency range is determined by the material in the final layer. Creates arrays suitable for generating kx vs frequency plots.
Source code in hyperbolic_optics/scenario.py
create_azimuthal_scenario
¶
Create azimuthal rotation scenario at fixed incident angle.
Rotates the sample through 360 azimuthal angles (0 to 2π) while maintaining constant incident angle.
Note
Useful for studying in-plane anisotropy and rotational symmetry. incidentAngle must be provided in input data.
Source code in hyperbolic_optics/scenario.py
create_dispersion_scenario
¶
Create k-space dispersion scenario at fixed frequency.
Sets up grid of incident angles (180 points) and azimuthal angles (480 points) for mapping isofrequency contours in kx-ky space.
Note
Requires 'frequency' to be specified in input data. Generates data for kx vs ky momentum-space plots.
Source code in hyperbolic_optics/scenario.py
create_simple_scenario
¶
Create single-point scenario with scalar values.
Converts incident angle, azimuthal angle, and frequency to scalar values for quick single-point calculations.
Note
All three parameters (incidentAngle, azimuthal_angle, frequency) must be provided in input data.
Source code in hyperbolic_optics/scenario.py
create_full_sweep_scenario
¶
Create full 3D parameter sweep: frequency × incident_angle × azimuthal_angle.
Sets up a 3D grid sweeping all three parameters simultaneously for complete visualization of the optical response space.
Note
Frequency range is determined by the material in the final layer. Output will have shape [N_freq, N_incident, N_azimuthal]