Giter Site home page Giter Site logo

Comments (6)

jeanluct avatar jeanluct commented on July 27, 2024

From Jean-Luc Thiffeault on 2014-02-15 21:53:53+00:00

Here's Mathematica code that generates the matrices of the representation:

#!mathematica

LawrenceKrammerRepresentation[n_,t_,q_] := Module[
    {nn = n(n-1)/2, b, v, sig},

    v = Flatten[Table[{j, k}, {j, 1, n-1}, {k, j+1, n}], 1];

    sig[i_, {j_, k_}, {j_, k_}] := 1 /; i != j - 1 && i != j && i != k - 1 && i != k;
    sig[i_, {j_, k_}, {i_, k_}] := q /; i == j - 1;
    sig[i_, {j_, k_}, {i_, j_}] := (q^2 - q) /; i == j - 1;
    sig[i_, {j_, k_}, {j_, k_}] := (1 - q) /; i == j - 1;
    sig[i_, {j_, k_}, {l_, k_}] := 1 /; i == j && j != k - 1 && l == j + 1;
    sig[i_, {j_, k_}, {j_, i_}] := q /; i == k - 1 && k - 1 != j;
    sig[i_, {j_, k_}, {j_, k_}] := (1 - q) /; i == k - 1 && k - 1 != j;
    sig[i_, {j_, k_}, {i_, k_}] := -(q^2 - q) t /; i == k - 1 && k - 1 != j;
    sig[i_, {j_, k_}, {j_, l_}] := 1 /; i == k && l == k + 1;
    sig[i_, {j_, k_}, {j_, k_}] := -t q^2 /; i == j && j == k - 1;
    sig[i_, {j1_, k1_}, {j2_, k2_}] := 0;

    If[n > 2,
        b = Table[sig[i, v[[j]], v[[k]]], {i, n-1}, {j,nn}, {k,nn}];
        Return[b]
    ,
        Return[{{{1}}}]
    ];
]

This works (checked it), but is a bit opaque. It might be hard to do the multiplication sparsely. I guess first implement it densely and figure out the sparsity, the way I did in braidrep.hpp?

from braidlab.

jeanluct avatar jeanluct commented on July 27, 2024

From Jean-Luc Thiffeault on 2014-02-15 22:06:51+00:00

Here's C++ code that also does it (from braidrep.hpp):

#!C++

template<class T>
void braidrep_dense_LawrenceKrammer<T>::fill_generators()
{
  if (n == 2)
    {
      Mgen[0](0,0) = -q*q*t;
      Mgeninv[0](0,0) = 1./Mgen[0](0,0);
    }
  else
    {
      // Make an index of the basis of the module.
      jlt::mathmatrix<int> v(n-1,n);
      int idx = 0;
      for (unsigned int j = 0; j < n-1; ++j)
        {
          for (unsigned int k = j+1; k < n; ++k)
            {
              v(j,k) = idx++;
            }
        }

      // Fill matrices with the Lawrence-Krammer representation.
      // Messy code, but it is easy to check that it works fine with
      // the check_representation() member function.
      for (unsigned int i = 0; i < n-1; ++i)
        {
          for (unsigned int j1 = 0; j1 < n-1; ++j1)
            {
              for (unsigned int k1 = j1+1; k1 < n; ++k1)
                {
                  for (unsigned int j2 = 0; j2 < n-1; ++j2)
                    {
                      for (unsigned int k2 = j2+1; k2 < n; ++k2)
                        {
                          std::complex<T> el;
                          if (j1 == j2 && k1 == k2 && i != j1-1 &&
                              i != j1 && i != k1 && i != k1-1)
                            {
                              el = 1.;
                            }
                          else if (i == j2 && k1 == k2 && i == j1-1)
                            {
                              el = q;
                            }
                          else if (j2 == i && k2 == j1 && i == j1-1)
                            {
                              el = q*(q-1.);
                            }
                          else if (j1 == j2 && k1 == k2 && i == j1-1)
                            {
                              el = 1.-q;
                            }
                          else if (k1 == k2 && i == j1 && 
                                   j1 != k1-1 && j2 == j1+1)
                            {
                              el = 1.;
                            }
                          else if (i == k2 && j1 == j2 &&
                                   i == k1-1 && j1 != k1-1)
                            {
                              el = q;
                            }
                          else if (i == k1-1 && j1 != k1-1 &&
                                   j1 == j2 && k1 == k2)
                            {
                              el = 1.-q;
                            }
                          else if (i == k1-1 && j1 != k1-1 &&
                                   i == j2 && k1 == k2)
                            {
                              el = -q*(q-1.)*t;
                            }
                          else if (j1 == j2 && i == k1 && k2 == k1+1)
                            {
                              el = 1.;
                            }
                          else if (j1 == j2 && k1 == k2 &&
                                   i == j1 && j1 == k1-1)
                            {
                              el = -t*q*q;
                            }
                          else
                            {
                              el = 0.;
                            }
                          Mgen[i](v(j1,k1),v(j2,k2)) = el;
                        }
                    }
                }
            }
          Mgeninv[i] = Mgen[i].inverse();
        }
    }
}

from braidlab.

jeanluct avatar jeanluct commented on July 27, 2024

From Jean-Luc Thiffeault on 2014-02-15 22:08:34+00:00

There is actually another obstacle to implementing this: even though laurpoly was used for the Burau representation, would need two-variables Laurent polynomial. Use symbolic toolbox? It's going to be slow...

from braidlab.

jeanluct avatar jeanluct commented on July 27, 2024

From Jean-Luc Thiffeault on 2014-02-16 22:30:10+00:00

Adapted Burau rep to the symbolic toolbox in df454d5e. It's slow, but could do the same for LK.

from braidlab.

jeanluct avatar jeanluct commented on July 27, 2024

Implemented in 9b6e11a on branch iss010-lk-rep.

from braidlab.

jeanluct avatar jeanluct commented on July 27, 2024

It works ok for now. Pretty slow.

from braidlab.

Related Issues (20)

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.