geometry.manifolds package¶
Subpackages¶
- geometry.manifolds.tests package
- Submodules
- geometry.manifolds.tests.checks_generation module
- geometry.manifolds.tests.embedding_test module
- geometry.manifolds.tests.manifold_tests module
- geometry.manifolds.tests.matrix_groups_tests module
- geometry.manifolds.tests.pickling_tests module
- geometry.manifolds.tests.sphere_tests module
- Module contents
- geometry.manifolds.todo package
Submodules¶
geometry.manifolds.differentiable_manifold module¶
-
class
geometry.manifolds.differentiable_manifold.
DifferentiableManifold
(dimension)[source]¶ Bases:
object
This is the base class for differentiable manifolds.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs
(x)Raises an Exception if the point does not belong to this manifold. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. expmap
(bv)Computes the exponential map from base for the velocity vector v. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. logmap
(base, p)Computes the logarithmic map from base point base to target b. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects a vector bv in the ambient space to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. can_convert_to can_represent convert_to embeddable_in embedding isomorphism project_to relations_descriptions to_yaml -
assert_close
(a, b, atol=1e-08, msg=None)[source]¶ Asserts that two points on the manifold are close to the given tolerance.
-
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
belongs_ts
(bv)[source]¶ Checks that a vector vx belongs to the tangent space at the given point base.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
normalize
(a)[source]¶ Normalizes the coordinates to the canonical representation for this manifold. See TorusW.
-
project_ts
(bv)[source]¶ Projects a vector bv in the ambient space to the tangent space at point base.
-
-
class
geometry.manifolds.differentiable_manifold.
RandomManifold
(dimension)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
This is the base class for manifolds that have the ability to sample random points.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs
(x)Raises an Exception if the point does not belong to this manifold. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. expmap
(bv)Computes the exponential map from base for the velocity vector v. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. logmap
(base, p)Computes the logarithmic map from base point base to target b. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects a vector bv in the ambient space to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions sample_uniform
()Samples a random point in this manifold according to the Haar measure. sample_velocity
(a)Samples a random velocity with length 1 at the base point a tangent_bundle
()Returns the manifold corresponding to the tangent bundle. can_convert_to can_represent convert_to embeddable_in embedding isomorphism project_to relations_descriptions to_yaml
geometry.manifolds.embedding_relations module¶
geometry.manifolds.euclidean module¶
-
class
geometry.manifolds.euclidean.
Euclidean
(dimension)[source]¶ Bases:
geometry.manifolds.matrix_linear_space.MatrixLinearSpace
This is the usual Euclidean space of finite dimension; this is mostly used for debugging.
There is no proper Haar measure; as an arbitrary choice, the
sample_uniform()
returns a sample from a Gaussian distribution centered at 0.Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. norm
(v)Return the norm of a vector in the algebra. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. tangent_bundle
()Returns the manifold corresponding to the tangent bundle. zero
()Returns the zero element for this algebra. belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap interesting_points isomorphism logmap normalize project project_to project_ts relations_descriptions riemannian_mean sample_uniform to_yaml -
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
geometry.manifolds.exceptions module¶
geometry.manifolds.group module¶
geometry.manifolds.manifold_embedding_propagation module¶
geometry.manifolds.manifold_relations module¶
-
class
geometry.manifolds.manifold_relations.
ManifoldRelations
[source]¶ Bases:
object
Methods
set_embedding
(B, em)set_projection
(B, proj)all_embeddings all_isomorphisms all_projections exists_embedding exists_isomorphism exists_projection get_embedding get_isomorphism get_projection project relations_descriptions set_isomorphism
-
class
geometry.manifolds.manifold_relations.
Isomorphism
¶ Bases:
tuple
Attributes: Methods
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present. -
A
¶ Alias for field number 0
-
A_to_B
¶ Alias for field number 2
-
B
¶ Alias for field number 1
-
B_to_A
¶ Alias for field number 3
-
desc
¶ Alias for field number 6
-
steps
¶ Alias for field number 4
-
type
¶ Alias for field number 5
-
-
class
geometry.manifolds.manifold_relations.
Embedding
¶ Bases:
tuple
Attributes: Methods
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present. -
A
¶ Alias for field number 0
-
A_to_B
¶ Alias for field number 2
-
B
¶ Alias for field number 1
-
B_to_A
¶ Alias for field number 3
-
desc
¶ Alias for field number 6
-
steps
¶ Alias for field number 4
-
type
¶ Alias for field number 5
-
geometry.manifolds.matrix_lie_algebra module¶
-
class
geometry.manifolds.matrix_lie_algebra.
MatrixLieAlgebra
(n, dimension)[source]¶ Bases:
geometry.manifolds.matrix_linear_space.MatrixLinearSpace
This is the base class for Matrix Lie Algebra.
It is understood that it is composed by square matrices.
The only function that has to be implemented is the
project()
function that projects a square matrix onto the algebra. This function is used both for checking that a vector is in the algebra (seebelongs()
) and to mitigate the numerical errors.You probably also want to implement
norm()
if the default is not what you want.Methods
algebra_from_vector
(v)Isomorphism from elements of the algebra to vectors. assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. norm
(v)Return the norm of a vector in the algebra. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project
(v)Projects a vector onto this Lie Algebra. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. vector_from_algebra
(a)Isomorphism from elements of the algebra to vectors. zero
()Returns the zero element for this algebra. belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap isomorphism logmap project_to project_ts relations_descriptions to_yaml
geometry.manifolds.matrix_lie_group module¶
-
class
geometry.manifolds.matrix_lie_group.
MatrixLieGroup
(n, dimension, algebra)[source]¶ Bases:
geometry.manifolds.group.Group
,geometry.manifolds.differentiable_manifold.DifferentiableManifold
This is the base class for matrix Lie groups.
Subclasses should provide a MatrixLieAlgebra object. Given the Lie algebra, we can compute everything. However, subclasses can choose to overload some functions if they know a more numerically stable implementation.
Methods
algebra_from_group
(g)Converts an element of the group to the algebra. assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs
(x)Raises an Exception if the point does not belong to this manifold. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. expmap
(bv)This is the inverse of logmap_()
.friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_algebra
()Returns the interface to the corresponding Lie algebra. get_dimension
()Returns the intrinsic dimension of this manifold. group_from_algebra
(a)Converts an element of the algebra to the group. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. logmap
(base, p)Returns the direction from base to target. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects the vector x to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions velocity_from_points
(a, b[, delta])Find the velocity in local frame to go from a to b in delta time. belongs_algebra can_convert_to can_represent convert_to embeddable_in embedding identity inverse isomorphism multiply project_to relations_descriptions tangent_bundle to_yaml unity -
algebra_from_group
(g)[source]¶ Converts an element of the group to the algebra. Uses generic matrix logarithm plus projection.
-
distance
(a, b)[source]¶ Computes the distance between two points.
In the case of Lie groups, this is done by translating everything to the origin, computing the logmap, and using the norm defined in the Lie Algebra object.
-
expmap
(bv)[source]¶ This is the inverse of
logmap_()
.In the case of Lie groups, this is implemented using the usual matrix exponential.
Here the
MatrixLieAlgebra.project()
function is used to mitigate numerical errors.
-
group_from_algebra
(a)[source]¶ Converts an element of the algebra to the group.
Uses generic matrix exponential.
-
logmap
(base, p)[source]¶ Returns the direction from base to target.
In the case of Lie groups, this is implemented by using the usual matrix logarithm at the origin.
Here the
MatrixLieAlgebra.project()
function is used to mitigate numerical errors.
-
project_ts
(bv)[source]¶ Projects the vector x to the tangent space at point base.
In the case of Lie Groups, we do this by translating the vector to the origin, projecting it to the Lie Algebra, and then translating it back.
-
geometry.manifolds.matrix_lie_group_tangent module¶
-
class
geometry.manifolds.matrix_lie_group_tangent.
MatrixLieGroupTangent
(base_group)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
This class represents the tangent bundle of a matrix Lie group using a tuble (base, v0), where v0 is in the algebra.
Compare with the generic TangentBundle that uses the representation (base, vel) where vel is tangent at base (it holds that vel=base*v0).
(MatrixLieGroup has different representation)
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs belongs_ts can_convert_to can_represent convert_to distance embeddable_in embedding expmap interesting_points isomorphism logmap project_to project_ts relations_descriptions to_yaml -
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
belongs_ts
(bv)[source]¶ Checks that a vector vx belongs to the tangent space at the given point base.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
geometry.manifolds.matrix_linear_space module¶
-
class
geometry.manifolds.matrix_linear_space.
MatrixLinearSpace
(dimension, shape)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. norm
(v)Return the norm of a vector in the algebra. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project
(v)Projects a vector onto this Lie Algebra. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. zero
()Returns the zero element for this algebra. belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap isomorphism logmap project_to project_ts relations_descriptions to_yaml -
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
belongs_ts
(bv)[source]¶ Checks that a vector vx belongs to the tangent space at the given point base.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
norm
(v)[source]¶ Return the norm of a vector in the algebra. This is used in
MatrixLieGroup
to measure distances between points in the Lie group.
-
geometry.manifolds.point_set module¶
-
class
geometry.manifolds.point_set.
PointSet
(manifold, points=[])[source]¶ Bases:
object
A set of points on a differentiable manifold.
Methods
average
()Returns the average point centroid
()REturns the point which is closest to the average get_points
()returns an iterable add centroid_index closest_index_to distances_to_point is_closer_than minimum_distance
geometry.manifolds.product_manifold module¶
-
class
geometry.manifolds.product_manifold.
ProductManifold
(components, weights=None)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. interesting_points
()Returns a list of “interesting points” on this manifold that should be used for testing various properties. logmap
(base, p)Computes the logarithmic map from base point a to target b. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to embeddable_in embedding expmap isomorphism project_to project_ts relations_descriptions to_yaml -
belongs
(a)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
geometry.manifolds.special_euclidean_algebra module¶
-
class
geometry.manifolds.special_euclidean_algebra.
se_algebra
(N, alpha)[source]¶ Bases:
geometry.manifolds.matrix_lie_algebra.MatrixLieAlgebra
This is the Lie algebra se(n) for the Special Euclidean group SE(n).
Note that you have to supply a coefficient alpha that weights rotation and translation when defining distances.
Methods
algebra_from_vector
(v)Note that the first element is (omega, vx, vy) or (w1,w2,w3,vx,vy,vz) algebra_from_velocities
(avel, lvel)A convenience function that builds an element of the algebra from linear/angular velocities. assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. vector_from_algebra
(a)Note that it returns (omega, vx, vy) or (w1,w2,w3,vx,vy,vz) zero
()Returns the zero element for this algebra. algebra_from_velocities_2d belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap interesting_points isomorphism logmap norm project project_to project_ts relations_descriptions to_yaml -
algebra_from_vector
(v)[source]¶ Note that the first element is (omega, vx, vy) or (w1,w2,w3,vx,vy,vz)
-
algebra_from_velocities
(avel, lvel)[source]¶ A convenience function that builds an element of the algebra from linear/angular velocities.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
geometry.manifolds.special_euclidean_group module¶
-
class
geometry.manifolds.special_euclidean_group.
SE_group
(N)[source]¶ Bases:
geometry.manifolds.matrix_lie_group.MatrixLieGroup
This is the Special Euclidean group SE(n) describing roto-translations of Euclidean space. Implemented only for n=2,3.
Note that you have to supply a coefficient alpha that weights rotation and translation when defining distances.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the distance between two points. distances
(a, b)Returns linear, angular distance. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. expmap
(bv)This is the inverse of logmap_()
.from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_algebra
()Returns the interface to the corresponding Lie algebra. get_dimension
()Returns the intrinsic dimension of this manifold. group_from_algebra
(a)Converts an element of the algebra to the group. logmap
(base, p)Returns the direction from base to target. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects the vector x to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions velocity_from_points
(a, b[, delta])Find the velocity in local frame to go from a to b in delta time. algebra_from_group belongs belongs_algebra can_convert_to can_represent convert_to embeddable_in embedding friendly identity interesting_points inverse isomorphism multiply norm project_to relations_descriptions sample_uniform tangent_bundle to_yaml unity -
algebra_from_group
(g)[source]¶ Converts an element of the group to the algebra. Uses generic matrix logarithm plus projection.
-
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
group_from_algebra
(a)[source]¶ Converts an element of the algebra to the group.
Uses generic matrix exponential.
-
geometry.manifolds.special_orthogonal_algebra module¶
-
class
geometry.manifolds.special_orthogonal_algebra.
so_algebra
(n)[source]¶ Bases:
geometry.manifolds.matrix_lie_algebra.MatrixLieAlgebra
This is the Lie algebra of skew-symmetric matrices so(n), for the Special Orthogonal group SO(n).
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. norm
(v)Return the norm of a vector in the algebra. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project
(v)Projects v to the closest skew-symmetric matrix. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. zero
()Returns the zero element for this algebra. algebra_from_vector belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap interesting_points isomorphism logmap project_to project_ts relations_descriptions to_yaml vector_from_algebra -
algebra_from_vector
(v)[source]¶ Isomorphism from elements of the algebra to vectors. (For example, so(3) <==> R^3).
-
geometry.manifolds.special_orthogonal_group module¶
-
class
geometry.manifolds.special_orthogonal_group.
SO_group
(N)[source]¶ Bases:
geometry.manifolds.matrix_lie_group.MatrixLieGroup
This is the Special Orthogonal group SO(n) describing rotations of Euclidean space; implemented for n=2,3.
TODO: do SO2 and SO3 separately
Methods
algebra_from_group
(g)Converts an element of the group to the algebra. assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. expmap
(bv)This is the inverse of logmap_()
.from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_algebra
()Returns the interface to the corresponding Lie algebra. get_dimension
()Returns the intrinsic dimension of this manifold. group_from_algebra
(a)Converts an element of the algebra to the group. logmap
(base, p)Returns the direction from base to target. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects the vector x to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions velocity_from_points
(a, b[, delta])Find the velocity in local frame to go from a to b in delta time. belongs belongs_algebra can_convert_to can_represent convert_to embeddable_in embedding friendly identity interesting_points inverse isomorphism multiply project_to relations_descriptions sample_uniform tangent_bundle to_yaml unity -
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
geometry.manifolds.sphere module¶
-
class
geometry.manifolds.sphere.
Sphere
(order)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
These are hyperspheres of unit radius.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap project_to project_ts relations_descriptions sample_uniform to_yaml -
atol_geodesic_distance
= 1e-08¶
-
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
norm_rtol
= 1e-05¶
-
-
class
geometry.manifolds.sphere.
Sphere1
[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap project_to project_ts relations_descriptions sample_uniform to_yaml -
atol_geodesic_distance
= 1e-08¶
-
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
norm_rtol
= 1e-05¶
-
geometry.manifolds.square module¶
-
class
geometry.manifolds.square.
Square
(n)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.RandomManifold
A cube/square in [0, 1]. All points in R^n belong to the torus.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap project_to project_ts relations_descriptions sample_uniform sample_velocity to_yaml -
belongs
(a)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
project_ts
(bv)[source]¶ Projects a vector bv in the ambient space to the tangent space at point base.
-
geometry.manifolds.tangent_bundle module¶
-
class
geometry.manifolds.tangent_bundle.
TangentBundle
(base_manifold)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
This class represents the tangent bundle of a generic manifold using a tuple (base, vel) where vel is tangent at base.
(MatrixLieGroup has different representation)
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs belongs_ts can_convert_to can_represent convert_to distance embeddable_in embedding expmap interesting_points isomorphism logmap project_to project_ts relations_descriptions to_yaml -
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
belongs_ts
(bv)[source]¶ Checks that a vector vx belongs to the tangent space at the given point base.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
geometry.manifolds.torus module¶
-
class
geometry.manifolds.torus.
Torus
(n)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.DifferentiableManifold
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap normalize project_to project_ts relations_descriptions sample_uniform to_yaml -
belongs
(a)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
normalize
(a)[source]¶ Normalizes the coordinates to the canonical representation for this manifold. See TorusW.
-
geometry.manifolds.torus01 module¶
-
class
geometry.manifolds.torus01.
TorusW
(widths, normalize_bias=None)[source]¶ Bases:
geometry.manifolds.differentiable_manifold.RandomManifold
This is a torus whose coordinates wrap around in [0, W). All points in R^n belong to the torus.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap normalize project_to project_ts relations_descriptions sample_uniform sample_velocity to_yaml -
belongs
(a)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source]¶ Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
normalize
(a)[source]¶ Normalizes the coordinates to the canonical representation for this manifold. See TorusW.
-
project_ts
(bv)[source]¶ Projects a vector bv in the ambient space to the tangent space at point base.
-
-
class
geometry.manifolds.torus01.
TorusW
(widths, normalize_bias=None)[source] Bases:
geometry.manifolds.differentiable_manifold.RandomManifold
This is a torus whose coordinates wrap around in [0, W). All points in R^n belong to the torus.
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. belongs can_convert_to can_represent convert_to distance embeddable_in embedding expmap friendly interesting_points isomorphism logmap normalize project_to project_ts relations_descriptions sample_uniform sample_velocity to_yaml -
belongs
(a)[source] Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
distance
(a, b)[source] Computes the geodesic distance between two points.
-
expmap
(bv)[source] Computes the exponential map from base for the velocity vector v.
This function wraps some checks around
expmap_()
, which is implemented by the subclasses.
-
friendly
(a)[source] Returns a friendly description string for a point on the manifold.
-
interesting_points
()[source] Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
logmap
(base, p)[source] Computes the logarithmic map from base point base to target b. # XXX: what should we do in the case there is more than one logmap?
-
normalize
(a)[source] Normalizes the coordinates to the canonical representation for this manifold. See TorusW.
-
project_ts
(bv)[source] Projects a vector bv in the ambient space to the tangent space at point base.
-
sample_uniform
()[source] Samples a random point in this manifold according to the Haar measure. Raises exception if the measure is improper (e.g., R^n).
-
sample_velocity
(a)[source] Samples a random velocity with length 1 at the base point a
-
geometry.manifolds.translation_algebra module¶
-
class
geometry.manifolds.translation_algebra.
trana
(n)[source]¶ Bases:
geometry.manifolds.matrix_lie_algebra.MatrixLieAlgebra
lie algebra for translation
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. distance
(a, b)Computes the geodesic distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. friendly
(a)Returns a friendly description string for a point on the manifold. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. riemannian_mean
(points)TODO: work out exceptions tangent_bundle
()Returns the manifold corresponding to the tangent bundle. zero
()Returns the zero element for this algebra. algebra_from_vector belongs belongs_ts can_convert_to can_represent convert_to embeddable_in embedding expmap interesting_points isomorphism logmap norm project project_to project_ts relations_descriptions to_yaml vector_from_algebra -
algebra_from_vector
(v)[source]¶ Isomorphism from elements of the algebra to vectors. (For example, so(3) <==> R^3).
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-
geometry.manifolds.translation_group module¶
-
class
geometry.manifolds.translation_group.
TranG
(n)[source]¶ Bases:
geometry.manifolds.matrix_lie_group.MatrixLieGroup
The translation subgroup of SE(n).
Methods
assert_close
(a, b[, atol, msg])Asserts that two points on the manifold are close to the given tolerance. belongs_ts
(bv)Checks that a vector vx belongs to the tangent space at the given point base. distance
(a, b)Computes the distance between two points. embed_in
(M, my_point)Embeds a point on this manifold to the target manifold M. from_yaml
(yaml_structure)Recovers a value from a Yaml structure. geodesic
(a, b, t)Returns the point interpolated along the geodesic. get_algebra
()Returns the interface to the corresponding Lie algebra. get_dimension
()Returns the intrinsic dimension of this manifold. normalize
(a)Normalizes the coordinates to the canonical representation for this manifold. project_from
(M, his_point)Projects a point on a bigger manifold to this manifold. project_ts
(bv)Projects the vector x to the tangent space at point base. riemannian_mean
(points)TODO: work out exceptions velocity_from_points
(a, b[, delta])Find the velocity in local frame to go from a to b in delta time. algebra_from_group belongs belongs_algebra can_convert_to can_represent convert_to embeddable_in embedding expmap friendly group_from_algebra identity interesting_points inverse isomorphism logmap multiply project_to relations_descriptions sample_uniform tangent_bundle to_yaml unity -
algebra_from_group
(g)[source]¶ Converts an element of the group to the algebra. Uses generic matrix logarithm plus projection.
-
belongs
(x)[source]¶ Raises an Exception if the point does not belong to this manifold.
This function wraps some checks around
belongs_()
, which is implemented by the subclasses.
-
expmap
(bv)[source]¶ This is the inverse of
logmap_()
.In the case of Lie groups, this is implemented using the usual matrix exponential.
Here the
MatrixLieAlgebra.project()
function is used to mitigate numerical errors.
-
group_from_algebra
(a)[source]¶ Converts an element of the algebra to the group.
Uses generic matrix exponential.
-
interesting_points
()[source]¶ Returns a list of “interesting points” on this manifold that should be used for testing various properties.
-