Saved in:
Bibliographic Details
Main Authors: Serrera, Guillermo, Gutierrez Vela, Yael, Gil, José J
Format: Recurso digital
Language:
Published: Zenodo 2026
Online Access:https://doi.org/10.5281/zenodo.18682022
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • <p># DiPolIn (DIpolar POLarization in INtrinsic reference frame)</p> <p>We provide a code for local polarization evaluation based on the 3D-to-2D projection in the intrinsic polarization reference frame. Although single dipoles have purely deterministic fields, forcing their polarization to lies in a single plane, their non-trivial vectorial nature makes assessing polarization difficult. This code provides conventional Stokes parameters by identifying the intrinsic polarization reference frame at any point and projecting the field to that system. </p> <p>## Requirements</p> <p>- MATLAB</p> <p>## Code</p> <p>MAIN PIPELINE</p> <p>- **intrinsic_main.m** Main driver of the code. Given the dipole definition, observation point, and medium parameters, this function computes the electromagnetic fields, energy flow, spin density, intrinsic reference frame, projected coherence matrix, and intrinsic polarization parameters.</p> <p>DIPOLE FIELDS</p> <p>- **get_fields.m** Dispatch function that selects the appropriate dipolar field according to the dipole type and orientation.</p> <p>- **field_electric_dipole.m** Computes the electric and magnetic fields of an arbitrarily oriented electric dipole.</p> <p>- **field_magnetic_dipole.m** Computes the electric and magnetic fields of an arbitrarily oriented magnetic dipole.</p> <p>- **field_chiral_dipole.m** Computes the fields of a chiral dipole including electric–magnetic coupling.</p> <p>ENERGY FLOW AND SPIN</p> <p>- **Sc_and_grad.m** Computes the full time-averaged Poynting vector and its spatial derivatives.</p> <p>- **spin_and_normal.m** Computes the electromagnetic spin density and the associated intrinsic normal direction.</p> <p>- **spin_transversality_index.m** Evaluates the relative orientation between energy flow and spin, providing a quantitative measure of spin–polarization transversality.</p> <p>INTRINSIC POLARIZATION</p> <p>- **project_to_intrinsic_spin.m** Projects the coherence matrix onto the intrinsic reference frame defined by the local spin direction. Computes intrinsic Stokes parameters, degree of polarization, azimuth, and ellipticity, and reconstructs a normalized polarization ellipse.</p> <p>- **plot_intrinsic_ellipse.m** Generates a 2D plot of the polarization ellipse in the intrinsic reference frame, normalized with respect to intensity.</p> <p>AUXILIARY FUNCTIONS</p> <p>Additional utility functions are provided for coordinate transformations, basis construction, vector normalization, and numerical stability.</p> <p>## Workflow</p> <p>The typical workflow of the code is as follows:</p> <p>1. Definition of the dipole type, orientation, and parameters.</p> <p>2. Computation of the electromagnetic fields at the observation point.</p> <p>3. Evaluation of the Poynting vector and spin density.</p> <p>4. Construction of an intrinsic reference frame associated with the field.</p> <p>5. Projection of the coherence matrix onto the intrinsic frame.</p> <p>6. Extraction of intrinsic polarization parameters and polarization ellipse.</p> <p>## Examples</p> <p>- **demo_intrinsic_polarization.m** Simple demonstration script illustrating how to define a dipole, run the intrinsic polarization analysis, and visualize the resulting polarization ellipse.</p>