The Dipole class

Dipole is a variable class (not a handle class!).

Warning

Unlike handle classes, with a variable class, the methods do not modify the object itself. For instance, DI.moveTo('x',1e-6) does not affect DI. One should write DI = DI.moveTo('x',1e-6); or DI2 = DI.moveTo('x',1e-6);.

Properties

Public properties

name

type

default

description

mat

char

‘none’

nanoparticle material

r

double

0

nanoparticle radius

eps

double

complex permittivity of the material

n

double

complex refractive index of the material

p

double

electric dipolar moment

EE0

double

local electric field experienced by the dipole

x

double

0

x position of the dipole [m]

y

double

0

y position of the dipole [m]

z

double

r

z position of the dipole [m]

n_ext

double

refractive index of the surroundings

Read-only properties

name

type

dependence

description

lambda

double

wavelength of illumination

pos

(3,1) double

position vector [x,y,z]

alphaMie

complex

Mie complex polarizability

CextMie

double

Mie extinction cross section

CscaMie

Mie scattering cross section

CabsMie

double

Mie absprotion cross section

Constructor

Constructor

Synthax

% protoypes
obj = Dipole();
obj = Dipole(mat, radius);
obj = Dipole(mat, radius, z);
obj = Dipole(alpha, radius, z); % alpha is a scalar or a 3-vector
obj = Dipole(eps, radius, z);   % eps is a scalar or a 3-vector

% examples
obj = Dipole('Au', 20e-9);
obj = Dipole('SiO2', 50e-9, 200e-9);
obj = Dipole((-1.5 + 1i*3.5)*1e-21, 50e-9, 200e-9);
obj = Dipole(1.5^2, 50e-9, 200e-9);
obj = Dipole([1.5 1.3 1.3].^2, 50e-9, 200e-9);
Description

obj = Dipole() creates an empty Dipole object.


obj = Dipole(mat, radius) creates a Dipole object that corresponds to a nanosphere of radius radius and material mat.


obj = Dipole(mat, radius, z) creates a Dipole object that corresponds to a nanosphere of radius radius and material mat, shifted to the position z along the \(z\) axis.


obj = Dipole(alpha, radius, z) creates a Dipole object that corresponds to a nanosphere of radius radius and a polarizability alpha, shifted to the position z along the \(z\) axis. The radius is ignored in the simulations when directly specifying alpha this way. alpha can be a 3-vector, represented the polarizabilities along the x, y, and z directions of space, in the case of an anisotropic dipole.


obj = Dipole(eps, radius, z) creates a Dipole object that corresponds to a nanosphere of radius radius and a permittivity alpha, shifted to the position z along the \(z\) axis. The radius is ignored in the simulations when directly specifying the permittivity this way. alpha can be a 3-vector, representing the three permittivities along the x, y, and z directions of space, in the case of a birefringent material.

The class makes the distinction between the permittivity and the polarizability thanks to the different ranges of values (on the order of 1e-21 in the case of polarisabilities, and on the order of 1 in the case of relative permittivities.)

Dipole methods

figure
Display the dipoles.

Synthax

objList.figure()

Description

Display the geometry of a system of nanoparticles, defined by a Dipole vector objList. For instance:

% creation of a ring of nanoparticles
radius = 550e-9;  % Nanoparticle radius
DI0 = Dipole('Au',radius);

DI = repmat(DI0,12,1);

R=3e-6;           % radius of the ring

% creation of a ring of dipoles
for ii=1:12
    DI(ii)=DI(ii).moveTo('x',R*cos(2*pi*ii/12),'y',R*sin(2*pi*ii/12));
end

DI.figure
../_images/NPring.png
matList
Return the list of available materials.

Synthax

obj.matList()
val = obj.matList();

Description

obj.matList() displays the list of available materials in the command window.

val = obj.matList(); returns a cell vector of available materials.

This list represents the possible input arguments for the mat value of the constructor:

>> DI.matList
    Ag
    Ag_Palik
    Al_rakic
    Au
    Au_Guler
    BK7
    Co
    Cr
    Cu
    Cu_Palik
    Fe
    Hg
    In
    Mg
    Mn
    Mo
    Nb
    Ni
    Pd
    Pt
    Rh
    Ta
    Ti
    TiN
    TiN800_Guler
    TiN_Guler
    TiO2
    V
    W
    ZnO
    ZrN
    graphene

Each item represents a material. Each line corresponds to a file, containing the data, and stored in the spec/materials folder.

