�
ɍ�Xc@shddlTed�Zed�Zed�ZddlTdefd��YZdefd��YZ	d	S(
i����(t*iiitlocal_BraidcBs8eZdZdd�Zdd�Zdedd�ZRS(s�
This Class contains extensions to the Braid Element class.

If you don't see this well formatted type

sage: print local_Braid.__doc__

This class has two new methods and one overwriting the corresponding methods of the class Braid.

New methods:
- __burau_matrix_wikipedia__
- __burau_matrix_unitary__

Modified:
. burau_matrix (using __burau_matrix_wikipedia__, __burau_matrix_unitary__ )

For more information type

sage: print local_Braid.__burau_matrix_wikipedia__.__doc__
sage: print local_Braid.__burau_matrix_unitary__.__doc__
sage: print local_Braid.burau_matrix.__doc__

AUTHOR

- Sebastian Oehms, Oct. 2016

ttcCsstt�|�}|j�}|j�}t||t�}x/|j�D]!}t||t�}|tkr�|||t|tf<|tkr�|||t|tf<n||tkr�t||t|f<q�n|tkra|t||t|tf<|tkr/t||t|tf<n||tkra|t||t|f<qan||}qJW|S(s
The explicit reduced Burau representation given on Wikipedia since 11.03.2014 is different from the version
implemented in the braid-basis class. The version according to the recent Wikipedia-Page is implemented here.

If you don't see this well formatted type

sage: print local_Braid.__burau_matrix_wikipedia__.__doc__

Moreover it is the version used by Squier and Coxeter and will be used here to implement the unitary Burau
reoresentation

INPUT:

- "var":  string (default: 't'); the name of the variable in the entries of the matrix. See also:
print sage.groups.braid.Braid.burau_matrix.__doc__

OUTPUT:

The Burau matrix of the braid. It is a matrix whose entries are Laurent polynomials in the variable "var".

EXAMPLES:

sage: sage.groups.braid.BraidGroup_class = local_BraidGroup_class
sage: B4 = BraidGroup(4)
sage: b1, b2, b3 = B4.gens()
sage: b = b1*b2/b3/b2
sage: type(b)
<class 'lib.local_braid.local_BraidGroup_class_with_category.element_class'>
sage: b.__burau_matrix_wikipedia__()
[    1 - t -t^-1 + 1        -1]
[        1 -t^-1 + 1        -1]
[        1     -t^-1         0]
sage: b.__burau_matrix_wikipedia__(var='x')
[    1 - x -x^-1 + 1        -1]
[        1 -x^-1 + 1        -1]
[        1     -x^-1         0]

compare with the original method

sage: b.burau_matrix()
[       1 - t            0      t - t^2          t^2]
[           1            0            0            0]
[           0            0            1            0]
[           0         t^-2 -t^-2 + t^-1    -t^-1 + 1]
sage: b.burau_matrix(reduced=True)
[                     0               -t + t^2                   -t^2]
[                     0            1 - t + t^2                   -t^2]
[                  t^-2 -t^-2 + t^-1 - t + t^2        -t^-1 + 1 - t^2]
sage:

REFERENCES:

- wikipedia:'Burau_representation'

AUTHOR

- Sebastian Oehms, Oct. 2016

(	tLaurentPolynomialRingtIntegerRingtgentstrandstidentity_matrixt
_sage_const_1tTietzet
_sage_const_0t
_sage_const_2(tselftvartRRtntMtitA((slib/local_braid.pyt__burau_matrix_wikipedia__Ys(> 
!tscs%|j���j�t}tt�dd�}|jd�\}tt�|�}|j�}|j|tgd|��t	||��fd��}t	|||d��}t	|||d��}	xEt
|�D]7}
||
t||
|
f<||
t|	|
|
f<q�W|	||}|S(	s�
Return the unitary form of the Burau matrix of the braid according to

CRAIG C. SQUIE: THE BURAU REPRESENTATION IS UNITARY, PROCEEDINGS OF THE AMERICAN MATHEMATICAL SOCIETY,
Volume 90. Number 2, February 1984

If you don't see this well formatted type

sage: print local_Braid.__burau_matrix_unitary__.__doc__

INPUT:

- "var":  string (default: 's'); the name of the variable in the entries of the matrix. The connection with the
variable t of the original burau_matrix is t=s**2. See also:
print sage.groups.braid.Braid.burau_matrix.__doc__

OUTPUT:

The Burau matrix of the braid in the unitary form. It is obtained from the original burau_matrix by a base change
in order to preserve a hermitian form. It is a matrix whose entries are Laurent polynomials in the variable "var".
The original Burau matrix can be obtained by the method local_Braid.__burau_matrix_wikipedia__

EXAMPLES:

sage: sage.groups.braid.BraidGroup_class = local_BraidGroup_class
sage: B4 = BraidGroup(4)
sage: b1, b2, b3 = B4.gens()
sage: b = b1*b2/b3/b2
sage: type(b)
<class 'lib.local_braid.local_BraidGroup_class_with_category.element_class'>
sage: b.__burau_matrix_unitary__()
[  1 - s^2 -s^-1 + s      -s^2]
[     s^-1 -s^-2 + 1        -s]
[     s^-2     -s^-3         0]
sage: b.__burau_matrix_unitary__(var='x')
[  1 - x^2 -x^-1 + x      -x^2]
[     x^-1 -x^-2 + 1        -x]
[     x^-2     -x^-3         0]
sage:

compare with the version given on wikipedia:

sage: b.__burau_matrix_wikipedia__()
[    1 - t -t^-1 + 1        -1]
[        1 -t^-1 + 1        -1]
[        1     -t^-1         0]

compare with the original method:

sage: b.burau_matrix()
[       1 - t            0      t - t^2          t^2]
[           1            0            0            0]
[           0            0            1            0]
[           0         t^-2 -t^-2 + t^-1    -t^-1 + 1]
sage: b.burau_matrix(reduced=True)
[                     0               -t + t^2                   -t^2]
[                     0            1 - t + t^2                   -t^2]
[                  t^-2 -t^-2 + t^-1 - t + t^2        -t^-1 + 1 - t^2]
sage:

REFERENCES:

- Coxeter, H.S.M: "Factor groups of the braid groups, Proceedings of the Fourth Candian Mathematical Congress
(Vancover      1957), pp. 95-122".

- C. C. Squier:THE BURAU REPRESENTATION IS UNITARY, PROCEEDINGS OF THE
AMERICAN MATHEMATICAL SOCIETY
Volume 90. Number 2, February 1984
- Tyakay Venkataramana: Image of the Burau Representation at $d$-th Roots of unity. ANNALS OF MATHEMATICS MAY 2014

AUTHOR

- Sebastian Oehms, Oct. 2016

tnamesRitcodomaincs��||f�S(N((Rtj(tBurauOritsubsVar(slib/local_braid.pyt<lambda>scSstS(N(R
(RR((slib/local_braid.pyRscSstS(N(R
(RR((slib/local_braid.pyRs(R(Rt
dimensionsR
RRt_first_ngensRthomRtmatrixtrangeR(RR
tdt	oriDomainRt	newDomainRtBurauMatt
transformPttransformPIRtres((RRslib/local_braid.pyt__burau_matrix_unitary__�sMtdefaultcCs^|dkr.tjjjj|d|d|�S|dkrJ|jd|�S|jd|�SdS(sb
This method is a modification of the original burau_matrix-method. It contains an additional keyword-parameter
"version". If this keyword is not set or is set to the value 'default' it behaves like the original one.

If you don't see this well formatted type:

sage: print local_Braid.burau_matrix.__doc__

To read the original docstring type:

sage: print Braid.burau_matrix.__doc__

INPUT:

- "var":  string (default: 't'); the name of the variable in the entries of the matrix. See also:
print sage.groups.braid.Braid.burau_matrix.__doc__
- "reduced": boolean (default: 'False'); whether to return the reduced or unreduced Burau representation.
Note: if version is set to a value different from 'default' this keyword is ignored and treated
as set to 'True' (this means: no unreduced form for other versions)
- "version": string (default = 'default' ). The following values are possible

- "default" the method behaves like the original one. For more information on this see
sage: print Braid.burau_matrix.__doc__

- "unitary" gives the unitary form according to Squier. For more information on this see
sage: print local_Braid.__burau_matrix_unitary__.__doc__

- any value else gives the reduced form given on wikipedia. For more information on this see
sage: print local_Braid.__burau_matrix_wikipedia__.__doc__

OUTPUT:

The Burau matrix of the braid. It is a matrix whose entries are Laurent polynomials in the variable "var".

EXAMPLES:

sage: sage.groups.braid.BraidGroup_class = local_BraidGroup_class
sage: B4 = BraidGroup(4)
sage: b1, b2, b3 = B4.gens()
sage: b = b1*b2/b3/b2
sage: type(b)
<class 'lib.local_braid.local_BraidGroup_class_with_category.element_class'>
sage: b.burau_matrix()
[       1 - t            0      t - t^2          t^2]
[           1            0            0            0]
[           0            0            1            0]
[           0         t^-2 -t^-2 + t^-1    -t^-1 + 1]
sage: b.burau_matrix(version='unitary')
[  1 - t^2 -t^-1 + t      -t^2]
[     t^-1 -t^-2 + 1        -t]
[     t^-2     -t^-3         0]
sage: b.burau_matrix(version='wiki')
[    1 - t -t^-1 + 1        -1]
[        1 -t^-1 + 1        -1]
[        1     -t^-1         0]
sage: b.burau_matrix(version='wiki', reduced=True)
[    1 - t -t^-1 + 1        -1]
[        1 -t^-1 + 1        -1]
[        1     -t^-1         0]
sage: b.burau_matrix(version='wiki', reduced=False)
[    1 - t -t^-1 + 1        -1]
[        1 -t^-1 + 1        -1]
[        1     -t^-1         0]
sage: b.burau_matrix(reduced=True)
[                     0               -t + t^2                   -t^2]
[                     0            1 - t + t^2                   -t^2]
[                  t^-2 -t^-2 + t^-1 - t + t^2        -t^-1 + 1 - t^2]
sage: b.burau_matrix(var='s', version='unitary')
[  1 - s^2 -s^-1 + s      -s^2]
[     s^-1 -s^-2 + 1        -s]
[     s^-2     -s^-3         0]
sage:

AUTHOR

- Sebastian Oehms, Oct. 2016

R(R
treducedtunitaryN(tsagetgroupstbraidtBraidtburau_matrixR'R(RR
R)tversion((slib/local_braid.pyR/s
Q"(t__name__t
__module__t__doc__RR'tFalseR/(((slib/local_braid.pyR;sW^tlocal_BraidGroup_classcBs eZdZeZdd�ZRS(s�
This Class contains extensions to the sage BraidGroup class.

If you don't see this well formatted type:

sage: print local_BraidGroup_class.__doc__

New methods:

- __unitary_form__

Modified:

. Element Class is local_Braid instead of Braid. This contains extension of the burau_matrix -method
For more information type:

sage: print local_Braid.__doc__

AUTHOR

- Sebastian Oehms, Oct. 2016

RcCs�tt�|�}|j�}|j�}||tt||t�}xBt|t�D]0}t|||tf<t||t|f<q[W|S(s�
Returns the hermitian form with respect to the __unitary_burau_matrix__ of the Element Class

If you don't see this well formatted type:

sage: print local_BraidGroup_class.__unitary_form__.__doc__

The hermitian form returned by this method is kept invariant by the unitary Burau matrices returned by the
local_Braid -method burau_matrix() setting the version keyword to 'unitary'

For more information on the unitary Burau matrices type

sage: print local_Braid.__burau_matrix_unitary__.__doc__
sage: print local_Braid.burau_matrix.__doc__

INPUT:

- "var":  string (default: 's'); the name of the variable in the entries of the matrix of the unitary form.

OUTPUT:

The hermitian form as a quadratic matrix whose entries are Laurent polynomials in the variable "var".

EXAMPLES:

sage: sage.groups.braid.BraidGroup_class = local_BraidGroup_class
sage: B4 = BraidGroup(4)
sage: B4.__unitary_form__()
[s^-1 + s       -1        0]
[      -1 s^-1 + s       -1]
[       0       -1 s^-1 + s]
sage:
sage:
sage: B4.__unitary_form__(var='x')
[x^-1 + x       -1        0]
[      -1 x^-1 + x       -1]
[       0       -1 x^-1 + x]
sage:

REFERENCES:

- Coxeter, H.S.M: "Factor groups of the braid groups, Proceedings of the Fourth Candian Mathematical Congress
(Vancover      1957), pp. 95-122".

- C. C. Squier:THE BURAU REPRESENTATION IS UNITARY, PROCEEDINGS OF THE
AMERICAN MATHEMATICAL SOCIETY
Volume 90. Number 2, February 1984

AUTHOR

- Sebastian Oehms, Oct. 2016

(RRRRRRRR(RR
RRRRR((slib/local_braid.pyt__unitary_form__�s6 (R1R2R3RtElementR6(((slib/local_braid.pyR5isN(
tsage.all_cmdlinetIntegerRRR
tsage.groups.braidR.RtBraidGroup_classR5(((slib/local_braid.pyt<module>s
6
�/