for README.rst

Example 1

In [1]:
from py_pol.jones_vector import Jones_vector
from py_pol.jones_matrix import Jones_matrix
from py_pol.utils import degrees
In [2]:
j0 = Jones_vector("j0")
j0.linear_light(angle=45*degrees)
Out[2]:
matrix([[0.70710678],
        [0.70710678]])
In [3]:
m0 = Jones_matrix("m0")
m0.diattenuator_linear( p1=0.75, p2=0.25, angle=45*degrees)
Out[3]:
matrix([[0.5 +0.j, 0.25+0.j],
        [0.25+0.j, 0.5 +0.j]])
In [4]:
m1 = Jones_matrix("m1")
m1.quarter_waveplate(angle=0 * degrees)
Out[4]:
matrix([[1.000000e+00+0.j, 0.000000e+00+0.j],
        [0.000000e+00+0.j, 6.123234e-17+1.j]])
In [5]:
j1=m1*m0*j0
print(j1)
m1 * m0 @45.00 deg * j0 = [(0.5303+0j); 0.5303j]'
In [6]:
print(j0,'\n')
print(j0.parameters)
j0 = [0.7071; 0.7071]' 

parameters of j0:
    intensity        : 1.000 arb.u
    alpha            : 45.000 deg
    delay            : 0.000 deg
    azimuth          : 45.000 deg
    ellipticity angle: 0.000 deg
    a, b             : 1.000  0.000
    phase            : 0.000 deg

In [7]:
print(j1,'\n')
print(j1.parameters)
m1 * m0 @45.00 deg * j0 = [(0.5303+0j); 0.5303j]' 

parameters of m1 * m0 @45.00 deg * j0:
    intensity        : 0.562 arb.u
    alpha            : 45.000 deg
    delay            : 90.000 deg
    azimuth          : 8.618 deg
    ellipticity angle: -45.000 deg
    a, b             : 0.530  0.530
    phase            : 0.000 deg

In [8]:
print(m0,'\n')
print(m0.parameters)
m0 @45.00 deg = 
      [+0.500, +0.250]
      [+0.250, +0.500] 

parameters of m0 @45.00 deg:
    is_homogeneous: True
    delay:          0.000ª
    diattenuation:  0.800

In [9]:
print(m1,'\n')
print(m1.parameters)
m1 = 
      [+1+0j, +0+0j]
      [+0+0j, +0+1j] 

parameters of m1:
    is_homogeneous: True
    delay:          90.000ª
    diattenuation:  0.000

Ejemplo 2

In [10]:
from py_pol.stokes import Stokes
from py_pol.mueller import Mueller
from py_pol.utils import degrees

j0 = Stokes("j0")
j0.linear_light(angle=45*degrees)

m1 = Mueller("m1")
m1.diattenuator_linear(p1=1, p2=0, angle=0*degrees)

j1=m1*j0
In [11]:
i1=j0.parameters.intensity()
print("intensity = {:4.3f} arb. u.".format(i1))
intensity = 1.000 arb. u.
In [12]:
print(j0,'\n')
print(j0.parameters)
j0 = [ +1;  +0;  +1;  +0]
 

parameters of j0:
    intensity             : 1.000 arb. u.
    amplitudes            : E0x 0.707, E0y 0.707, E0_unpol 0.000 
    degree polarization   : 1.000
    degree linear pol.    : 1.000
    degree   circular pol.: 0.000
    alpha                 : 45.000 deg
    delay                 : 0.000 deg
    azimuth               : 45.000 deg
    ellipticity  angle    : 0.000 deg
    ellipticity  param    : 0.000
    eccentricity          : 1.000
    polarized vector      : [+1.000; +0.000; +1.000; +0.000]'
    unpolarized vector    : [+0.000; +0.000; +0.000; +0.000]'

In [13]:
print(j1,'\n')
print(j1.parameters)
m1 * j0 = [+0.500; +0.500; +0.000; +0.000]
 

parameters of m1 * j0:
    intensity             : 0.500 arb. u.
    amplitudes            : E0x 0.707, E0y 0.000, E0_unpol 0.000 
    degree polarization   : 1.000
    degree linear pol.    : 1.000
    degree   circular pol.: 0.000
    alpha                 : 0.000 deg
    delay                 : 0.000 deg
    azimuth               : 0.000 deg
    ellipticity  angle    : 0.000 deg
    ellipticity  param    : 0.000
    eccentricity          : 1.000
    polarized vector      : [+0.500; +0.500; +0.000; +0.000]'
    unpolarized vector    : [+0.000; +0.000; +0.000; +0.000]'

In [14]:
print(m1,'\n')
print(m1.parameters)
m1 = 
  [+0.5000, +0.5000, +0.0000, +0.0000]
  [+0.5000, +0.5000, +0.0000, +0.0000]
  [+0.0000, +0.0000, +0.0000, +0.0000]
  [+0.0000, +0.0000, +0.0000, +0.0000]
 

Parameters of m1:
    Transmissions:
        - Mean                  : 50.0 %.
        - Maximum               : 100.0 %.
        - Minimum               : 0.0 %.
    Diattenuation:
        - Total                 : 1.000.
        - Linear                : 1.000.
        - Circular              : 0.000.
    Polarizance:
        - Total                 : 1.000.
        - Linear                : 1.000.
        - Circular              : 0.000.
    Spheric purity              : 0.577.
    Retardance                  : 1.571.
    Polarimetric purity         : 1.000.
    Depolarization degree       : 0.000.
    Depolarization factors:
        - Euclidean distance    : 1.732.
        - Depolarization factor : 0.000.
    Polarimetric purity indices:
        - P1                    : 1.000.
        - P2                    : 1.000.
        - P3                    : 1.000.

In [15]:
print(j1)
print(j1.parameters)
m1 * j0 = [+0.500; +0.500; +0.000; +0.000]

parameters of m1 * j0:
    intensity             : 0.500 arb. u.
    amplitudes            : E0x 0.707, E0y 0.000, E0_unpol 0.000 
    degree polarization   : 1.000
    degree linear pol.    : 1.000
    degree   circular pol.: 0.000
    alpha                 : 0.000 deg
    delay                 : 0.000 deg
    azimuth               : 0.000 deg
    ellipticity  angle    : 0.000 deg
    ellipticity  param    : 0.000
    eccentricity          : 1.000
    polarized vector      : [+0.500; +0.500; +0.000; +0.000]'
    unpolarized vector    : [+0.000; +0.000; +0.000; +0.000]'