Coder Social home page Coder Social logo

rmanifolds's Introduction

rManifolds

SnapPy/Python module for creating random manifolds from knots and braids. Python package index: https://pypi.python.org/pypi/rManifolds.

Currently, there are only three variants supported:

  • Gaussian knots: uses independent normal distribution to simulate the deplacement in a stochastic processes than begins and ends in the same place.
  • Random uniform knots: generates a stochastic processes in which the position of the next vertex is selected uniformly from a fixed confined space.
  • Random braids: uses a discrete probability distribution in the generators of the braid group to create a random braid of a fixed number of strands. Currently, it always uses a uniform distribution on the generators, although general distributions will be added.

We know describe each of these methods.

from rManifolds import *

Gaussian knots

A gaussian random walk of variance sigma^2 is defined as a random walk in which the deplacements in each direction are independent and normally distribute with mean 0 and variance sigma^2. Given a fixed number of steps, this stochastic processes is conditioned so that the last point is the same as the departing point, obtaining a knot. The random walk is modeled in R^3 and then scaled to fit nicely into the SnapPy's standard grid of 500x500 inside the PLink editor.

This model of a random knot has found some applications for modeling protein molecules [1]. As the number of vertices goes to infinity, these knots usually turn out to be satellite knots due to the formation of clusters [2].

In [1]: n = 1000 
In [2]: obj = rGaussianKnot(n, filename='example1', sigma=1) 
A file 'example1.lnk' has been created in the current working directory.

The default value of sigma is 1 when it is not specified. If a filename is not specified then the .lnk object is not created. The filename could is allowed to be a simple string name, in which case the file is saved in the current working directory, or it could be a long directory address, in which case it is saved in the specified address. Once the object has been created, we can recover the manifold and the filename from the object. Methods for manifold classes are available.

In [3]: obj.filename
Out[3]: '/home/mauriciogtec/example1.lnk'
In [4]: obj.manifold
Out[4]: unnamed link(0,0)
In [5]: obj.manifold.homology()
Out[5]: Z
In [6]: obj.manifold.volume()
Out[6]: 1.0 E-05

The .lnk file created can be opened using the SnapPy interface and the Plink editor. The following image is an example of Gaussian knot with a 1000 vertices.

alt text

Random uniform knots

This is the simplest model of rando knot. Random points in a cube are generated and and joint to form a knot (the initial and the last point are joint together). A simple system of equation can be solved to create a planar diagram of the knot. Both the filename and the manifold can be recovered and manipulated as in the case of Gaussian knots.
In [1]: M = rUnifKnot(100)

Here is a screenshot of resulting knot:

alt text

Random braids

A different way of generating random manifolds is by specifying a probability distribution in the Braid group of n strands. In the current version a uniform distribution is given over the generators of the braid group. To create a Braid object one needs two parameters, one for the numbers of strands, and another one for the number of crossings in the link diagram. The result is sometimes a knot and sometimes a link. Recently, Ma [3] proved that as the length of the walk goes to infinity, the probability that the resulting link is hyperbolic goes to one.

From the created random braid one can recover the filename (when specified) and the manifold object as in the above examples (see Gaussian knots). For random braids, one can also ask for the number of link components.

In [1]: M = rBraid(n=5,k=40)
In [2]: M.num_components
Out[2]: 3
In [3]: M.manifold.homology()
Out[3]: Z + Z + Z
In [4]: M.manifold.volume()
Out[4]: 26.635490252

Here is a screenshot of a random braid:

alt text

References

[1] Diao et al. (1994). "On random knots". <em> Random knotting and linking </em>. World Scientific Publishing Co.

[2] Adams, C. (2004). "Hyperbolic knots". <em> Handbook of Knot theory </em>. http://arxiv.org/pdf/math/0309466.pdf

[3] Ma, J. (2014). "The closure of a random braid is a hyperbolic link". <em> Proceedings of the AMS </em> 142. pp. 695-701.

rmanifolds's People

Contributors

mauriciogtec avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.