nLab TwoVect

TwoVect: a Mathematica Package for 2-Vector Spaces


Higher algebra

Higher category theory

higher category theory

Basic concepts

Basic theorems





Universal constructions

Extra properties and structure

1-categorical presentations

TwoVect: a Mathematica Package for 2-Vector Spaces

What is TwoVect?

TwoVect is a Mathematica package for working with finite-dimensional complex semisimple 2-vector spaces. It implements all the basic operations of a skeletal version of 2Vect, the symmetric monoidal bicategory of finite-dimensional 2-vector spaces.

2-vector space are categories with many of the same properties as ordinary vector spaces. There are two main types of 2-vector spaces; the sort we are concerned with here are Kapranov-Voevodsky 2-vector spaces, closely related to the 2-Hilbert spaces of Baez. They have a range of applications in quantum algebra, representation theory, topological quantum field theory and quantum information. This package can help with calculations in these areas.

TwoVect was developed by Dan Roberts in 2011 as an MSc project, at the Quantum Group in the Department of Computer Science of the University of Oxford, supervised by Jamie Vicary. If you’ve got any questions, please get in touch.

How can I get it?

Here are download links for the packages and the user guide.

What’s it for?

The mathematics of 2-vector spaces is often referred to as higher linear algebra, and extends the ordinary linear algebra required for calculations involving traditional vector spaces. This higher linear algebra can be difficult to work with by hand: whereas ordinary linear algebra involves matrices of complex numbers, higher linear algebra involves matrices of matrices of complex numbers. And whereas ordinary matrices can be composed in two different ways, ordinary composition and tensor product, the theory of 2-vector spaces involves three types of composition: tensor product, horizontal composition and vertical composition.

While the underlying mathematics of 2-vector spaces is elegant and natural, the combinatorics of these basic operations can make calculations difficult to perform by hand. TwoVect implements the basic operations of higher linear algebra, and can make calculations a lot easier.

Here are some example uses for the package.

  • You’ve worked out the associator and unitors for a semisimple monoidal category, and you want to check the pentagon and triangle equations.

  • You’ve worked out other structure, like a braiding, symmetry or ribbon structure, and you want to check the defining equations are satisfied.

  • You want to use Mathematica’s built-in solvers to help find these structures.

  • You want to calculate the value of a string diagram in a semisimple monoidal category.

  • You want to check algebraic properties of a semisimple monoidal category. Does it have duals for objects? Is it modular?

  • You want to check the axioms are satisfied for an internal monoid object in a semisimple monoidal category, or you want Mathematica to help you find such an object.

  • You have chosen higher linear maps to associate to the generators of some higher algebraic structure, and want to check the relations are satisfied.

  • You want to verify correctness of a quantum protocol, described in terms of the 2-categorical approach to quantum information.

How does it work?

The basic package TwoVect implements a completely skeletal version of 2Vect, the symmetric monoidal bicategory of finite-dimensional semisimple complex 2-vector spaces, in the following way:

  • 2-vector spaces are represented by natural numbers.

  • Linear functors between 2-vector spaces are represented by matrices of natural numbers.

  • Natural transformations between linear functors are represented by matrices of matrices of complex numbers.

The three primitive composition operations of 2Vect are implemented:

  • Tensor product \odot is a binary operation for which the arguments can be 0-cells, 1-cells or 2-cells.

  • Horizontal composition \circ is a binary operation, for which the arguments must 1-cells or 2-cells.

  • Vertical composition \cdot is a binary operation for which the arguments must be 2-cells.

The nonidentity invertible structural 2-cells are also implemented, which account for weakness of horizontal composition and tensor product:

  • The interchanger: τ f,g,h,i:(fg)(hi)(fh)(gi)\tau_{f,g,h,i} : (f \circ g) \odot (h \circ i) \to (f \odot h) \circ (g \odot i)

  • The compositer: ω f,g,h:f(gh)(fg)h\omega_{f,g,h} : f \circ (g \circ h) \to (f \circ g) \circ h

  • The symmetrizer: σ f,g:swap(fg)(gf)swap\sigma_{f,g}: \mathrm{swap} \circ (f \odot g) \to (g \odot f) \circ \mathrm{swap}

There are also two add-on packages:

  • MTCategories provides implementations of the equations for symmetric or braided semisimple monoidal categories.

  • MTCategory provides a simplified syntax for working ‘inside’ a particular choice of monoidal category. Once this is defined, the value of string diagrams can be computed by typing them in using ordinary string diagram syntax.

How could this be developed?

There are several exciting ways this could evolve. If you want to help out, get in touch! Lots of things on this list would involve original research, and could form a part of a Masters or PhD dissertation.

  • A graphical front end would be a powerful addition. Compare to Quantomatic, a GUI for ordinary linear algebra.

  • Can TwoVect be connected in a useful way to computational methods in higher type theory?

  • It should be possible to write code that inserts the structural isomorphisms τ\tau, ω\omega and σ\sigma automatically where necessary. This would make the package enormously more powerful for certain applications.

  • Many more things could be implemented - a test for modularity of a braided monoidal category, quantum doubles, Hopf algebra axioms, module category axioms …

There are also some more mundane issues that need dealing with.

  • The basic functions that perform 2-cell tensor product, horizontal composition and vertical composition haven’t been optimized, and run slowly for large inputs. There should be a lot of scope for improving the code, and perhaps also for compilation, which Mathematica supports.

  • There are some other strange issues around speed; different ways to tell Mathematica to compute the same thing can give rise to very different calculation times.

  • We’re not sure how to test systematically whether everything has been implemented correctly.

  • There is probably some scope to restructure the packages and make them easier to use.

category: software

Last revised on July 24, 2015 at 06:24:56. See the history of this page for a list of all contributions to it.