‣ CategoryOfZXDiagrams ( ) | ( function ) |
Returns: a category of ZX-diagrams
Creates a category of ZX-diagrams.
‣ ZX | ( global variable ) |
The default instance of the category of ZX-diagrams. It is automatically created while loading this package.
‣ Qubits ( zx, n ) | ( operation ) |
Returns: an object
Create n qubits as an object in the category zx of ZX-diagrams.
‣ Z_Spider ( zx, phi, nr_inputs, nr_outputs ) | ( operation ) |
Returns: a morphism
Create an Z-spider of phase phi with nr_inputs inputs and nr_outputs outputs as a morphism in the category zx of ZX-diagrams.
‣ X_Spider ( zx, phi, nr_inputs, nr_outputs ) | ( operation ) |
Returns: a morphism
Create an X-spider of phase phi with nr_inputs inputs and nr_outputs outputs as a morphism in the category zx of ZX-diagrams.
‣ H_Gate ( zx ) | ( operation ) |
Returns: a morphism
Create an H-gate with 1 input and 1 output as a morphism in the category zx of ZX-diagrams.
‣ CategoryOfZXDiagrams_as_CategoryOfCospans_CategoryOfDecoratedQuivers ( ) | ( function ) |
Returns: a category of ZX-diagrams
Creates a category of ZX-diagrams as a tower. Only available if the package FunctorCategories
is available.
‣ AsInteger ( obj ) | ( attribute ) |
The integer defining an object in a category of ZX-diagrams.
‣ VertexLabeledGraph ( mor ) | ( attribute ) |
The labeled graph defining a morphism in a category of ZX-diagrams.
gap> LoadPackage( "ZXCalculusForCAP", false ); true gap> ZX; CategoryOfZXDiagrams( ) gap> zero := Qubits( 0 ); <An object in CategoryOfZXDiagrams( ) representing 0 input/output vertices> gap> one := Qubits( 1 ); <An object in CategoryOfZXDiagrams( ) representing 1 input/output vertices> gap> two := Qubits( 2 ); <An object in CategoryOfZXDiagrams( ) representing 2 input/output vertices> gap> three := Qubits( 3 ); <An object in CategoryOfZXDiagrams( ) representing 3 input/output vertices> gap> three = one + two; true gap> three = zero + three; true gap> three = 3 * one; true gap> id := IdentityMorphism( one ); <An identity morphism in CategoryOfZXDiagrams( )> gap> id3 := IdentityMorphism( three ); <An identity morphism in CategoryOfZXDiagrams( )> gap> id3 = 3 * id; true gap> ev := EvaluationForDual( three ); <A morphism in CategoryOfZXDiagrams( )> gap> coev := CoevaluationForDual( three ); <A morphism in CategoryOfZXDiagrams( )> gap> PreCompose( ev, IdentityMorphism( zero ) ); <A morphism in CategoryOfZXDiagrams( )> gap> PreCompose( IdentityMorphism( TensorProduct( three, three ) ), ev ); <A morphism in CategoryOfZXDiagrams( )> gap> PreCompose( coev, IdentityMorphism( TensorProduct( three, three ) ) ); <A morphism in CategoryOfZXDiagrams( )> gap> PreCompose( IdentityMorphism( zero ), coev ); <A morphism in CategoryOfZXDiagrams( )> gap> Display( PreCompose( coev, ev ) ); A morphism in CategoryOfZXDiagrams( ) given by a ZX-diagram \ with 0 vertex labels [ ], inputs [ ], outputs [ ], and 0 edges [ ]. gap> Display( PreCompose( ev, coev ) ); A morphism in CategoryOfZXDiagrams( ) given by a ZX-diagram \ with 6 vertex labels [ "neutral", "neutral", "neutral", "neutral", "neutral", "neutral" ], inputs [ 0, 1, 2, 0, 1, 2 ], outputs [ 3, 4, 5, 3, 4, 5 ], and 0 edges [ ]. gap> IdentityMorphism( one ) + IdentityMorphism( two ) = id3; true gap> AssociatorLeftToRight( zero, one, two ) = id3; true gap> AssociatorRightToLeft( zero, one, two ) = id3; true gap> LeftUnitor( three ) = id3; true gap> LeftUnitorInverse( three ) = id3; true gap> RightUnitor( three ) = id3; true gap> RightUnitorInverse( three ) = id3; true gap> Braiding( one, two ) = BraidingInverse( two, one ); true gap> X_1_1 := X_Spider( 1, 1 ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( X_1_1 ); true gap> Z_1_1 := Z_Spider( 1, 1 ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( Z_1_1 ); true gap> H := H_Gate( ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( H ); true gap> X_1_2 := X_Spider( 1, 2 ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( X_1_2 ); true gap> Z_2_1 := Z_Spider( 2, 1 ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( Z_2_1 ); true gap> X_1_2_Z_2_1 := PreCompose( X_1_2, Z_2_1 ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( X_1_2_Z_2_1 ); true gap> GHZ := ( 3 * X_Spider( 0, 1 ) ) * ( id + H + id ) * > ( X_1_2 + Z_Spider( 1, 1 ) + X_1_2 ) * > ( id + Z_Spider( 3, 1 ) + id ); <A morphism in CategoryOfZXDiagrams( )> gap> IsWellDefined( GHZ ); true
‣ IsCategoryOfZXDiagrams | ( filter ) |
The filter of categories of ZX-diagrams.
‣ IsObjectInCategoryOfZXDiagrams | ( filter ) |
The filter of objects in a category of ZX-diagrams.
‣ IsMorphismInCategoryOfZXDiagrams | ( filter ) |
The filter of morphisms in a category of ZX-diagrams.
generated by GAPDoc2HTML