-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Clifford Algebra of three dimensional space. -- -- Haskell Library implementing standard functions for the Algebra of -- Physical Space Cl(3,0) @package cl3 @version 3.0.0.0 -- | Library implementing standard functions for the Algebra of Physical -- Space Cl(3,0) module Algebra.Geometric.Cl3 -- | Cl3 provides specialized constructors for sub-algebras and other -- geometric objects contained in the algebra. Cl(3,0), abbreviated to -- Cl3, is a Geometric Algebra of 3 dimensional space known as the -- Algebra of Physical Space (APS). Geometric Algebras are Real Clifford -- Algebras, double precision floats are used to approximate real numbers -- in this library. Single and Double grade combinations are specialized -- using algebraic datatypes and live within the APS. -- -- data Cl3 [R] :: !Double -> Cl3 [V3] :: !Double -> !Double -> !Double -> Cl3 [BV] :: !Double -> !Double -> !Double -> Cl3 [I] :: !Double -> Cl3 [PV] :: !Double -> !Double -> !Double -> !Double -> Cl3 [H] :: !Double -> !Double -> !Double -> !Double -> Cl3 [C] :: !Double -> !Double -> Cl3 [BPV] :: !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> Cl3 [ODD] :: !Double -> !Double -> !Double -> !Double -> Cl3 [TPV] :: !Double -> !Double -> !Double -> !Double -> Cl3 [APS] :: !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> !Double -> Cl3 -- | bar is a Clifford Conjugate, the vector grades are negated bar :: Cl3 -> Cl3 -- | dag is the Complex Conjugate, the imaginary grades are negated dag :: Cl3 -> Cl3 -- | lsv the littlest singular value. Useful for testing for -- invertability. lsv :: Cl3 -> Cl3 -- | toR takes any Cliffor and returns the R portion toR :: Cl3 -> Cl3 -- | toV3 takes any Cliffor and returns the V3 portion toV3 :: Cl3 -> Cl3 -- | toBV takes any Cliffor and returns the BV portion toBV :: Cl3 -> Cl3 -- | toI takes any Cliffor and returns the I portion toI :: Cl3 -> Cl3 -- | toPV takes any Cliffor and returns the PV poriton toPV :: Cl3 -> Cl3 -- | toH takes any Cliffor and returns the H portion toH :: Cl3 -> Cl3 -- | toC takes any Cliffor and returns the C portion toC :: Cl3 -> Cl3 -- | toBPV takes any Cliffor and returns the BPV portion toBPV :: Cl3 -> Cl3 -- | toODD takes any Cliffor and returns the ODD portion toODD :: Cl3 -> Cl3 -- | toTPV takes any Cliffor and returns the TPV portion toTPV :: Cl3 -> Cl3 -- | toAPS takes any Cliffor and returns the APS portion toAPS :: Cl3 -> Cl3 -- | showOctave for useful for debug purposes. The additional octave -- definition is needed: -- --
--   e0 = [1,0;0,1]; e1=[0,1;1,0]; e2=[0,-i;i,0]; e3=[1,0;0,-1];
--   
-- -- This allows one to take advantage of the isomorphism between Cl3 and -- M(2,C) showOctave :: Cl3 -> String -- | reduce function reduces the number of grades in a specialized -- Cliffor if they are zero-ish reduce :: Cl3 -> Cl3 -- | tol currently 128*eps tol :: Cl3 -- | Cl3_R a compact storable data type for R. data Cl3_R -- | toCl3_R converts a Cl3 value constructed with R to its compact -- form. toCl3_R :: Cl3 -> Cl3_R -- | fromCl3_R converts the compact Cl3_R type back to a Cl3 type. fromCl3_R :: Cl3_R -> Cl3 -- | Cl3_V3 a compact storable data type for V3. data Cl3_V3 -- | toCl3_V3 converts a Cl3 value constructed with V3 to its -- compact form. toCl3_V3 :: Cl3 -> Cl3_V3 -- | fromCl3_V3 converts the compact Cl3_V3 type back to a Cl3 type. fromCl3_V3 :: Cl3_V3 -> Cl3 -- | Cl3_BV a compact storable data type for BV. data Cl3_BV -- | toCl3_BV converts a Cl3 value constructed with BV to its -- compact form. toCl3_BV :: Cl3 -> Cl3_BV -- | fromCl3_BV converts the compact Cl3_BV type back to a Cl3 type. fromCl3_BV :: Cl3_BV -> Cl3 -- | Cl3_I a compact storable data type for I. data Cl3_I -- | toCl3_I converts a Cl3 value constructed with I to its compact -- form. toCl3_I :: Cl3 -> Cl3_I -- | fromCl3_I converts the compact Cl3_I type back to a Cl3 type. fromCl3_I :: Cl3_I -> Cl3 -- | Cl3_PV a compact storable data type for PV. data Cl3_PV -- | toCl3_PV converts a Cl3 value constructed with PV to its -- compact form. toCl3_PV :: Cl3 -> Cl3_PV -- | fromCl3_PV converts the compact Cl3_PV type back to a Cl3 type. fromCl3_PV :: Cl3_PV -> Cl3 -- | Cl3_H a compact storable data type for H. data Cl3_H -- | toCl3_H converts a Cl3 value constructed with H to its compact -- form. toCl3_H :: Cl3 -> Cl3_H -- | fromCl3_H converts the compact Cl3_H type back to a Cl3 type. fromCl3_H :: Cl3_H -> Cl3 -- | Cl3_C a compact storable data type for C. data Cl3_C -- | toCl3_C converts a Cl3 value constructed with C to its compact -- form. toCl3_C :: Cl3 -> Cl3_C -- | fromCl3_C converts the compact Cl3_C type back to a Cl3 type. fromCl3_C :: Cl3_C -> Cl3 -- | Cl3_BPV a compact storable data type for BPV. data Cl3_BPV -- | toCl3_BPV converts a Cl3 value constructed with BPV to its -- compact form. toCl3_BPV :: Cl3 -> Cl3_BPV -- | fromCl3_BPV converts the compact Cl3_BPV type back to a Cl3 -- type. fromCl3_BPV :: Cl3_BPV -> Cl3 -- | Cl3_ODD a compact storable data type for ODD. data Cl3_ODD -- | toCl3_ODD converts a Cl3 value constructed with ODD to its -- compact form. toCl3_ODD :: Cl3 -> Cl3_ODD -- | fromCl3_ODD converts the compact Cl3_ODD type back to a Cl3 -- type. fromCl3_ODD :: Cl3_ODD -> Cl3 -- | Cl3_TPV a compact storable data type for TPV. data Cl3_TPV -- | toCl3_TPV converts a Cl3 value constructed with TPV to its -- compact form. toCl3_TPV :: Cl3 -> Cl3_TPV -- | fromCl3_TPV converts the compact Cl3_TPV type back to a Cl3 -- type. fromCl3_TPV :: Cl3_TPV -> Cl3 -- | Cl3_APS a compact storable data type for APS. data Cl3_APS -- | toCl3_APS converts a Cl3 value constructed with APS to its -- compact form. toCl3_APS :: Cl3 -> Cl3_APS -- | fromCl3_APS converts the compact Cl3_APS type back to a Cl3 -- type. fromCl3_APS :: Cl3_APS -> Cl3 -- | randR random Real Scalar (Grade 0) with random magnitude and -- random sign randR :: RandomGen g => g -> (Cl3, g) -- | rangeR random Real Scalar (Grade 0) with random magnitude -- within a range and a random sign rangeR :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randV3 random Vector (Grade 1) with random magnitude and random -- direction the direction is using spherical coordinates randV3 :: RandomGen g => g -> (Cl3, g) -- | rangeV3 random Vector (Grade 1) with random magnitude within a -- range and a random direction rangeV3 :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randBV random Bivector (Grade 2) with random magnitude and -- random direction the direction is using spherical coordinates randBV :: RandomGen g => g -> (Cl3, g) -- | rangeBV random Bivector (Grade 2) with random magnitude in a -- range and a random direction rangeBV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randI random Imaginary Scalar (Grade 3) with random magnitude -- and random sign randI :: RandomGen g => g -> (Cl3, g) -- | rangeI random Imaginary Scalar (Grade 3) with random magnitude -- within a range and random sign rangeI :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randPV random Paravector made from random Grade 0 and Grade 1 -- elements randPV :: RandomGen g => g -> (Cl3, g) -- | rangePV random Paravector made from random Grade 0 and Grade 1 -- elements within a range rangePV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randH random Quaternion made from random Grade 0 and Grade 2 -- elements randH :: RandomGen g => g -> (Cl3, g) -- | rangeH random Quaternion made from random Grade 0 and Grade 2 -- elements within a range rangeH :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randC random combination of Grade 0 and Grade 3 randC :: RandomGen g => g -> (Cl3, g) -- | rangeC random combination of Grade 0 and Grade 3 within a range rangeC :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randBPV random combination of Grade 1 and Grade 2 randBPV :: RandomGen g => g -> (Cl3, g) -- | rangeBPV random combination of Grade 1 and Grade 2 within a -- range rangeBPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randODD random combination of Grade 1 and Grade 3 randODD :: RandomGen g => g -> (Cl3, g) -- | rangeODD random combination of Grade 1 and Grade 3 within a -- range rangeODD :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randTPV random combination of Grade 2 and Grade 3 randTPV :: RandomGen g => g -> (Cl3, g) -- | rangeTPV random combination of Grade 2 and Grade 3 within a -- range rangeTPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randAPS random combination of all 4 grades randAPS :: RandomGen g => g -> (Cl3, g) -- | rangeAPS random combination of all 4 grades within a range rangeAPS :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) -- | randUnitV3 a unit vector with a random direction randUnitV3 :: RandomGen g => g -> (Cl3, g) -- | randProjector a projector with a random direction randProjector :: RandomGen g => g -> (Cl3, g) -- | randNilpotent a nilpotent element with a random orientation randNilpotent :: RandomGen g => g -> (Cl3, g) -- | randUnitary a unitary element with a random orientation randUnitary :: RandomGen g => g -> (Cl3, g) -- | eigvals calculates the eignenvalues of the cliffor. This is -- useful for determining if a cliffor is the pole of a function. eigvals :: Cl3 -> (Cl3, Cl3) -- | hasNilpotent takes a Cliffor and determines if the vector part -- and the bivector part are orthoganl and equal in magnitude, i.e. that -- it is simular to a nilpotent BPV. hasNilpotent :: Cl3 -> Bool -- | spectraldcmp the spectral decomposition of a function to -- calculate analytic functions of cliffors in Cl(3,0). This function -- requires the desired function's R, I, and C instances to be calculated -- and the function's derivative. If multiple functions are being -- composed, its best to pass the composition of the funcitons to this -- function and the derivative to this function. Any function with a -- Taylor Series approximation should be able to be used. A real, -- imaginary, and complex version of the function to be decomposed must -- be provided and spectraldcmp will handle the case for an arbitrary -- Cliffor. -- -- It may be possible to add, in the future, a RULES pragma like: -- --
--   "spectral decomposition function composition"
--   forall f f' g g' cliff.
--   spectraldcmp f f' (spectraldcmp g g' cliff) = spectraldcmp (f.g) (f'.g') cliff
--   
spectraldcmp :: (Cl3 -> Cl3) -> (Cl3 -> Cl3) -> Cl3 -> Cl3 -- | project makes a projector based off of the vector content of -- the Cliffor. project :: Cl3 -> Cl3 -- | mIx a more effecient 'x -> I (-1) * x' typically useful for -- converting a Bivector to a Vector in the same direction. Related to -- Hodge Dual and/or Inverse Hodge Star. mIx :: Cl3 -> Cl3 -- | timesI is a more effecient 'x -> I 1 * x' timesI :: Cl3 -> Cl3 -- | abssignum is a more effecient 'cl3 -> (abs cl3, signum cl3)' -- So abs is always R and signum is the same type of -- constructor as the input signum is the element divided by its -- largest singular value abs abssignum :: Cl3 -> (Cl3, Cl3) instance GHC.Generics.Generic Algebra.Geometric.Cl3.Cl3 instance Data.Data.Data Algebra.Geometric.Cl3.Cl3 instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3 instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3 instance GHC.Enum.Enum Algebra.Geometric.Cl3.ConCl3 instance GHC.Enum.Bounded Algebra.Geometric.Cl3.ConCl3 instance System.Random.Random Algebra.Geometric.Cl3.Cl3 instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_APS instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_APS instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_APS instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_TPV instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_TPV instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_TPV instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_ODD instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_ODD instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_ODD instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_BPV instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_BPV instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_BPV instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_C instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_C instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_C instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_H instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_H instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_H instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_PV instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_PV instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_PV instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_I instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_I instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_I instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_BV instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_BV instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_BV instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_V3 instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_V3 instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_V3 instance GHC.Show.Show Algebra.Geometric.Cl3.Cl3_R instance GHC.Read.Read Algebra.Geometric.Cl3.Cl3_R instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3_R instance Control.DeepSeq.NFData Algebra.Geometric.Cl3.Cl3 instance GHC.Classes.Eq Algebra.Geometric.Cl3.Cl3 instance GHC.Classes.Ord Algebra.Geometric.Cl3.Cl3 instance GHC.Num.Num Algebra.Geometric.Cl3.Cl3 instance GHC.Real.Fractional Algebra.Geometric.Cl3.Cl3 instance GHC.Float.Floating Algebra.Geometric.Cl3.Cl3 instance Foreign.Storable.Storable Algebra.Geometric.Cl3.Cl3 -- | Library implementing standard functions for the Jones Calculus in the -- Cl3 Library. This implementation of the Jones Calculus is based on the -- convensions of SPIE's Field Guide to Polarization (ϕ = ω t − k z). -- -- -- --

