E-DDA, a Fortran code for calculating scattering and absorption of light by irregular particles with general (scalar or tensorial) optical properties, has been jointly developed by R. Alcaraz de la Osa (Dept. of Applied Physics, University of Cantabria) and P. Albella (Dept. of Physics, Imperial College London). E-DDA is publicly available, and is covered by the GNU General Public License. If you choose to use it, please do not hesitate to contact me at rodri.alcaraz@gmail.com if you have any question/comment.

If you publish results obtained with E-DDA, please cite the following reference:

R. Alcaraz de la Osa, P. Abella, J. M. Saiz and F. Moreno, "Extended discrete dipole approximation and its application to bianisotropic media," *Opt. Express* **18** (23), 23865-23871 (2010).

You can download the latest version of the code from here.

**e-dda.par:**general input parameters, as the dipole spacing or the direction of both the incident wave vector and the incident electric field. More instructions within the file.**shape.dat:**A file where to give the coordinates of all the dipoles involved in the calculation. It has the very same structure as in DDSCAT 7.**diel#.tab:**(# may be a number between 1 and 9). A file where each line gives the incident wavelength and the nine components (real and imaginary parts in brackets) of both the relative dielectric tensor and the relative magnetic permeability tensor for that wavelength. The first 9 values correspond to the dielectric tensor elements, whereas the other 9 correspond to the relative magnetic permeability elements.

**ctable.txt and qtable.txt:**They give the extinction, absorption, scattering and phase-lag cross-sections and efficiencies respectively, for each calculated wavelength.**E_before.txt and H_before.txt:**They give the initial (incident) electric (E) and magnetic (H) fields exciting each dipole. 9 columns are presented: the first 3 columns give the cartesian components (x,y,z) of the dipole position, and then the 6 remaining pairs of numbers give the real and imaginary part of each cartesian component of the electric (E) and magnetic (H) field.**P_before.txt and M_before.txt:**The same as E_before.txt and H_before.txt but for the electric (P) and magnetic (M) induced dipoles.**E_after.txt, H_after.txt, P_after.txt and M_after.txt:**The same as their respectively "_before.txt" files but once the calculation is done (after convergence).**S_before.txt and S_after.txt:**They give the initial and final Poynting vector (3 components) respectively, at each lattice position.**theta90.txt, phi0.txt, phi90.txt and arb_plane.txt:**2 columns are presented here. The first column is the scattering angle (in degrees) and the second is the total far-field scattered intensity. theta90 corresponds to the X-Y plane, phi0 to the X-Z plane, phi90 to the Y-Z plane and arb_plane.txt to the arbitrary plane given in e-dda.par (theta and phi are those from the spherical coordinates).**Intensity_lambda.txt:**It gives the total far-field scattered intensity calculated at a given point, as a function of the incident wavelength. The coordinates of the point (where to calculate the intensity) must be entered (for the time being) directly in the code (it must be compiled again).**P_L_90.txt:**(experimental). It gives the linear polarization degree at right-angle scattering configuration if orto=yes in e-dda.par. However, the user must choose correctly the incident and the scattering direction in order to correctly calculate the linear polarization degree.

An example compilation file is given, called compile_e-dda.sh. The user should change gfortran to whatever Fortran compiler he/she uses. By now, only GFortran and Intel Fortran Compiler have been tested.

Simply enter:

**sh compile_e-dda.sh**

in your Terminal.

Once the code is compiled in its original folder (src), the user should have 4 files in the parent directory, namely:

**e-dda:**executable.**e-dda.par****diel1.tab:**describing a material with epsilon_r=2 (real and scalar) and mu_r=1 (the identity tensor).**shape.dat:**describing an sphere of radius R=6nm.

All you need to do is enter, in Terminal:

**./e-dda**

and wait until the calculation is finished.