sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

F-Matrix Factory #30423

Closed 6bbcde06-8197-41f1-b9a3-c998bb839000 closed 2 years ago

6bbcde06-8197-41f1-b9a3-c998bb839000 commented 4 years ago

The FusionRing and its methods contain nearly complete information about the underlying modular tensor category. However information is lost about the associator, and this is captured by the F-matrix or 6j symbols. This ticket adds a method to compute the F-matrices.

This may be tested on the rank <=4 examples in the paper of Rowell, Stong and Wang (arXiv:0712.1377). It is able to compute F-matrices for these examples except the last one, G2 at level 2.

CC: @tscrim @sagetrac-sage-combinat @dwbump @willieab @physicstravels

Component: combinatorics

Keywords: Fusion Ring, F-matrix

Author: Daniel Bump, Guillermo Aboumrad, Galit Anikeeva

Branch: 57825e9

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/30423

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

6cb376aget_main_globals() to inject variables in FMatrix
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 6cb376a to ad55199

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

ad55199refuse to create FMatrix in non-multiplicity-free case
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from ad55199 to b664aed

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

b664aedbugfix r-matrix method
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2e6e804doctest revision in f_matrix.py, fusion_label flexibility for FusionRings
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from b664aed to 2e6e804

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 2e6e804 to beac8e7

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

beac8e7add braid method in fusion_ring.py
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

c635db9work on doctests
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from beac8e7 to c635db9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from c635db9 to 7d96da9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7d96da9doctests added, and braid group representations
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 7d96da9 to 614a639

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

614a639fixed get_order issue in fusion_ring doctests
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 614a639 to 4b7684f

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

4b7684fdocstring revisions
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4b7684f to 4a4fde8

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

14d951brevision of get_comp_basis docstring
4a4fde8work on get_computational_basis and get_trees
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

74a2d76FusionRing bugfix in weyl_characters: cast level as Integer
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4a4fde8 to 74a2d76

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7f738aano default picking, case-by-case determination of field
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 74a2d76 to 7f738aa

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

6ceb6d9f_matrix documentation added to reference manual
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 7f738aa to 6ceb6d9

6bbcde06-8197-41f1-b9a3-c998bb839000 commented 3 years ago

Changed work issues from Doctests are needed to none

6bbcde06-8197-41f1-b9a3-c998bb839000 commented 3 years ago

Work Issues: Needs rebasing to recent develop branch

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3202a1fcorrect BaKi2001 reference in f_matrix.py
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 6ceb6d9 to 3202a1f

tscrim commented 3 years ago
comment:43

With rebasing to the development branch, we currently have a segfault due to #30537:

sage: fm=FMatrix(FusionRing("A1",4,fusion_labels="a",inject_variables=True))
sage: fm.find_orthogonal_solution()
Computing F-symbols for The Fusion Ring of Type A1 and level 4 with
Integer Ring coefficients with 238 variables...
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
      self.run()
  File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 892, in run
      self._target(*self._args, **self._kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 576, in _handle_results
      task = get()
  File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 256, in recv
      return _ForkingPickler.loads(buf.getbuffer())
  File "sage/structure/factory.pyx", line 714, in sage.structure.factory.generic_factory_unpickle (build/cythonized/sage/structure/factory.c:4331)
  File "sage/structure/factory.pyx", line 371, in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:3187)
  File "sage/structure/factory.pyx", line 406, in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:2465)
  File "sage/misc/weak_dict.pyx", line 702, in sage.misc.weak_dict.WeakValueDictionary.__getitem__ (build/cythonized/sage/misc/weak_dict.c:3712)
  File "sage/rings/real_lazy.pyx", line 1379, in sage.rings.real_lazy.LazyNamedUnop.__hash__ (build/cythonized/sage/rings/real_lazy.c:15866)
  File "sage/rings/real_lazy.pyx", line 803, in sage.rings.real_lazy.LazyFieldElement.__complex__ (build/cythonized/sage/rings/real_lazy.c:10067)
  File "sage/rings/real_lazy.pyx", line 1333, in sage.rings.real_lazy.LazyNamedUnop.eval (build/cythonized/sage/rings/real_lazy.c:15306)
  File "sage/rings/real_lazy.pyx", line 1110, in sage.rings.real_lazy.LazyBinop.eval (build/cythonized/sage/rings/real_lazy.c:12998)
  File "sage/rings/real_lazy.pyx", line 1111, in sage.rings.real_lazy.LazyBinop.eval (build/cythonized/sage/rings/real_lazy.c:13010)
  File "sage/rings/real_lazy.pyx", line 1628, in sage.rings.real_lazy.LazyAlgebraic.eval (build/cythonized/sage/rings/real_lazy.c:18284)
  File "sage/rings/real_lazy.pyx", line 1654, in sage.rings.real_lazy.LazyAlgebraic.eval (build/cythonized/sage/rings/real_lazy.c:18435)
  File "sage/rings/polynomial/polynomial_element.pyx", line 7943, in sage.rings.polynomial.polynomial_element.Polynomial.roots (build/cythonized/sage/rings/polynomial/polynomial_element.c:64135)
  File "/Users/bump/sagemath/sage/local/lib/python3.9/site-packages/sage/rings/polynomial/complex_roots.py", line 258, in complex_roots rts = cfac.roots(multiplicities=False)
  File "sage/rings/polynomial/polynomial_element.pyx", line 7849, in sage.rings.polynomial.polynomial_element.Polynomial.roots (build/cythonized/sage/rings/polynomial/polynomial_element.c:61466)
  File "sage/rings/polynomial/polynomial_element.pyx", line 6127, in sage.rings.polynomial.polynomial_element.Polynomial.__pari__ (build/cythonized/sage/rings/polynomial/polynomial_element.c:49925)
  File "sage/rings/polynomial/polynomial_element.pyx", line 6180, in sage.rings.polynomial.polynomial_element.Polynomial._pari_with_name (build/cythonized/sage/rings/polynomial/polynomial_element.c:50330)
  File "sage/rings/complex_mpfr.pyx", line 1393, in sage.rings.complex_mpfr.ComplexNumber.__pari__ (build/cythonized/sage/rings/complex_mpfr.c:14704)
 File "sage/rings/real_mpfr.pyx", line 3383, in sage.rings.real_mpfr.RealNumber.__pari__ (build/cythonized/sage/rings/real_mpfr.c:24175)
cysignals.signals.SignalError: Segmentation Fault
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 3202a1f to 3406d76

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3406d76Merge branch 'public/new_fmatrix-30423' of git://trac.sagemath.org/sage into public/new_fmatrix-30423
tscrim commented 3 years ago

Changed work issues from Needs rebasing to recent develop branch to Fix segfault from #30537

kiwifb commented 3 years ago
comment:46

Thanks for the ping from #30537. This almost certainly comes from the enabling of threads in pari. While it has been applied for a while in distros you must have come to a point where it is important in the interface.

mkoeppe commented 3 years ago
comment:47

We have seen crashes from combining Python multiprocessing together with libraries' use of threads in many circumstances, in particular in the parallel docbuild, see #31344, #30351, #28483.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

5559e96changes to avoid segfault form #30537
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 3406d76 to 5559e96

6bbcde06-8197-41f1-b9a3-c998bb839000 commented 3 years ago
comment:49

Here is a minimal example of the problem caused by ticket #30537

from multiprocessing import Pool, set_start_method

def problem_child(chil_id):
    return pari(2)

if __name__ == '__main__':
    set_start_method('fork')
    pool = Pool()

    recv = pool.map(problem_child, range(pool._processes))
    print("success!")

This runs with older versions of sage but not beta8 or later. The latest version of the code in the public/new_fmatrix-30423 branch contains a workaround but it would be better not to have to do this.

tscrim commented 3 years ago
comment:50

If we instead do

def problem_child(chil_id):
    pari(2)
    return 5

then there is no problem. We can also pass something from the parent process to the child process without a segfault.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 5559e96 to 3429f25

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3429f25docstring revisions
6bbcde06-8197-41f1-b9a3-c998bb839000 commented 3 years ago

New commits:

3429f25docstring revisions
6bbcde06-8197-41f1-b9a3-c998bb839000 commented 3 years ago

Changed work issues from Fix segfault from #30537 to none

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

49e27efAdd CW2015 to index.rst
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 3429f25 to 49e27ef

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

c178754testing push to trac
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 49e27ef to c178754

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

0b24ef9faster doctests, full coverage
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from c178754 to 0b24ef9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7c4ecb2make tests in fast_parallel_fusion_ring_braid_repn.pyx long to avoid excessive test time.