Jones Vectors

-- -- Within the system of the Bloch Sphere, the Jones Vectors in Cl3 are -- calculated by generating the left ideal of the rotation of a unit -- vector to the e3 basis. Standard form for for a versor is 'rot -- = exp $ (-i/2) * theta * u' for angle theta and the -- rotational axis unit vector u. -- -- Bloch Sphere Coordinates: -- --
--      e3
--      |
--      |____e2
--     / 
--    /
--   e1
--   
module Algebra.Geometric.Cl3.JonesCalculus -- | hpv horizontally polarized Jones vector hpv :: Cl3 -- | vpv vertically polarized Jones vector vpv :: Cl3 -- | dpv diagonally polarized Jones vector dpv :: Cl3 -- | apv anti-diagonally polarized Jones vector apv :: Cl3 -- | rpv right hand circularly polarized Jones vector rpv :: Cl3 -- | lpv left hand circularly polarized Jones vector lpv :: Cl3 -- | jv function that returns Jones vector from input vector unit -- vector currently converts the input to a unit vector jv :: Cl3 -> Cl3 -- | hpm Horizontal Polarizer Jones Matrix hpm :: Cl3 -- | vpm Vertical Polarizer Jones Matrix vpm :: Cl3 -- | dpm Diagonal Polarizer Jones Matrix dpm :: Cl3 -- | apm Anti-diagonal Polarizer Jones Matrix apm :: Cl3 -- | rpm Right Hand Circular Polarizer Jones Matrix rpm :: Cl3 -- | lpm Left Hand Circular Polarizer Jones Matrix lpm :: Cl3 -- | jm funciton that returns a Jones Matrix from an input Bloch -- Vector currently converts the input to a unit vector jm :: Cl3 -> Cl3 -- | hpmRot Jones matrix for a rotated ideal Linear Horizontal -- Polarizer. Input value should be a scalar angle in Radians. hpmRot :: Cl3 -> Cl3 -- | qwp Quarter Wave Plate Jones Matrix qwp :: Cl3 -- | hwp Half Wave Plate Jones Matrix hwp :: Cl3 -- | qwpRot Rotated Quarter Wave Plate Jones Matrix. Input value -- should be a scalar angle in Radians. qwpRot :: Cl3 -> Cl3 -- | hwpRot Rotated Half Wave Plate Jones Matrix. Input value should -- be a scalar angle in Radians. hwpRot :: Cl3 -> Cl3 -- | wp a Wave Plate with phase shift of phi Jones Matrix. Input -- value should be a scalar angle in Radians. wp :: Cl3 -> Cl3 -- | wpRot a Rotated Wave Plate with phase shift of phi and rotation -- theta Jones Matrix. The first input value is phi the phase shift as a -- scalar value in Radians. The second input value is theta the rotation -- a scalar angle in Radians. wpRot :: Cl3 -> Cl3 -> Cl3 -- | refl a Refelection Jones Matrix refl :: Cl3 -- | randJonesVec a Random Jones Vector. randJonesVec :: RandomGen g => g -> (Cl3, g) -- | randOrthogonalJonesVec a Random Orthogonal Complementary pair -- of Jones Vectors. randOrthogonalJonesVec :: RandomGen g => g -> ((Cl3, Cl3), g) -- | factorize is a function that takes an Jones Vector after -- transformation by an optical chain, and returns the amplitude (amp), -- phase (phi), and normalized Jones Vector (vec), by the factorization -- of the input such that: amp * exp (i*phi/2) * vec factorize :: Cl3 -> (Cl3, Cl3, Cl3)