Verbose flags may be defined by users within packages.
Given a verbose flag name F (without quotes), and a literal integer m, create the verbose flag F, with the maximal allowable level for the flag set to m. This directive may only be used within package files.
In this subsection we give examples which illustrate all of the above features.
> // Create group G. > G := PSL(3, 2); > // Check whether order known. > assigned G`Order; false > // Attempt to access order -- error since not assigned. > G`Order; >> G`Order; ^ Runtime error in `: Attribute 'Order' for this structure is valid but not assigned > // Force computation of order by intrinsic Order. > Order(G); 168 > // Check Order field again. > assigned G`Order; true > G`Order; 168 > G""Order"; // String form for field 168 > o := "Order"; > G"o; 168 > // Create code C and set its minimum weight. > C := QRCode(GF(2), 31); > C`MinimumWeight := 7; > C; [31, 16, 7] Quadratic Residue code over GF(2) ...
> // Add attribute field MyStuff for matrix groups. > AddAttribute(GrpMat, "MyStuff"); > // Create group G. > G := GL(2, 3); > // Try illegal field. > G`silly; >> G`silly; ^ Runtime error in `: Invalid attribute 'silly' for this structure > // Try legal but unassigned field. > G`MyStuff; >> G`MyStuff; ^ Runtime error in `: Attribute 'MyStuff' for this structure is valid but not assigned > // Assign field and notice value. > G`MyStuff := [1, 2]; > G`MyStuff; [ 1, 2 ]
declare attributes GrpMat: PermRep, PermRepMap; intrinsic PermutationRepresentation(G::GrpMat) -> GrpPerm {A permutation group representation P of G, with homomorphism f: G -> P}; // Only compute rep if not already stored. if not assigned G`PermRep then G`PermRepMap, G`PermRep := CosetAction(G, sub<G|>); end if; return G`PermRep, G`PermRepMap; end intrinsic;Note that the information stored will be reused in subsequent calls of the intrinsic. Then the package can be attached within a Magma session and the intrinsic PermutationRepresentation called like in the following code (assumed to be run in the same directory).
> Attach("permrep.m"); > G := GL(2, 2); > P, f := PermutationRepresentation(G); > P; Permutation group P acting on a set of cardinality 6 (1, 2)(3, 5)(4, 6) (1, 3)(2, 4)(5, 6) > f; Mapping from: GrpMat: G to GrpPerm: PSuppose the following line were also in the package file:
declare verbose MyAlgorithm, 3;Then there would be a new verbose flag MyAlgorithm for use anywhere within Magma, with the maximum 3 for the level.