manifolds-0.4.0.0: Coordinate-free hypersurfaces

Copyright (c) Justus Sagemüller 2015 GPL v3 (@) sagemueller \$ geo.uni-koeln.de experimental portable None Haskell2010

Data.Manifold.Types

Description

Several commonly-used manifolds, represented in some simple way as Haskell data types. All these are in the PseudoAffine class.

Synopsis

Linear manifolds

data ZeroDim s :: * -> *

Constructors

 Origin

Instances

 Source (Fractional' s, SemiInner s) => SemiInner (ZeroDim s) Num' s => FiniteDimensional (ZeroDim s) Num' s => TensorSpace (ZeroDim s) Num' s => LinearSpace (ZeroDim s) Atlas (ZeroDim s) Source Source NumberManifold s => LocallyCoercible (V0 s) (ZeroDim s) Source NumberManifold s => LocallyCoercible (ZeroDim s) (V0 s) Source NumberManifold s => LocallyCoercible (ZeroDim s) (ZeroDim s) Source type Scalar (ZeroDim s) = s type Basis (ZeroDim k) = Void type Diff (ZeroDim s) = ZeroDim s data SubBasis (ZeroDim s) = ZeroBasis type DualVector (ZeroDim s) = ZeroDim s type Interior (ZeroDim k) = ZeroDim k type Needle (ZeroDim k) = ZeroDim k type ChartIndex (ZeroDim s) = () Source type TensorProduct (ZeroDim s) v = ZeroDim s

type = Double

Hyperspheres

General form: Stiefel manifolds

newtype Stiefel1 v Source

Constructors

 Stiefel1 FieldsgetStiefel1N :: DualVector v

Instances

 Source type Interior (Stiefel1 v) = Stiefel1 v type Needle (Stiefel1 v)

Arguments

 :: LinearManifold v => DualVector v Must be nonzero. -> Stiefel1 v

Specific examples

class (PseudoAffine v, InnerSpace v, NaturallyEmbedded (UnitSphere v) (DualVector v)) => HasUnitSphere v where Source

Minimal complete definition

Nothing

Associated Types

type UnitSphere v :: * Source

Methods

Instances

 Source Source Source

data S⁰ :: *

The zero-dimensional sphere is actually just two points. Implementation might therefore change to ℝ⁰ + ℝ⁰: the disjoint sum of two single-point spaces.

Constructors

 PositiveHalfSphere NegativeHalfSphere

Instances

 Source Source type Interior S⁰ = S⁰ type Needle S⁰ = ZeroDim ℝ type ChartIndex S⁰ = S⁰ Source

newtype :: *

The unit circle.

Constructors

 S¹ FieldsφParamS¹ :: DoubleMust be in range [-π, π[.

Instances

 Source Source type Interior S¹ = S¹ type Needle S¹ = ℝ type ChartIndex S¹ = S⁰ Source

data Source

The ordinary unit sphere.

Constructors

 S² FieldsϑParamS² :: !DoubleRange [0, π[.φParamS² :: !DoubleRange [-π, π[.

Instances

 Source Source type Interior S² = S² type Needle S² = ℝ² type ChartIndex S² = S⁰ Source

Projective spaces

type ℝP¹ =

data ℝP² Source

The two-dimensional real projective space, implemented as a unit disk with opposing points on the rim glued together.

Constructors

 ℝP² FieldsrParamℝP² :: !DoubleRange [0, 1].φParamℝP² :: !DoubleRange [-π, π[.

Instances

 Source type Interior ℝP² = ℝP² type Needle ℝP² = ℝ²

Intervals/disks/cones

newtype :: *

The “one-dimensional disk” – really just the line segment between the two points -1 and 1 of 'S⁰', i.e. this is simply a closed interval.

Constructors

 D¹ FieldsxParamD¹ :: DoubleRange [-1, 1].

Instances

 Source type Interior D¹ = ℝ type Needle D¹ = ℝ

data Source

The standard, closed unit disk. Homeomorphic to the cone over 'S¹', but not in the the obvious, “flat” way. (And not at all, despite the identical ADT definition, to the projective space 'ℝP²'!)

Constructors

 D² FieldsrParamD² :: !DoubleRange [0, 1].φParamD² :: !DoubleRange [-π, π[.

Instances

 Source

type ℝay = Cℝay ℝ⁰ Source

Better known as ℝ⁺ (which is not a legal Haskell name), the ray of positive numbers (including zero, i.e. closed on one end).

data CD¹ x Source

A (closed) cone over a space x is the product of x with the closed interval 'D¹' of “heights”, except on its “tip”: here, x is smashed to a single point.

This construct becomes (homeomorphic-to-) an actual geometric cone (and to 'D²') in the special case x = 'S¹'.

Constructors

 CD¹ FieldshParamCD¹ :: !DoubleRange [0, 1]pParamCD¹ :: !xIrrelevant at h = 0.

Instances

 Show x => Show (CD¹ x) Source type Interior (CD¹ m) type Needle (CD¹ m)

data Cℝay x Source

An open cone is homeomorphic to a closed cone without the “lid”, i.e. without the “last copy” of x, at the far end of the height interval. Since that means the height does not include its supremum, it is actually more natural to express it as the entire real ray, hence the name.

Constructors

 Cℝay FieldshParamCℝay :: !DoubleRange [0, ∞[pParamCℝay :: !xIrrelevant at h = 0.

Instances

 Show x => Show (Cℝay x) Source type Interior (Cℝay m) type Needle (Cℝay m)

Affine subspaces

Lines

data Line x Source

Constructors

 Line FieldslineHandle :: x lineDirection :: Stiefel1 (Needle' x)

Hyperplanes

data Cutplane x Source

Oriented hyperplanes, naïvely generalised to PseudoAffine manifolds: Cutplane p w represents the set of all points q such that (q.-~.p) ^<.> w ≡ 0.

In vector spaces this is indeed a hyperplane; for general manifolds it should behave locally as a plane, globally as an (n−1)-dimensional submanifold.

Constructors

 Cutplane FieldssawHandle :: x cutNormal :: Stiefel1 (Needle x)

Arguments

 :: (WithField ℝ PseudoAffine x, LinearSpace (Needle x)) => Cutplane x Hyperplane to measure the distance from. -> Metric' x Metric to use for measuring that distance. This can only be accurate if the metric is valid both around the cut-plane's sawHandle, and around the points you measure. (Strictly speaking, we would need parallel transport to ensure this). -> x Point to measure the distance to. -> Maybe ℝ A signed number, giving the distance from plane to point with indication on which side the point lies. Nothing if the point isn't reachable from the plane.

Linear mappings

data LinearMap s v w :: * -> * -> * -> *

The tensor product between one space's dual space and another space is the space spanned by vector–dual-vector pairs, in bra-ket notation written as

m = ∑ |w⟩⟨v|

Any linear mapping can be written as such a (possibly infinite) sum. The TensorProduct data structure only stores the linear independent parts though; for simple finite-dimensional spaces this means e.g. LinearMap ℝ ℝ³ ℝ³ effectively boils down to an ordinary matrix type, namely an array of column-vectors |w⟩.

(The ⟨v| dual-vectors are then simply assumed to come from the canonical basis.)

For bigger spaces, the tensor product may be implemented in a more efficient sparse structure; this can be defined in the TensorSpace instance.

Instances

 Num' s => EnhancedCat (->) (LinearMap s) (Show (SubBasis (DualVector u)), Show (SubBasis v)) => Show (SubBasis (LinearMap s u v)) Num' s => Morphism (LinearMap s) Num' s => PreArrow (LinearMap s) Num' s => Cartesian (LinearMap s) Num' s => EnhancedCat (LinearMap s) (LinearFunction s) Num' s => EnhancedCat (LinearFunction s) (LinearMap s) (Num' s, LinearSpace v, (~) * (Scalar v) s) => Monoidal (LinearMap s v) (LinearFunction s) (LinearFunction s) (LinearSpace v, Num' s, (~) * (Scalar v) s) => Functor (LinearMap s v) (LinearFunction s) (LinearFunction s) (LinearSpace v, (~) * (Scalar v) s) => Functor (LinearMap s v) (Coercion *) (Coercion *) (LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => AdditiveGroup (LinearMap s v w) (LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => VectorSpace (LinearMap s v w) (LinearSpace u, TensorSpace v, (~) * s (Scalar u), (~) * s (Scalar v)) => AffineSpace (LinearMap s u v) (LinearSpace u, SemiInner (DualVector u), SemiInner v, (~) * (Scalar u) s, (~) * (Scalar v) s) => SemiInner (LinearMap s u v) (LSpace u, FiniteDimensional (DualVector u), FiniteDimensional v, (~) * (Scalar u) s, (~) * (Scalar v) s, (~) * (Scalar (DualVector v)) s, Fractional' (Scalar v)) => FiniteDimensional (LinearMap s u v) (LinearSpace u, TensorSpace v, (~) * (Scalar u) s, (~) * (Scalar v) s) => TensorSpace (LinearMap s u v) (LinearSpace u, LinearSpace v, (~) * (Scalar u) s, (~) * (Scalar v) s) => LinearSpace (LinearMap s u v) (LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => Semimanifold (LinearMap s v w) (LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => PseudoAffine (LinearMap s v w) (SimpleSpace a, SimpleSpace b, (~) * (Scalar a) ℝ, (~) * (Scalar b) ℝ, (~) * (Scalar (DualVector a)) ℝ, (~) * (Scalar (DualVector b)) ℝ, (~) * (Scalar (DualVector (DualVector a))) ℝ, (~) * (Scalar (DualVector (DualVector b))) ℝ) => Refinable (LinearMap ℝ a b) Source type UnitObject (LinearMap s) = ZeroDim s type Object (LinearMap s) v = (LinearSpace v, (~) * (Scalar v) s) type PairObjects (LinearMap s) a b = () type Scalar (LinearMap s v w) = s type Diff (LinearMap s u v) = LinearMap s u v data SubBasis (LinearMap s u v) = LinMapBasis !(SubBasis (DualVector u)) !(SubBasis v) type DualVector (LinearMap s u v) = Tensor s u (DualVector v) type Interior (LinearMap s v w) = LinearMap s v w type Needle (LinearMap s v w) = LinearMap s v w type TensorProduct (LinearMap s u v) w = TensorProduct (DualVector u) (Tensor s v w)