If other materials are being used, new custom files can be made, following a specific format: the file must be an ASCII file, containing 3 columns, the first for the energies in eV, the second for the real part of the refractive index, and the third for the imaginary part of the refractive index. Any new file can be saved in the spec/materials folder, or in any other folder known by Matlab. However, in order to simply keep track of the updated versions of PhaseLAB via Github, I suggest to store any custom-made file to a separate folder, out of the PhaseLAB package, and include this directory in the Matlab paths. Also, feel free to contact me to ask for any file addition/modification in the public Github version of PhaseLAB that would suit your studies.

MieTheory
Return the polarisability and cross sections.

Synthax

val = obj.MieTheory();
valList = objList.MieTheory();

Description

Returns a (list of) NPprop object(s) that contains the properties of the nanoparticles, namely the complex optical polarisability and the three cross sections.

Warning

The dipole must be illuminated before using this method, using obj.shine().

>> DI.shine()
>> DI.MieTheory()

ans =

NPprop with properties:

    alpha: -7.0163e-22 + 4.1500e-21i
    Cext: 3.9468e-14
    Csca: 1.8666e-14
    Cabs: 2.0802e-14
moveBy
move the dipole by a given vector.

Synthax

% general pattern
obj2 = obj.moveBy([x, y, z]);
obj2 = obj.moveBy(x, y, z)
obj2 = obj.moveBy(Name, Value);

% examples
obj2 = obj.moveBy([0.1, 0.3, 0]*1e-6);  % moves the dipoles by 0.1 and 0.3 µm in the x and y directions
obj2 = obj.moveBy(0.1e-6, 0.3e-6, 0);  % moves the dipoles by 0.1 and 0.3 µm in the x and y directions
obj2 = obj.moveBy('x', 1e-6);  % moves the dipoles by 1 µm in the x direction
obj2 = obj.moveBy('x', 1e-6, 'y', 1e-6);  % moves the dipoles by 1 µm in both x and y directions
obj2 = obj.moveBy('z' = -1e-6, 'y', 0.5-6, 'x', 3e-6);  % moves the dipole in the three directions by specific distances

Description

Move the dipole by specific amounts along the \(x\), \(y\), and \(z\) directions. The motion is relative to the original position. To move the dipole to absolute positions, rather use the moveTo method.

The arguments can be either the 3 shifts in \(x\), \(y\), and \(z\) directions; or a 3-vector of these positions; or a Name-Value structure where the Names are 'x', 'y', and/or 'z', in any order.

moveTo
move the dipole to aa given position.

Synthax

% general pattern
obj2 = obj.moveTo([x, y, z]);
obj2 = obj.moveTo(x, y, z);
obj2 = obj.moveTo(Name, Value);

% examples
obj2 = obj.moveTo([0.1, 0.3, 0]*1e-6);  % moves the dipoles to the coordinates [0.1, 0.3, 0] µm.
obj2 = obj.moveTo(0.1e-6, 0.3e-6, 0);  % moves the dipoles to the coordinates [0.1, 0.3, 0] µm.
obj2 = obj.moveTo('x', 1e-6);  % change the *x*-coordinate to 1 µm
obj2 = obj.moveTo('x', 1e-6, 'y', 1e-6);  % change the (x, y)-coordinate to [1, 1] µm.
obj2 = obj.moveTo('z' = -1e-6, 'y', 0.5-6, 'x', 3e-6);  % moves the dipoles to the coordinates [-1, 0.5 3] µm.

Description

Move the dipole to a specific position in 3D. The motion is absolute, not relative to the original position. For a relative shift of the position, use the moveBy method.

The arguments can be either the 3 shifts in \(x\), \(y\), and \(z\) directions; or a 3-vector of these positions; or a Name-Value structure where the Names are 'x', 'y', and/or 'z', in any order.

shine
Illuminate a dipole.

Synthax

% general pattern
obj2 = obj.shine(IL);
objList2 = objList.shine(IL);

Description

The shine method runs a DDA numerical simulation of the electromgnetic field generated inside a dipole, or inside a set of dipoles (Dipole vector). In the latter case, the interaction between the dipoles is taken into account. The presence of a substrate is also taken into account. This method provides values to all the missing properties, namely:

  • p, the electric dipolar moment of the object(s),

  • EE0, the local electric field vector of the incident illumination at the location of the dipole(s).

  • n_ext the refractive index of the surroundings

Warning

Dipole is not a handle class. An output argument must be returned when using the shine method, otherwise the object is not modified.

+
Defines the addition between two Dipole objects: DI1 + DI2.

Synthax

obj = plus(obj1, obj2);
obj = obj1 + obj2;
obj = obj1 + obj2 + ... + objN;

Description

The method overloads the operator + by defining the method plus. It simply creates a Dipole 2-vector with the two input: obj = [obj1,  obj2];. Once they are assembled this way, the dipoles are considered as coupled for any further DDA computation using The imaging function.


The method also work with several additions at a time: obj = obj1 + obj2 + ... + objN;