| Copyright | (C) 2018 Nathan Waivio |
|---|---|
| License | BSD3 |
| Maintainer | Nathan Waivio <nathan.waivio@gmail.com> |
| Stability | Stable |
| Portability | unportable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Algebra.Geometric.Cl3
Contents
- The type for the Algebra of Physical Space
- Clifford Conjugate and Complex Conjugate
- The littlest singular value
- Constructor Selectors - For optimizing and simplifying calculations
- Pretty Printing for use with Octave
- Eliminate grades that are less than
tolto use a simpler Constructor - Random Instances
- Helpful Functions
Description
Library implementing standard functions for the Algebra of Physical Space Cl(3,0)
- data Cl3 where
- 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 :: Cl3 -> Cl3
- dag :: Cl3 -> Cl3
- lsv :: Cl3 -> Cl3
- toR :: Cl3 -> Cl3
- toV3 :: Cl3 -> Cl3
- toBV :: Cl3 -> Cl3
- toI :: Cl3 -> Cl3
- toPV :: Cl3 -> Cl3
- toH :: Cl3 -> Cl3
- toC :: Cl3 -> Cl3
- toBPV :: Cl3 -> Cl3
- toODD :: Cl3 -> Cl3
- toTPV :: Cl3 -> Cl3
- toAPS :: Cl3 -> Cl3
- showOctave :: Cl3 -> String
- reduce :: Cl3 -> Cl3
- tol :: Cl3
- randR :: RandomGen g => g -> (Cl3, g)
- rangeR :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randV3 :: RandomGen g => g -> (Cl3, g)
- rangeV3 :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randBV :: RandomGen g => g -> (Cl3, g)
- rangeBV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randI :: RandomGen g => g -> (Cl3, g)
- rangeI :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randPV :: RandomGen g => g -> (Cl3, g)
- rangePV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randH :: RandomGen g => g -> (Cl3, g)
- rangeH :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randC :: RandomGen g => g -> (Cl3, g)
- rangeC :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randBPV :: RandomGen g => g -> (Cl3, g)
- rangeBPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randODD :: RandomGen g => g -> (Cl3, g)
- rangeODD :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randTPV :: RandomGen g => g -> (Cl3, g)
- rangeTPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randAPS :: RandomGen g => g -> (Cl3, g)
- rangeAPS :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g)
- randUnitV3 :: RandomGen g => g -> (Cl3, g)
- randProjector :: RandomGen g => g -> (Cl3, g)
- randNilpotent :: RandomGen g => g -> (Cl3, g)
- eigvals :: Cl3 -> (Cl3, Cl3)
- hasNilpotent :: Cl3 -> Bool
- spectraldcmp :: (Cl3 -> Cl3) -> (Cl3 -> Cl3) -> Cl3 -> Cl3
- project :: Cl3 -> Cl3
The type for the Algebra of Physical Space
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 and live within the APS.
Ris the constructor for the Real Scalar Sub-algebra Grade-0V3is the Vector constructor Grade-1BVis the Bivector constructor Grade-2Iis the Imaginary constructor Grade-3 and is the Pseudo-Scalar for APSPVis the Paravector constructor with Grade-0 and Grade-1 elementsHis the Quaternion constructor it is the Even Sub-algebra with Grade-0 and Grade-2 elementsCis the Complex constructor it is the Scalar Sub-algebra with Grade-0 and Grade-3 elementsBPVis the Biparavector constructor with Grade-1 and Grade-2 elementsODDis the Odd constructor with Grade-1 and Grade-3 elementsTPVis the Triparavector constructor with Grade-2 and Grade-3 elementsAPSis the constructor for an element in the Algebra of Physical Space with Grade-0 through Grade-3 elements
Constructors
| 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 |
Instances
| Eq Cl3 Source # | Cl(3,0) has the property of equivalence. Eq is True when all of the grade elements are equivalent. |
| Floating Cl3 Source # | Cl(3,0) has a Floating instance. |
| Fractional Cl3 Source # | Cl(3,0) has a Fractional instance |
| Data Cl3 Source # | |
| Num Cl3 Source # | Cl3 has a Num instance. Num is addition, geometric product, negation, |
| Ord Cl3 Source # | Cl3 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. 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 |
| Read Cl3 Source # | |
| Show Cl3 Source # | |
| Generic Cl3 Source # | |
| Storable Cl3 Source # | Cl3 instance of Storable uses the APS constructor as its standard interface. "peek" returns a cliffor constructed with APS. "poke" converts a cliffor to APS. |
| Random Cl3 Source # | |
| type Rep Cl3 Source # | |
Clifford Conjugate and Complex Conjugate
The littlest singular value
Constructor Selectors - For optimizing and simplifying calculations
Pretty Printing for use with Octave
showOctave :: Cl3 -> String Source #
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)
Eliminate grades that are less than tol to use a simpler Constructor
reduce function reduces the number of grades in a specialized Cliffor if some are zero
Random Instances
randR :: RandomGen g => g -> (Cl3, g) Source #
randR random Real Scalar (Grade 0) with random magnitude and random sign
rangeR :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeR random Real Scalar (Grade 0) with random magnitude within a range and a random sign
randV3 :: RandomGen g => g -> (Cl3, g) Source #
randV3 random Vector (Grade 1) with random magnitude and random direction
the direction is using spherical coordinates
rangeV3 :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeV3 random Vector (Grade 1) with random magnitude within a range and a random direction
randBV :: RandomGen g => g -> (Cl3, g) Source #
randBV random Bivector (Grade 2) with random magnitude and random direction
the direction is using spherical coordinates
rangeBV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeBV random Bivector (Grade 2) with random magnitude in a range and a random direction
randI :: RandomGen g => g -> (Cl3, g) Source #
randI random Imaginary Scalar (Grade 3) with random magnitude and random sign
rangeI :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeI random Imaginary Scalar (Grade 3) with random magnitude within a range and random sign
randPV :: RandomGen g => g -> (Cl3, g) Source #
randPV random Paravector made from random Grade 0 and Grade 1 elements
rangePV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangePV random Paravector made from random Grade 0 and Grade 1 elements within a range
randH :: RandomGen g => g -> (Cl3, g) Source #
randH random Quaternion made from random Grade 0 and Grade 2 elements
rangeH :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeH random Quaternion made from random Grade 0 and Grade 2 elements within a range
rangeC :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeC random combination of Grade 0 and Grade 3 within a range
rangeBPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeBPV random combination of Grade 1 and Grade 2 within a range
rangeODD :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeODD random combination of Grade 1 and Grade 3 within a range
rangeTPV :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeTPV random combination of Grade 2 and Grade 3 within a range
rangeAPS :: RandomGen g => (Cl3, Cl3) -> g -> (Cl3, g) Source #
rangeAPS random combination of all 4 grades within a range
randUnitV3 :: RandomGen g => g -> (Cl3, g) Source #
randUnitV3 a unit vector with a random direction
randProjector :: RandomGen g => g -> (Cl3, g) Source #
randProjector a projector with a random direction
randNilpotent :: RandomGen g => g -> (Cl3, g) Source #
randNilpotent a nilpotent element with a random orientation
Helpful Functions
eigvals :: Cl3 -> (Cl3, Cl3) Source #
eigvals calculates the eignenvalues of the cliffor.
This is useful for determining if a cliffor is the pole
of a function.
hasNilpotent :: Cl3 -> Bool Source #
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.
spectraldcmp :: (Cl3 -> Cl3) -> (Cl3 -> Cl3) -> Cl3 -> Cl3 Source #
spectraldcmp the spectral decomposition of a function to calculate analytic functions of cliffors in Cl(3,0).
This function requires the desired function to be calculated and it'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