!ɳ)d      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc(C) 2017-2020 Nathan WaivioBSD3'Nathan Waivio <nathan.waivio@gmail.com>Stable unportableSafe%'27`1Fdcl3d8 Bounded Enum Algebraic Data Type of constructors of Cl3cl3Cl3 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. ; is the constructor for the Real Scalar Sub-algebra Grade-09 is the Three Dimensional Real Vector constructor Grade-1J is the Bivector constructor Grade-2 an Imaginary Three Dimensional VectorF is the Imaginary constructor Grade-3 and is the Pseudo-Scalar for APSe is the Paravector constructor with Grade-0 and Grade-1 elements, a Real Scalar plus Vector, (R + V3) is the Quaternion constructor it is the Even Sub-algebra with Grade-0 and Grade-2 elements, a Real Scalar plus Bivector, (R + BV) is the Complex constructor it is the Scalar Sub-algebra with Grade-0 and Grade-3 elements, a Real Scalar plus Imaginar Scalar, (R + I)j is the Biparavector constructor with Grade-1 and Grade-2 elements, a Real Vector plus Bivector, (V3 + BV) c is the Odd constructor with Grade-1 and Grade-3 elements, a Vector plus Imaginary Scalar, (V3 + I) h is the Triparavector constructor with Grade-2 and Grade-3 elements, a Bivector plus Imaginary, (BV + I) i is the constructor for an element in the Algebra of Physical Space with Grade-0 through Grade-3 elements cl3 N 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];KThis allows one to take advantage of the isomorphism between Cl3 and M(2,C)ecl3e< small helper function to calculate magnitude for PV and TPV cl3 C the littlest singular value. Useful for testing for invertability.fcl3f_ The Lower Discriminant for Paravectors and Triparavectors, real and imagninary portions of APScl3R 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') cliffgcl3g does a Cl(3,0) version of the decomposition into Jordan Normal Form and Matrix Function Calculation The intended use is for calculating functions for cliffors with vector parts simular to Nilpotent. It is a helper function for w. It is fortunate because eigen decomposition doesn't work with elements with nilpotent content, so it fills the gap.hcl3ht helper function for with specialization for real, imaginary, or complex eigenvalues. To specialize for Reals pass #, to specialize for Imaginary pass !, to specialize for Complex pass cl3u calculates the eignenvalues of the cliffor. This is useful for determining if a cliffor is the pole of a function.icl3i) helper function to calculate Eigenvaluescl3B makes a projector based off of the vector content of the Cliffor.jcl3j3 a single 3 dimensional vector grade to a projectorkcl3k calculates a boost that is perpendicular to both the vector and bivector components of the cliffor, that will mix the vector and bivector parts such that the vector and bivector parts become colinear. This function is a simularity transform such that: &cliffor = boost * colinear * bar boostUand returns the boost given the inputs. First the boost must be calculated and then &colinear = bar boost * cliffor * boostand colinear will have colinear vector and bivector parts of the cliffor. This is somewhat simular to finding the drift frame for a static electromagnetic field. v = toV3 cliffor -- extract the vector bv = mIx.toBV $ cliffor -- extract the bivector and turn it into a vector invariant = ((2*).mIx.toBV $ v * bv) / (toR (v^2) + toR (bv^2)) boost = spectraldcmpSpecial toR (exp.(/4).atanh) invariantlcl3l takes a Cliffor and determines if either the vector part or the bivector part are zero or both aligned in the same direction.cl3 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.mcl3m function returns complementary projectors and eigenvalues for a Cliffor with specialization. The Cliffor at this point is allready colinear and the Eigenvalue is known to be real, imaginary, or complex.cl3U function reduces the number of grades in a specialized Cliffor if they are zero-ishcl3 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.cl3# is a more effecient 'x -> I 1 * x'cl3 currently 128*epscl37 is a Clifford Conjugate, the vector grades are negatedcl3; is the Complex Conjugate, the imaginary grades are negatedcl3, takes any Cliffor and returns the R portioncl3- takes any Cliffor and returns the V3 portioncl3- takes any Cliffor and returns the BV portioncl3, takes any Cliffor and returns the I portioncl3- takes any Cliffor and returns the PV poritoncl3, takes any Cliffor and returns the H portioncl3, takes any Cliffor and returns the C portioncl3. takes any Cliffor and returns the BPV portion cl3 . takes any Cliffor and returns the ODD portion!cl3!. takes any Cliffor and returns the TPV portion"cl3". takes any Cliffor and returns the APS portion#cl3#C random Real Scalar (Grade 0) with random magnitude and random sign$cl3$T random Real Scalar (Grade 0) with random magnitude within a range and a random sign%cl3%q random Vector (Grade 1) with random magnitude and random direction the direction is using spherical coordinates&cl3&T random Vector (Grade 1) with random magnitude within a range and a random direction'cl3's random Bivector (Grade 2) with random magnitude and random direction the direction is using spherical coordinates(cl3(R random Bivector (Grade 2) with random magnitude in a range and a random direction)cl3)H random Imaginary Scalar (Grade 3) with random magnitude and random sign*cl3*W random Imaginary Scalar (Grade 3) with random magnitude within a range and random sign+cl3+@ random Paravector made from random Grade 0 and Grade 1 elements,cl3,O random Paravector made from random Grade 0 and Grade 1 elements within a range-cl3-@ random Quaternion made from random Grade 0 and Grade 2 elements.cl3.O random Quaternion made from random Grade 0 and Grade 2 elements within a range/cl3/* random combination of Grade 0 and Grade 30cl309 random combination of Grade 0 and Grade 3 within a range1cl31* random combination of Grade 1 and Grade 22cl329 random combination of Grade 1 and Grade 2 within a range3cl33* random combination of Grade 1 and Grade 34cl349 random combination of Grade 1 and Grade 3 within a range5cl35* random combination of Grade 2 and Grade 36cl369 random combination of Grade 2 and Grade 3 within a range7cl37# random combination of all 4 grades8cl382 random combination of all 4 grades within a range9cl39& a unit vector with a random direction:cl3:$ a projector with a random directionncl3n= a projector with a range of random magnitudes and directions;cl3;. a nilpotent element with a random orientationocl3o? a nilpotent with a range of random magnitudes and orientations<cl3<, a unitary element with a random orientationpcl3pi a unitary element with a range of random magnitudes and orientations, the exponential of a triparavector=cl3Cl3 instance of Storable uses the APS constructor as its standard interface. "peek" returns a cliffor constructed with APS. "poke" converts a cliffor to APS.>cl3Cl(3,0) has a Floating instance.?cl3!Cl(3,0) has a Fractional instance@cl3 Cl3 has a Num instance. Num+ is addition, geometric product, negation, q" the largest singular value, and r.Acl3Cl3 has a total preorder ordering in which all pairs are comparable by two real valued functions. Comparison of two reals is just the typical real compare function. Comparison of to imaginary numbers is just the typical comparison function. When reals are compared to anything else it will compare the absolute value of the reals to the magnitude of the other cliffor. Compare of two complex values compares the polar magnitude of the complex numbers. Compare of two vectors compares the vector magnitudes. The Ord instance for the general case is based on the singular values of each cliffor and this Ordering compares the largest singular value q& and then the littlest singular value  D. Some arbitrary cliffors may return EQ for Ord but not be exactly s equivalent, but they are related by a right and left multiplication of two unitary elements. For instance for the Cliffors A and B, A == B could be False, but compare A B is EQ, because A * V = U * B, where V and U are unitary. Bcl3*Cl(3,0) has the property of equivalence. Eq is True/ when all of the grade elements are equivalent.Dcl3t instance for the  library=  !"#$%&'()*+,-./0123456789:;<=   !" #$%&'()*+,-./0123456789:;<(C) 2018 Nathan WaivioBSD3'Nathan Waivio <nathan.waivio@gmail.com>Stable unportableSafe%]Kcl3K$ horizontally polarized Jones vectorLcl3L" vertically polarized Jones vectorMcl3M" diagonally polarized Jones vectorNcl3N' anti-diagonally polarized Jones vectorOcl3O- right hand circularly polarized Jones vectorPcl3P, left hand circularly polarized Jones vectorQcl3Qp function that returns Jones vector from input vector unit vector currently converts the input to a unit vectorRcl3R" Horizontal Polarizer Jones MatrixScl3S Vertical Polarizer Jones MatrixTcl3T Diagonal Polarizer Jones MatrixUcl3U% Anti-diagonal Polarizer Jones MatrixVcl3V+ Right Hand Circular Polarizer Jones MatrixWcl3W* Left Hand Circular Polarizer Jones MatrixXcl3Xo funciton that returns a Jones Matrix from an input Bloch Vector currently converts the input to a unit vectorucl3uS will produce a versor that rotates a vector by an angle about a unit vector axis.vcl3vv will produce a versor that rotates by double the input angle for rotating polarizers and wave plates the axis is e2.Ycl3Yp Jones matrix for a rotated ideal Linear Horizontal Polarizer. Input value should be a scalar angle in Radians.Zcl3Z Quarter Wave Plate Jones Matrix[cl3[[ Rotated Quarter Wave Plate Jones Matrix. Input value should be a scalar angle in Radians.\cl3\ Half Wave Plate Jones Matrix]cl3]X Rotated Half Wave Plate Jones Matrix. Input value should be a scalar angle in Radians.^cl3^e a Wave Plate with phase shift of phi Jones Matrix. Input value should be a scalar angle in Radians._cl3_ 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.`cl3` a Refelection Jones Matrixacl3a 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) * vecbcl3b a Random Jones Vector.ccl3c: a Random Orthogonal Complementary pair of Jones Vectors.KLMNOPQRSTUVWXYZ[\]^_`abcKLMNOPQRSTUVWXYZ\[]^_`bcaw      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxvwyz{|}~"cl3-2.0.0.0-KdlEyW58vmHKlQU4TTu9t0Algebra.Geometric.Cl3#Algebra.Geometric.Cl3.JonesCalculusSystemRandomCl3RV3BVIPVHCBPVODDTPVAPS showOctavelsv spectraldcmpeigvalsproject hasNilpotentreducemIxtimesItolbardagtoRtoV3toBVtoItoPVtoHtoCtoBPVtoODDtoTPVtoAPSrandRrangeRrandV3rangeV3randBVrangeBVrandIrangeIrandPVrangePVrandHrangeHrandCrangeCrandBPVrangeBPVrandODDrangeODDrandTPVrangeTPVrandAPSrangeAPS randUnitV3 randProjector randNilpotent randUnitary $fStorableCl3 $fFloatingCl3$fFractionalCl3$fNumCl3$fOrdCl3$fEqCl3 $fNFDataCl3 $fRandomCl3 $fShowCl3 $fReadCl3 $fDataCl3 $fGenericCl3$fBoundedConCl3 $fEnumConCl3hpvvpvdpvapvrpvlpvjvhpmvpmdpmapmrpmlpmjmhpmRotqwpqwpRothwphwpRotwpwpRotrefl factorize randJonesVecrandOrthogonalJonesVecConCl3reimMagloDiscjordanspectraldcmpSpecialeigvalsSpecialtriDProjboost2colinear isColinearprojEigsrangeProjectorrangeNilpotent rangeUnitarybaseGHC.Numabssignumghc-prim GHC.Classes==#random-1.2.0-LnDDzBF43Mx1KE2yrv9Wtf System.RandomrotrotIsh