reconstruct_GF

Reconstruct the dyadic Green’s function from BEM electric field data.

Two reconstruction modes are supported:

Separation-indexed (planar / translational symmetry):

BEM provides the electric field for a single dipole at various separations Rx. Translational symmetry is assumed — all emitter pairs at the same separation share the same Green’s function. A single self-term (Purcell factor at Rx = 0) is used for all sites. Output: HDF5 with gf_layout = "separation".

Pair-indexed (nanorod / arbitrary geometry):

BEM provides the electric field for dipoles placed at each emitter site independently. Each emitter has its own Purcell factor and inter-site coupling. No translational symmetry assumed. Output: HDF5 with gf_layout = "pair".

The build_and_save() function handles separation-indexed data. The build_and_save_pair() function handles pair-indexed data.

mqed.BEM.reconstruct_GF.build_and_save_pair(xlsx_paths: list, out_h5: str, zD_m: float, zA_m: float, energy_eV: float, p_eff_path: str, emitter_positions_nm: numpy.ndarray)[source]

Reconstruct pair-indexed Green’s function from per-emitter BEM data.

For geometries without translational symmetry (e.g. nanorods), each emitter must be used as a dipole source in a separate BEM simulation. This function reads one Excel file per emitter, reconstructs the full (N, N, 3, 3) Green’s function tensor, and saves it in the pair-indexed HDF5 format.

The BEM workflow for pair-indexed reconstruction:

  1. For each emitter site i, run a BEM simulation with a point dipole at position r_i. Record the electric field at all other sites r_j and the Purcell factor at r_i.

  2. Collect all results into one Excel file per source emitter i.

  3. Pass the list of Excel files (one per emitter) to this function.

Parameters:
  • xlsx_paths – List of N Excel file paths, one per source emitter. xlsx_paths[i] contains the BEM fields from a dipole at site i.

  • out_h5 – Output HDF5 file path.

  • zD_m – Source z-position in meters.

  • zA_m – Observer z-position in meters.

  • energy_eV – Emitter transition energy (eV).

  • p_eff_path – Path to p_eff calibration file.

  • emitter_positions_nm – Shape (N, 3) array of emitter positions in nm. Needed for vacuum GF computation.

Output:

HDF5 file with gf_layout = "pair" and datasets green_function_total(1, N, N, 3, 3) and green_function_vacuum(1, N, N, 3, 3).

mqed.BEM.reconstruct_GF.main(cfg: omegaconf.DictConfig)

Main function to run the reconstruction of the Green’s function.