HASEonGPU.PhiASE

class HASEonGPU.PhiASE(config=None, crossSections=None, spectralProperties=None, laserProperties=None, gainMedium=None, minRaysPerSample=100000, maxRaysPerSample=100000, mseThreshold=0.1, repetitions=4, adaptiveSteps=4, useReflections=True, monochromatic=False, backend=None, openpmdBackend='auto', parallelMode='single', numDevices=1, nPerNode=1, writeVtk=False, devices=<factory>, minSampleRange=None, maxSampleRange=None, rngSeed=None)

Bases: object

Configure and run the ASE flux calculation for one gain-medium state.

Simulation normally owns this object and calls run(...) during each time-step derivative evaluation. Advanced users can also call run directly with a GainMedium and CrossSectionData object.

Parameters:
  • config (object | None)

  • crossSections (CrossSectionData | None)

  • spectralProperties (CrossSectionData | None)

  • laserProperties (LaserProperties | None)

  • gainMedium (GainMedium | None)

  • minRaysPerSample (int)

  • maxRaysPerSample (int)

  • mseThreshold (float)

  • repetitions (int)

  • adaptiveSteps (int)

  • useReflections (bool)

  • monochromatic (bool)

  • backend (str)

  • openpmdBackend (str | None)

  • parallelMode (str)

  • numDevices (int)

  • nPerNode (int)

  • writeVtk (bool)

  • devices (list[int])

  • minSampleRange (int | None)

  • maxSampleRange (int | None)

  • rngSeed (int | None)

config: object | None = None

Optional YAML filename or mapping with PhiASE run-control settings.

crossSections: CrossSectionData | None = None

Absorption/emission spectra used by the ASE calculation.

spectralProperties: CrossSectionData | None = None

Alias for crossSections kept for the public spectral API.

laserProperties: LaserProperties | None = None

Lower-level laser property store accepted by legacy workflows.

gainMedium: GainMedium | None = None

Optional medium stored for direct run() calls.

minRaysPerSample: int = 100000

Minimum Monte Carlo rays launched for each beta sample.

maxRaysPerSample: int = 100000

Maximum rays per sample allowed during adaptive refinement.

mseThreshold: float = 0.1

Target mean-squared-error threshold for adaptive ASE sampling.

repetitions: int = 4

Maximum repeated ASE estimates at a fixed ray count.

adaptiveSteps: int = 4

Number of ray-count increases between min and max rays.

useReflections: bool = True

Whether top/bottom surface reflectivities affect ray propagation.

monochromatic: bool = False

Use only the first spectral samples instead of wavelength integration.

backend: str = None

Alpaka backend name; inspect valid strings with AlpakaBackends.all().

openpmdBackend: str | None = 'auto'

openPMD backend; auto prefers SST, ADIOS, then HDF5 when supported.

parallelMode: str = 'single'

local single execution or the MPI launcher mpi.

Type:

Execution mode

numDevices: int = 1

Maximum compute devices made available to the lower-level run.

nPerNode: int = 1

MPI ranks per node launched automatically when parallelMode is mpi.

writeVtk: bool = False

Request VTK output from lower-level compute paths when supported.

devices: list[int]

Optional explicit device ids passed to the lower-level compute path.

minSampleRange: int | None = None

Inclusive first flattened beta sample processed by ASE.

maxSampleRange: int | None = None

Inclusive last flattened beta sample processed by ASE.

rngSeed: int | None = None

Optional RNG seed for reproducible Monte Carlo sampling.

classmethod fromYaml(filename, **overrides)

Create a PhiASE configuration from YAML plus Python overrides.

static addArguments(parser)

Add command-line arguments that map to PhiASE settings.

classmethod fromArgs(args, **overrides)

Create a PhiASE configuration from parsed argparse results.

openStream(**kwargs)

Open a persistent openPMD transport session owned by this PhiASE.

closeStream()

Close this PhiASE object’s persistent openPMD transport session.

run(gainMedium=None, crossSections=None, *, openpmdSession=None)

Run ASE for the supplied or configured GainMedium.

Returns self. Use getResults() afterwards to access the raw lower-level result, including phiAse.

getResults()

Return the raw ASE result from the most recent run(...) call.