GAP (MonoidalCategories) - Chapter 2: Examples and Tests

Goto Chapter: Top 1 2 3 4 Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax off]

2 Examples and Tests
2.1 Test functions
2.1-1 AdditiveMonoidalCategoriesTest
2.1-2 BraidedMonoidalCategoriesTest
2.1-3 ClosedMonoidalCategoriesTest
2.1-4 CoclosedMonoidalCategoriesTest
2.1-5 MonoidalCategoriesTensorProductAndUnitTest
2.1-6 MonoidalCategoriesTest
2.1-7 RigidSymmetricClosedMonoidalCategoriesTest
2.1-8 RigidSymmetricCoclosedMonoidalCategoriesTest
2.2 Basics

### 2 Examples and Tests

#### 2.1 Test functions

##### 2.1-1 AdditiveMonoidalCategoriesTest

`‣ AdditiveMonoidalCategoriesTest`( cat, a, L ) | ( function )

The arguments are

- a CAP category \(cat\)

- an object \(a\)

- a list \(L\) of objects

This function checks for every operation declared in AdditiveMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-2 BraidedMonoidalCategoriesTest

`‣ BraidedMonoidalCategoriesTest`( cat, a, b ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b\)

This function checks for every operation declared in BraidedMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-3 ClosedMonoidalCategoriesTest

`‣ ClosedMonoidalCategoriesTest`( cat, a, b, c, d, alpha, beta, gamma, delta, epsilon, zeta ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b, c, d\)

- a morphism \(\alpha: a \rightarrow b\)

- a morphism \(\beta: c \rightarrow d\)

- a morphism \(\gamma: a \otimes b \rightarrow 1\)

- a morphism \(\delta: c \otimes d \rightarrow 1\)

- a morphism \(\epsilon: 1 \rightarrow \mathrm{Hom}(a,b)\)

- a morphism \(\zeta: 1 \rightarrow \mathrm{Hom}(c,d)\)

This function checks for every operation declared in ClosedMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-4 CoclosedMonoidalCategoriesTest

`‣ CoclosedMonoidalCategoriesTest`( cat, a, b, c, d, alpha, beta, gamma, delta, epsilon, zeta ) | ( function )

The arguments are a CAP category \(cat\) objects \(a, b, c, d\)

- a morphism \(\alpha: a \rightarrow b\)

- a morphism \(\beta: c \rightarrow d\)

- a morphism \(\gamma: 1 \rightarrow a \otimes b\)

- a morphism \(\delta: 1 \rightarrow c \otimes d\)

- a morphism \(\epsilon: \mathrm{coHom}(a,b) \rightarrow 1\)

- a morphism \(\zeta: \mathrm{coHom}(c,d) \rightarrow 1\)

This function checks for every operation declared in CoclosedMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-5 MonoidalCategoriesTensorProductAndUnitTest

`‣ MonoidalCategoriesTensorProductAndUnitTest`( cat, a, b ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b\)

This function checks for every operation declared in MonoidalCategoriesTensorProductAndUnit.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-6 MonoidalCategoriesTest

`‣ MonoidalCategoriesTest`( cat, a, b, c, alpha, beta ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b, c\)

- a morphism \(\alpha: a \rightarrow b\)

- a morphism \(\beta: c \rightarrow d\)

This function checks for every operation declared in MonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-7 RigidSymmetricClosedMonoidalCategoriesTest

`‣ RigidSymmetricClosedMonoidalCategoriesTest`( cat, a, b, c, d, alpha ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b, c, d\)

- an endomorphism \(\alpha: a \rightarrow a\)

This function checks for every object and morphism declared in RigidSymmetricClosedMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

##### 2.1-8 RigidSymmetricCoclosedMonoidalCategoriesTest

`‣ RigidSymmetricCoclosedMonoidalCategoriesTest`( cat, a, b, c, d, alpha ) | ( function )

The arguments are

- a CAP category \(cat\)

- objects \(a, b, c, d\)

- an endomorphism \(\alpha: a \rightarrow a\)

This function checks for every object and morphism declared in RigidSymmetricCoclosedMonoidalCategories.gd if it is computable in the CAP category \(cat\). If yes, then the operation is executed with the parameters given above and compared to the equivalent computation in the opposite category of \(cat\). Pass the options

- `verbose := true` to output more information.

- `only_primitive_operations := true`, which is passed on to Opposite(), to only primitively install dual operations for primitively installed operations in \(cat\). The advantage is, that more derivations might be tested. On the downside, this might test fewer dual_pre/postprocessor_funcs.

#### 2.2 Basics

    gap> LoadPackage( "MonoidalCategories" );
    true
    gap> vecspaces := CreateCapCategory( "VectorSpaces" );
    VectorSpaces
    gap> ReadPackage( "MonoidalCategories",
    >         "examples/VectorSpacesMonoidalCategory.gi" );
    true
    gap> z := ZeroObject( vecspaces );
    <A rational vector space of dimension 0>
    gap> a := QVectorSpace( 1 );
    <A rational vector space of dimension 1>
    gap> b := QVectorSpace( 2 );
    <A rational vector space of dimension 2>
    gap> c := QVectorSpace( 3 );
    <A rational vector space of dimension 3>
    gap> alpha := VectorSpaceMorphism( a, [ [ 1, 0 ] ], b );
    A rational vector space homomorphism with matrix:
    [ [  1,  0 ] ]
    gap> beta := VectorSpaceMorphism( b,
    >                 [ [ 1, 0, 0 ], [ 0, 1, 0 ] ], c );
    A rational vector space homomorphism with matrix:
    [ [  1,  0,  0 ],
      [  0,  1,  0 ] ]
    gap> gamma := VectorSpaceMorphism( c,
    >                  [ [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 0 ] ], c );
    A rational vector space homomorphism with matrix:
    [ [  0,  1,  1 ],
      [  1,  0,  1 ],
      [  1,  1,  0 ] ]
    gap> IsCongruentForMorphisms(
    >         TensorProductOnMorphisms( alpha, beta ),
    >         TensorProductOnMorphisms( beta, alpha ) );
    false
    gap> IsOne( AssociatorRightToLeft( a, b, c ) );
    true
    gap> IsCongruentForMorphisms(
    >         gamma, LambdaElimination( c, c, LambdaIntroduction( gamma ) ) );
    true
    gap> IsZero( TraceMap( gamma ) );
    true
    gap> IsCongruentForMorphisms(
    >         RankMorphism( DirectSum( a, b ) ), RankMorphism( c ) );
    true
    gap> IsOne( Braiding( b, c ) );
    false
    gap> IsOne( PreCompose( Braiding( b, c ), Braiding( c, b ) ) );
    true

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 4 Ind

generated by GAPDoc2HTML