passagemath-modules 10.5.46__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-modules might be problematic. Click here for more details.
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +49 -44
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +320 -314
- passagemath_modules.dylibs/libmpc.3.dylib +0 -0
- passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
- sage/algebras/clifford_algebra.py +2 -2
- sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/clifford_algebra_element.pyx +4 -2
- sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
- sage/algebras/exterior_algebra_groebner.pyx +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
- sage/algebras/finite_gca.py +1 -1
- sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
- sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
- sage/algebras/lie_algebras/examples.py +2 -2
- sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
- sage/algebras/lie_algebras/heisenberg.py +4 -4
- sage/algebras/lie_algebras/lie_algebra.py +1 -1
- sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +63 -27
- sage/algebras/lie_algebras/quotient.py +40 -29
- sage/algebras/lie_algebras/subalgebra.py +76 -53
- sage/algebras/lie_algebras/verma_module.py +1 -3
- sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
- sage/algebras/octonion_algebra.pyx +1 -1
- sage/algebras/orlik_solomon.py +4 -4
- sage/algebras/orlik_terao.py +4 -4
- sage/algebras/steenrod/steenrod_algebra.py +37 -30
- sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
- sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
- sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
- sage/all__sagemath_modules.py +1 -0
- sage/calculus/integration.cpython-310-darwin.so +0 -0
- sage/calculus/integration.pyx +6 -5
- sage/calculus/interpolation.cpython-310-darwin.so +0 -0
- sage/calculus/interpolators.cpython-310-darwin.so +0 -0
- sage/calculus/ode.cpython-310-darwin.so +0 -0
- sage/calculus/ode.pxd +2 -2
- sage/calculus/ode.pyx +6 -4
- sage/calculus/riemann.cpython-310-darwin.so +0 -0
- sage/calculus/riemann.pyx +68 -48
- sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
- sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.pyx +31 -31
- sage/coding/binary_code.cpython-310-darwin.so +0 -0
- sage/coding/binary_code.pxd +6 -6
- sage/coding/binary_code.pyx +212 -173
- sage/coding/guruswami_sudan/utils.py +3 -5
- sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
- sage/coding/kasami_codes.pyx +20 -24
- sage/coding/linear_code.py +2 -2
- sage/coding/linear_code_no_metric.py +5 -5
- sage/coding/linear_rank_metric.py +81 -19
- sage/combinat/free_module.py +22 -2
- sage/combinat/root_system/ambient_space.py +1 -1
- sage/combinat/root_system/associahedron.py +4 -4
- sage/combinat/root_system/braid_move_calculator.py +1 -1
- sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/branching_rules.py +2 -2
- sage/combinat/root_system/cartan_type.py +14 -14
- sage/combinat/root_system/coxeter_group.py +2 -2
- sage/combinat/root_system/coxeter_type.py +11 -0
- sage/combinat/root_system/extended_affine_weyl_group.py +8 -8
- sage/combinat/root_system/fundamental_group.py +2 -4
- sage/combinat/root_system/hecke_algebra_representation.py +1 -1
- sage/combinat/root_system/pieri_factors.py +2 -2
- sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
- sage/combinat/root_system/root_lattice_realizations.py +1 -1
- sage/combinat/root_system/type_folded.py +3 -3
- sage/combinat/root_system/type_reducible.py +8 -7
- sage/combinat/root_system/type_super_A.py +2 -2
- sage/combinat/root_system/weight_lattice_realizations.py +9 -8
- sage/combinat/root_system/weyl_characters.py +1 -1
- sage/crypto/__init__.py +1 -0
- sage/crypto/block_cipher/des.py +1 -1
- sage/crypto/block_cipher/miniaes.py +3 -3
- sage/crypto/block_cipher/present.py +3 -3
- sage/crypto/block_cipher/sdes.py +3 -3
- sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
- sage/crypto/boolean_function.pyx +22 -23
- sage/crypto/key_exchange/diffie_hellman.py +4 -9
- sage/crypto/mq/sr.py +1 -1
- sage/crypto/public_key/blum_goldwasser.py +3 -3
- sage/crypto/sbox.cpython-310-darwin.so +0 -0
- sage/crypto/sbox.pyx +1 -1
- sage/crypto/sboxes.py +22 -0
- sage/crypto/util.py +4 -6
- sage/ext/interpreters/__init__.py +1 -1
- sage/ext/interpreters/all__sagemath_modules.py +1 -1
- sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +5 -5
- sage/ext/interpreters/wrapper_cc.pyx +1 -1
- sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +5 -7
- sage/ext/interpreters/wrapper_cdf.pyx +4 -10
- sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +1 -1
- sage/ext/interpreters/wrapper_rdf.pyx +1 -1
- sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +5 -5
- sage/ext/interpreters/wrapper_rr.pyx +1 -2
- sage/geometry/toric_lattice.py +3 -3
- sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
- sage/groups/additive_abelian/additive_abelian_group.py +1 -1
- sage/groups/additive_abelian/qmodnz.py +4 -4
- sage/groups/matrix_gps/coxeter_group.py +17 -4
- sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
- sage/groups/misc_gps/argument_groups.py +2 -2
- sage/groups/misc_gps/imaginary_groups.py +4 -4
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
- sage/homology/chain_complex.py +0 -2
- sage/homology/hochschild_complex.py +3 -3
- sage/homology/homology_morphism.py +6 -6
- sage/homology/homology_vector_space_with_basis.py +1 -1
- sage/libs/gsl/array.cpython-310-darwin.so +0 -0
- sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
- sage/matrix/action.cpython-310-darwin.so +0 -0
- sage/matrix/args.cpython-310-darwin.so +0 -0
- sage/matrix/args.pyx +25 -10
- sage/matrix/benchmark.py +8 -4
- sage/matrix/compute_J_ideal.py +2 -2
- sage/matrix/constructor.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.pyx +1 -1
- sage/matrix/matrix0.cpython-310-darwin.so +0 -0
- sage/matrix/matrix0.pxd +3 -3
- sage/matrix/matrix0.pyx +7 -5
- sage/matrix/matrix1.cpython-310-darwin.so +0 -0
- sage/matrix/matrix1.pyx +87 -48
- sage/matrix/matrix2.cpython-310-darwin.so +0 -0
- sage/matrix/matrix2.pxd +3 -3
- sage/matrix/matrix2.pyx +758 -75
- sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.pyx +1 -1
- sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_dense.pyx +2 -3
- sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_double_dense.pyx +11 -5
- sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.pyx +1 -1
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.pyx +952 -261
- sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.pyx +2 -3
- sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_window.pyx +2 -2
- sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
- sage/matrix/operation_table.py +0 -2
- sage/matrix/special.py +4 -0
- sage/matrix/strassen.cpython-310-darwin.so +0 -0
- sage/matrix/strassen.pyx +1 -1
- sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/chow_ring.py +68 -65
- sage/matroids/chow_ring_ideal.py +41 -38
- sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/database_matroids.py +16 -5
- sage/matroids/dual_matroid.py +2 -2
- sage/matroids/extension.cpython-310-darwin.so +0 -0
- sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/gammoid.py +1 -1
- sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/graphic_matroid.pyx +3 -3
- sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
- sage/matroids/lean_matrix.pyx +22 -22
- sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/linear_matroid.pyx +13 -13
- sage/matroids/matroid.cpython-310-darwin.so +0 -0
- sage/matroids/matroid.pyx +15 -15
- sage/matroids/matroids_plot_helpers.py +48 -46
- sage/matroids/minor_matroid.py +2 -2
- sage/matroids/set_system.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.pyx +3 -3
- sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/union_matroid.pyx +3 -0
- sage/matroids/unpickling.cpython-310-darwin.so +0 -0
- sage/matroids/utilities.py +2 -2
- sage/misc/c3.cpython-310-darwin.so +0 -0
- sage/misc/compat.py +1 -2
- sage/misc/pickle_old.cpython-310-darwin.so +0 -0
- sage/modules/diamond_cutting.py +117 -30
- sage/modules/fg_pid/fgp_module.py +3 -3
- sage/modules/filtered_vector_space.py +4 -4
- sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
- sage/modules/fp_graded/free_module.py +2 -2
- sage/modules/fp_graded/module.py +2 -2
- sage/modules/fp_graded/morphism.py +4 -4
- sage/modules/fp_graded/steenrod/morphism.py +1 -1
- sage/modules/free_module.py +144 -15
- sage/modules/free_module_element.cpython-310-darwin.so +0 -0
- sage/modules/free_module_element.pyx +4 -4
- sage/modules/free_module_integer.py +2 -2
- sage/modules/free_module_morphism.py +3 -3
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
- sage/modules/matrix_morphism.py +9 -9
- sage/modules/multi_filtered_vector_space.py +4 -4
- sage/modules/ore_module.py +2208 -0
- sage/modules/ore_module_element.py +178 -0
- sage/modules/ore_module_homspace.py +147 -0
- sage/modules/ore_module_morphism.py +968 -0
- sage/modules/quotient_module.py +11 -1
- sage/modules/submodule.py +1 -1
- sage/modules/torsion_quadratic_module.py +1 -1
- sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.pyx +4 -4
- sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.pyx +1 -1
- sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_sparse.pyx +5 -5
- sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_space_morphism.py +2 -2
- sage/modules/with_basis/cell_module.py +17 -0
- sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
- sage/modules/with_basis/indexed_element.pyx +1 -1
- sage/modules/with_basis/invariant.py +1 -1
- sage/modules/with_basis/representation.py +0 -1
- sage/modules/with_basis/subquotient.py +2 -2
- sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
- sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/binary_qf.py +7 -7
- sage/quadratic_forms/bqf_class_group.py +26 -92
- sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/extras.py +1 -1
- sage/quadratic_forms/quadratic_form.py +5 -4
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
- sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
- sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/ternary_qf.py +50 -83
- sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.pxd +1 -0
- sage/rings/complex_double.pyx +37 -32
- sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpc.pyx +27 -23
- sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpfr.pyx +11 -9
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
- sage/rings/function_field/drinfeld_modules/homset.py +1 -2
- sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
- sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +27 -25
- sage/rings/invariants/invariant_theory.py +61 -60
- sage/rings/invariants/reconstruction.py +8 -8
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_function_element.py +1 -1
- sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
- sage/rings/polynomial/ore_polynomial_ring.py +134 -17
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
- sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.pyx +25 -7
- sage/rings/ring_extension.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension.pyx +4 -2
- sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.pyx +42 -0
- sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
- sage/schemes/projective/cohomology.py +2 -2
- sage/stats/basic_stats.py +9 -6
- sage/stats/distributions/dgs_misc.h +11 -4
- sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
- sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/chmm.pyx +13 -13
- sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
- sage/stats/hmm/distributions.pxd +3 -3
- sage/stats/hmm/distributions.pyx +3 -3
- sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/hmm.pxd +3 -3
- sage/stats/hmm/hmm.pyx +6 -6
- sage/stats/hmm/util.cpython-310-darwin.so +0 -0
- sage/stats/hmm/util.pyx +6 -6
- sage/stats/intlist.cpython-310-darwin.so +0 -0
- sage/stats/intlist.pxd +3 -3
- sage/stats/time_series.cpython-310-darwin.so +0 -0
- sage/tensor/modules/alternating_contr_tensor.py +3 -3
- sage/tensor/modules/comp.py +3 -3
- sage/tensor/modules/ext_pow_free_module.py +3 -3
- sage/tensor/modules/format_utilities.py +3 -3
- sage/tensor/modules/free_module_linear_group.py +3 -3
- sage/tensor/modules/free_module_morphism.py +0 -1
- sage/tensor/modules/tensor_free_module.py +3 -3
- sage/tensor/modules/tensor_free_submodule.py +1 -1
- sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
- sage/tensor/modules/tensor_with_indices.py +5 -5
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +0 -0
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -788,7 +788,7 @@ class CliffordAlgebra(CombinatorialFreeModule):
|
|
|
788
788
|
"""
|
|
789
789
|
return self._from_dict({FrozenBitset((i,)): self.base_ring().one()}, remove_zeros=False)
|
|
790
790
|
|
|
791
|
-
def algebra_generators(self):
|
|
791
|
+
def algebra_generators(self) -> Family:
|
|
792
792
|
"""
|
|
793
793
|
Return the algebra generators of ``self``.
|
|
794
794
|
|
|
@@ -802,7 +802,7 @@ class CliffordAlgebra(CombinatorialFreeModule):
|
|
|
802
802
|
d = {x: self.gen(i) for i, x in enumerate(self.variable_names())}
|
|
803
803
|
return Family(self.variable_names(), lambda x: d[x])
|
|
804
804
|
|
|
805
|
-
def gens(self):
|
|
805
|
+
def gens(self) -> tuple:
|
|
806
806
|
r"""
|
|
807
807
|
Return the generators of ``self`` (as an algebra).
|
|
808
808
|
|
|
Binary file
|
|
@@ -16,13 +16,15 @@ AUTHORS:
|
|
|
16
16
|
# it under the terms of the GNU General Public License as published by
|
|
17
17
|
# the Free Software Foundation, either version 2 of the License, or
|
|
18
18
|
# (at your option) any later version.
|
|
19
|
-
#
|
|
19
|
+
# https://www.gnu.org/licenses/
|
|
20
20
|
# ****************************************************************************
|
|
21
|
+
from copy import copy
|
|
22
|
+
|
|
21
23
|
from sage.structure.parent cimport Parent
|
|
22
24
|
from sage.data_structures.bitset cimport Bitset
|
|
23
25
|
from sage.algebras.weyl_algebra import repr_from_monomials
|
|
24
26
|
from sage.data_structures.blas_dict cimport scal
|
|
25
|
-
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
cdef class CliffordAlgebraElement(IndexedFreeModuleElement):
|
|
28
30
|
"""
|
|
Binary file
|
|
@@ -10,7 +10,7 @@ Finite-Dimensional Algebras
|
|
|
10
10
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
11
11
|
# as published by the Free Software Foundation; either version 2 of
|
|
12
12
|
# the License, or (at your option) any later version.
|
|
13
|
-
#
|
|
13
|
+
# https://www.gnu.org/licenses/
|
|
14
14
|
# ***************************************************************************
|
|
15
15
|
|
|
16
16
|
from .finite_dimensional_algebra_element import FiniteDimensionalAlgebraElement
|
|
@@ -19,6 +19,7 @@ from .finite_dimensional_algebra_ideal import FiniteDimensionalAlgebraIdeal
|
|
|
19
19
|
from sage.rings.integer_ring import ZZ
|
|
20
20
|
|
|
21
21
|
from sage.categories.magmatic_algebras import MagmaticAlgebras
|
|
22
|
+
from sage.categories.algebras import Algebras
|
|
22
23
|
from sage.matrix.constructor import matrix
|
|
23
24
|
from sage.structure.element import Matrix
|
|
24
25
|
from sage.structure.category_object import normalize_names
|
|
@@ -33,6 +34,9 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
33
34
|
r"""
|
|
34
35
|
Create a finite-dimensional `k`-algebra from a multiplication table.
|
|
35
36
|
|
|
37
|
+
This is a magmatic `k`-algebra, i.e., not necessarily
|
|
38
|
+
associative or unital.
|
|
39
|
+
|
|
36
40
|
INPUT:
|
|
37
41
|
|
|
38
42
|
- ``k`` -- a field
|
|
@@ -46,6 +50,10 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
46
50
|
``True``, then the category is set to ``category.Associative()``
|
|
47
51
|
and methods requiring associativity assume this
|
|
48
52
|
|
|
53
|
+
- ``assume_unital`` -- boolean (default: ``False``); if
|
|
54
|
+
``True``, then the category is set to ``category.Unital()``
|
|
55
|
+
and methods requiring unitality assume this
|
|
56
|
+
|
|
49
57
|
- ``category`` -- (default:
|
|
50
58
|
``MagmaticAlgebras(k).FiniteDimensional().WithBasis()``)
|
|
51
59
|
the category to which this algebra belongs
|
|
@@ -68,6 +76,49 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
68
76
|
....: Matrix([[0,0,0], [0,0,0], [0,0,1]])])
|
|
69
77
|
sage: B
|
|
70
78
|
Finite-dimensional algebra of degree 3 over Rational Field
|
|
79
|
+
sage: B.one()
|
|
80
|
+
e0 + e2
|
|
81
|
+
sage: B.is_associative()
|
|
82
|
+
True
|
|
83
|
+
|
|
84
|
+
A more complicated example (the descent algebra of `S_3` in
|
|
85
|
+
a slightly rescaled I-basis, see :class:`DescentAlgebra`)::
|
|
86
|
+
|
|
87
|
+
sage: Ma = Matrix([[6,0,0,0], [0,0,0,0], [0,0,0,0], [0,0,0,0]])
|
|
88
|
+
sage: Mb = Matrix([[0,0,0,0], [0,1,0,0], [0,1,0,0], [0,0,0,0]])
|
|
89
|
+
sage: Mc = Matrix([[0,0,0,0], [0,0,1,0], [0,0,1,0], [0,0,0,0]])
|
|
90
|
+
sage: Md = Matrix([[0,0,0,0], [0,1,-1,0], [0,-1,1,0], [0,0,0,2]])
|
|
91
|
+
sage: C = FiniteDimensionalAlgebra(QQ, [Ma, Mb, Mc, Md])
|
|
92
|
+
sage: C.one()
|
|
93
|
+
1/6*e0 + 1/2*e1 + 1/2*e2 + 1/2*e3
|
|
94
|
+
sage: C.is_associative()
|
|
95
|
+
True
|
|
96
|
+
sage: C.is_commutative()
|
|
97
|
+
False
|
|
98
|
+
|
|
99
|
+
If we set both ``is_associative`` and ``is_unital`` to
|
|
100
|
+
``True``, then this is an associative unital algebra and
|
|
101
|
+
belongs to the category of
|
|
102
|
+
:class:`sage.categories.finite_dimensional_algebras_with_basis.FiniteDimensionalAlgebrasWithBasis`::
|
|
103
|
+
|
|
104
|
+
sage: C = FiniteDimensionalAlgebra(QQ, [Ma, Mb, Mc, Md],
|
|
105
|
+
....: assume_associative=True,
|
|
106
|
+
....: assume_unital=True)
|
|
107
|
+
sage: C.radical_basis()
|
|
108
|
+
(e1 - e2,)
|
|
109
|
+
sage: C.radical()
|
|
110
|
+
Radical of Finite-dimensional algebra of degree 4 over Rational Field
|
|
111
|
+
sage: C.center_basis()
|
|
112
|
+
(e0, e1 + e2 + e3)
|
|
113
|
+
sage: C.center()
|
|
114
|
+
Center of Finite-dimensional algebra of degree 4 over Rational Field
|
|
115
|
+
sage: C.center().is_commutative()
|
|
116
|
+
True
|
|
117
|
+
sage: e = C.basis()
|
|
118
|
+
sage: C.annihilator_basis([e[1]])
|
|
119
|
+
(e0, e1 - e2, e3)
|
|
120
|
+
sage: C.annihilator_basis([e[1]], side='left')
|
|
121
|
+
(e0, e1 - e2 - e3)
|
|
71
122
|
|
|
72
123
|
TESTS::
|
|
73
124
|
|
|
@@ -83,7 +134,7 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
83
134
|
"""
|
|
84
135
|
@staticmethod
|
|
85
136
|
def __classcall_private__(cls, k, table, names='e', assume_associative=False,
|
|
86
|
-
category=None):
|
|
137
|
+
assume_unital=False, category=None):
|
|
87
138
|
"""
|
|
88
139
|
Normalize input.
|
|
89
140
|
|
|
@@ -106,6 +157,26 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
106
157
|
sage: A1 is A2
|
|
107
158
|
True
|
|
108
159
|
|
|
160
|
+
Likewise for the ``assume_associative`` keyword::
|
|
161
|
+
|
|
162
|
+
sage: A3 = FiniteDimensionalAlgebra(GF(3), table,
|
|
163
|
+
....: category=cat.Unital())
|
|
164
|
+
sage: A4 = FiniteDimensionalAlgebra(GF(3), table, assume_unital=True)
|
|
165
|
+
sage: A3 is A4
|
|
166
|
+
True
|
|
167
|
+
|
|
168
|
+
With both keywords on, the
|
|
169
|
+
:class:`sage.categories.algebras.Algebras` category
|
|
170
|
+
is used::
|
|
171
|
+
|
|
172
|
+
sage: cat_a = Algebras(GF(3)).FiniteDimensional().WithBasis()
|
|
173
|
+
sage: A5 = FiniteDimensionalAlgebra(GF(3), table,
|
|
174
|
+
....: category=cat_a)
|
|
175
|
+
sage: A6 = FiniteDimensionalAlgebra(GF(3), table, assume_associative=True,
|
|
176
|
+
....: assume_unital=True)
|
|
177
|
+
sage: A5 is A6
|
|
178
|
+
True
|
|
179
|
+
|
|
109
180
|
Uniqueness depends on the category::
|
|
110
181
|
|
|
111
182
|
sage: cat = Algebras(GF(3)).FiniteDimensional().WithBasis()
|
|
@@ -145,6 +216,12 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
145
216
|
cat = cat.or_subcategory(category)
|
|
146
217
|
if assume_associative:
|
|
147
218
|
cat = cat.Associative()
|
|
219
|
+
if assume_unital:
|
|
220
|
+
# both unital and associative, so algebra in modern sense
|
|
221
|
+
cat = Algebras(k).FiniteDimensional().WithBasis()
|
|
222
|
+
cat = cat.or_subcategory(category)
|
|
223
|
+
elif assume_unital:
|
|
224
|
+
cat = cat.Unital()
|
|
148
225
|
|
|
149
226
|
names = normalize_names(n, names)
|
|
150
227
|
|
|
@@ -611,10 +688,10 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
611
688
|
v = matrix(k, 1, n**2, (n - 1) * ([kone] + n * [kzero]) + [kone])
|
|
612
689
|
try:
|
|
613
690
|
sol1 = B1.solve_left(v)
|
|
614
|
-
sol2 = B2.solve_left(v)
|
|
615
691
|
except ValueError:
|
|
616
692
|
return False
|
|
617
|
-
|
|
693
|
+
if sol1 * B2 != v:
|
|
694
|
+
return False
|
|
618
695
|
self._one = sol1
|
|
619
696
|
return True
|
|
620
697
|
|
|
@@ -932,7 +1009,8 @@ class FiniteDimensionalAlgebra(UniqueRepresentation, Parent):
|
|
|
932
1009
|
"""
|
|
933
1010
|
Return a list consisting of all maximal ideals of ``self``.
|
|
934
1011
|
|
|
935
|
-
The algebra ``self`` has to be in the category of
|
|
1012
|
+
The algebra ``self`` has to be in the category of
|
|
1013
|
+
commutative, associative algebras.
|
|
936
1014
|
|
|
937
1015
|
EXAMPLES::
|
|
938
1016
|
|
sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so
CHANGED
|
Binary file
|
|
@@ -7,4 +7,6 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
7
7
|
cdef Matrix __matrix
|
|
8
8
|
cdef FiniteDimensionalAlgebraElement __inverse
|
|
9
9
|
|
|
10
|
+
cpdef dict monomial_coefficients(self, bint copy=*)
|
|
11
|
+
|
|
10
12
|
cpdef FiniteDimensionalAlgebraElement unpickle_FiniteDimensionalAlgebraElement(A, vec, mat)
|
|
@@ -132,6 +132,7 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
132
132
|
else:
|
|
133
133
|
raise TypeError("elt should be a vector, a matrix, " +
|
|
134
134
|
"or an element of the base field")
|
|
135
|
+
self._vector.set_immutable()
|
|
135
136
|
|
|
136
137
|
def __reduce__(self):
|
|
137
138
|
"""
|
|
@@ -205,6 +206,7 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
205
206
|
table = <tuple> A.table()
|
|
206
207
|
ret = sum(self._vector[0, i] * table[i] for i in range(A.degree()))
|
|
207
208
|
self.__matrix = MatrixSpace(A.base_ring(), A.degree())(ret)
|
|
209
|
+
self.__matrix.set_immutable()
|
|
208
210
|
return self.__matrix
|
|
209
211
|
|
|
210
212
|
def vector(self):
|
|
@@ -240,7 +242,7 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
240
242
|
"""
|
|
241
243
|
return self._matrix
|
|
242
244
|
|
|
243
|
-
|
|
245
|
+
cpdef dict monomial_coefficients(self, bint copy=True):
|
|
244
246
|
"""
|
|
245
247
|
Return a dictionary whose keys are indices of basis elements in
|
|
246
248
|
the support of ``self`` and whose values are the corresponding
|
|
@@ -257,9 +259,10 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
257
259
|
sage: elt = B(Matrix([[1,1], [-1,1]]))
|
|
258
260
|
sage: elt.monomial_coefficients()
|
|
259
261
|
{0: 1, 1: 1}
|
|
262
|
+
sage: B.one().monomial_coefficients()
|
|
263
|
+
{0: 1}
|
|
260
264
|
"""
|
|
261
|
-
|
|
262
|
-
return {i: self._vector[0, i] for i in range(self._vector.ncols())}
|
|
265
|
+
return {k[1]: c for k, c in self._vector._dict().items()}
|
|
263
266
|
|
|
264
267
|
def left_matrix(self):
|
|
265
268
|
"""
|
|
@@ -335,6 +338,23 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
335
338
|
from sage.misc.latex import latex
|
|
336
339
|
return latex(self.matrix())
|
|
337
340
|
|
|
341
|
+
def __hash__(self):
|
|
342
|
+
"""
|
|
343
|
+
Return the hash value for ``self``.
|
|
344
|
+
|
|
345
|
+
EXAMPLES::
|
|
346
|
+
|
|
347
|
+
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1,0], [0,1]]),
|
|
348
|
+
....: Matrix([[0,1], [0,0]])])
|
|
349
|
+
sage: a = A([1,2])
|
|
350
|
+
sage: b = A([2,3])
|
|
351
|
+
sage: hash(a) == hash(A([1,2]))
|
|
352
|
+
True
|
|
353
|
+
sage: hash(a) == hash(b)
|
|
354
|
+
False
|
|
355
|
+
"""
|
|
356
|
+
return hash(self._vector)
|
|
357
|
+
|
|
338
358
|
def __getitem__(self, m):
|
|
339
359
|
"""
|
|
340
360
|
Return the `m`-th coefficient of ``self``.
|
|
@@ -351,6 +371,9 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
351
371
|
|
|
352
372
|
def __len__(self):
|
|
353
373
|
"""
|
|
374
|
+
Return the number of coefficients of ``self``,
|
|
375
|
+
including the zero coefficients.
|
|
376
|
+
|
|
354
377
|
EXAMPLES::
|
|
355
378
|
|
|
356
379
|
sage: A = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,0]]),
|
|
@@ -358,6 +381,8 @@ cdef class FiniteDimensionalAlgebraElement(AlgebraElement):
|
|
|
358
381
|
....: Matrix([[0,0,0], [0,0,0], [0,0,1]])])
|
|
359
382
|
sage: len(A([2,1/4,3]))
|
|
360
383
|
3
|
|
384
|
+
sage: len(A([2,0,3/4]))
|
|
385
|
+
3
|
|
361
386
|
"""
|
|
362
387
|
return self._vector.ncols()
|
|
363
388
|
|
sage/algebras/finite_gca.py
CHANGED
|
@@ -161,7 +161,7 @@ class FiniteGCAlgebra(CombinatorialFreeModule):
|
|
|
161
161
|
raise TypeError("max_degree must be specified")
|
|
162
162
|
if names is None:
|
|
163
163
|
if degrees is None:
|
|
164
|
-
raise ValueError("
|
|
164
|
+
raise ValueError("you must specify names or degrees")
|
|
165
165
|
else:
|
|
166
166
|
n = len(degrees)
|
|
167
167
|
names = tuple(f'x{i}' for i in range(n))
|
|
@@ -18,20 +18,25 @@ AUTHORS:
|
|
|
18
18
|
# http://www.gnu.org/licenses/
|
|
19
19
|
#*****************************************************************************
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
from
|
|
21
|
+
try:
|
|
22
|
+
from typing import Self # type: ignore (Python >= 3.11)
|
|
23
|
+
except ImportError:
|
|
24
|
+
from typing_extensions import Self # type: ignore (Python 3.10)
|
|
25
|
+
|
|
26
|
+
from sage.algebras.lie_algebras.verma_module import ModulePrinting
|
|
23
27
|
from sage.categories.enumerated_sets import EnumeratedSets
|
|
24
28
|
from sage.categories.monoids import Monoids
|
|
25
|
-
from sage.structure.parent import Parent
|
|
26
|
-
from sage.structure.indexed_generators import IndexedGenerators
|
|
27
|
-
from sage.monoids.indexed_free_monoid import IndexedFreeAbelianMonoid, IndexedMonoid
|
|
28
29
|
from sage.combinat.free_module import CombinatorialFreeModule
|
|
29
|
-
from sage.
|
|
30
|
-
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
|
|
30
|
+
from sage.data_structures.blas_dict import iaxpy
|
|
31
31
|
from sage.matrix.constructor import matrix
|
|
32
|
+
from sage.misc.cachefunc import cached_method
|
|
33
|
+
from sage.misc.lazy_attribute import lazy_attribute
|
|
34
|
+
from sage.monoids.indexed_free_monoid import IndexedFreeAbelianMonoid, IndexedMonoid
|
|
32
35
|
from sage.rings.integer_ring import ZZ
|
|
33
|
-
from sage.
|
|
34
|
-
from sage.
|
|
36
|
+
from sage.sets.family import Family
|
|
37
|
+
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
|
|
38
|
+
from sage.structure.indexed_generators import IndexedGenerators
|
|
39
|
+
from sage.structure.parent import Parent
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
class BGGDualModule(CombinatorialFreeModule):
|
|
@@ -781,7 +786,9 @@ class SimpleModuleIndices(IndexedFreeAbelianMonoid):
|
|
|
781
786
|
P = Phi.weight_lattice()
|
|
782
787
|
coroots = Phi.root_lattice().simple_coroots()
|
|
783
788
|
la = P._from_dict({i: weight.scalar(ac) for i, ac in coroots.items()})
|
|
784
|
-
from sage.combinat.crystals.monomial_crystals import
|
|
789
|
+
from sage.combinat.crystals.monomial_crystals import (
|
|
790
|
+
CrystalOfNakajimaMonomials,
|
|
791
|
+
)
|
|
785
792
|
return CrystalOfNakajimaMonomials(la).cardinality()
|
|
786
793
|
from sage.rings.infinity import infinity
|
|
787
794
|
return infinity
|
|
@@ -981,7 +988,7 @@ class SimpleModule(ModulePrinting, CombinatorialFreeModule):
|
|
|
981
988
|
raise ValueError(f"{m} does not index a basis element")
|
|
982
989
|
return self._indices._basis[m]
|
|
983
990
|
|
|
984
|
-
def dual(self):
|
|
991
|
+
def dual(self) -> Self:
|
|
985
992
|
r"""
|
|
986
993
|
Return the dual module of ``self``, which is ``self`` since simple
|
|
987
994
|
modules are self-dual.
|
|
@@ -1713,7 +1713,7 @@ class LieAlgebraChevalleyBasis(LieAlgebraWithStructureCoefficients):
|
|
|
1713
1713
|
|
|
1714
1714
|
sage: sl3 = LieAlgebra(GF(3), cartan_type=['A',2])
|
|
1715
1715
|
sage: sl3.center().basis()
|
|
1716
|
-
|
|
1716
|
+
Finite family {alphacheck[2]: 2*h1 + h2}
|
|
1717
1717
|
sage: sl4 = lie_algebras.sl(GF(3), 4)
|
|
1718
1718
|
sage: sl4.center().dimension()
|
|
1719
1719
|
0
|
|
@@ -1735,7 +1735,7 @@ class LieAlgebraChevalleyBasis(LieAlgebraWithStructureCoefficients):
|
|
|
1735
1735
|
|
|
1736
1736
|
sage: sl4 = LieAlgebra(GF(2), cartan_type=['A',3])
|
|
1737
1737
|
sage: sl4.center().basis()
|
|
1738
|
-
|
|
1738
|
+
Finite family {alphacheck[3]: h1 + h3}
|
|
1739
1739
|
sage: sp6 = LieAlgebra(GF(2), cartan_type=['C',3])
|
|
1740
1740
|
sage: sp6.killing_form_matrix().det()
|
|
1741
1741
|
0
|
|
@@ -2172,7 +2172,7 @@ class LieAlgebraChevalleyBasis(LieAlgebraWithStructureCoefficients):
|
|
|
2172
2172
|
return Family(I, d.__getitem__)
|
|
2173
2173
|
|
|
2174
2174
|
@cached_method
|
|
2175
|
-
def gens(self):
|
|
2175
|
+
def gens(self) -> tuple:
|
|
2176
2176
|
r"""
|
|
2177
2177
|
Return the generators of ``self`` in the order of `e_i`, `f_i`,
|
|
2178
2178
|
and `h_i`.
|
|
@@ -169,7 +169,7 @@ def three_dimensional_by_rank(R, n, a=None, names=['X', 'Y', 'Z']):
|
|
|
169
169
|
|
|
170
170
|
if n == 2:
|
|
171
171
|
if a is None:
|
|
172
|
-
raise ValueError("
|
|
172
|
+
raise ValueError("the parameter 'a' must be specified")
|
|
173
173
|
X = names[0]
|
|
174
174
|
Y = names[1]
|
|
175
175
|
Z = names[2]
|
|
@@ -197,7 +197,7 @@ def three_dimensional_by_rank(R, n, a=None, names=['X', 'Y', 'Z']):
|
|
|
197
197
|
L.rename("sl2 over {}".format(R))
|
|
198
198
|
return L
|
|
199
199
|
|
|
200
|
-
raise ValueError("
|
|
200
|
+
raise ValueError("invalid rank")
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
def affine_transformations_line(R, names=['X', 'Y'], representation='bracket'):
|
|
@@ -8,15 +8,15 @@ AUTHORS:
|
|
|
8
8
|
- Travis Scrimshaw (2013-08-13): Initial version
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# ***************************************************************************
|
|
12
12
|
# Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
|
|
13
13
|
#
|
|
14
14
|
# This program is free software: you can redistribute it and/or modify
|
|
15
15
|
# it under the terms of the GNU General Public License as published by
|
|
16
16
|
# the Free Software Foundation, either version 2 of the License, or
|
|
17
17
|
# (at your option) any later version.
|
|
18
|
-
#
|
|
19
|
-
|
|
18
|
+
# https://www.gnu.org/licenses/
|
|
19
|
+
# ***************************************************************************
|
|
20
20
|
|
|
21
21
|
from sage.misc.cachefunc import cached_method
|
|
22
22
|
from sage.structure.indexed_generators import IndexedGenerators
|
|
@@ -236,7 +236,7 @@ class HeisenbergAlgebra_fd:
|
|
|
236
236
|
return self._n
|
|
237
237
|
|
|
238
238
|
@cached_method
|
|
239
|
-
def gens(self):
|
|
239
|
+
def gens(self) -> tuple:
|
|
240
240
|
"""
|
|
241
241
|
Return the Lie algebra generators of ``self``.
|
|
242
242
|
|
|
@@ -825,7 +825,7 @@ class LieAlgebraWithGenerators(LieAlgebra):
|
|
|
825
825
|
return Family(self._indices, self.monomial, name="monomial map")
|
|
826
826
|
|
|
827
827
|
@cached_method
|
|
828
|
-
def gens(self):
|
|
828
|
+
def gens(self) -> tuple:
|
|
829
829
|
"""
|
|
830
830
|
Return a tuple whose entries are the generators for this
|
|
831
831
|
object, in some order.
|
|
Binary file
|
|
@@ -23,7 +23,6 @@ from cpython.object cimport Py_EQ, Py_NE, Py_GT, Py_GE
|
|
|
23
23
|
from sage.misc.repr import repr_lincomb
|
|
24
24
|
from sage.structure.element cimport have_same_parent, parent
|
|
25
25
|
from sage.structure.coerce cimport coercion_model
|
|
26
|
-
from sage.cpython.wrapperdescr cimport wrapperdescr_fastcall
|
|
27
26
|
from sage.structure.element_wrapper cimport ElementWrapper
|
|
28
27
|
from sage.structure.richcmp cimport richcmp, richcmp_not_equal
|
|
29
28
|
from sage.data_structures.blas_dict cimport axpy, add, negate, scal
|
|
@@ -67,11 +66,28 @@ cdef class LieAlgebraElement(IndexedFreeModuleElement):
|
|
|
67
66
|
"""
|
|
68
67
|
try:
|
|
69
68
|
# Try the normal coercion first
|
|
70
|
-
return
|
|
71
|
-
left, (right,), <object>NULL)
|
|
69
|
+
return IndexedFreeModuleElement.__mul__(left, right)
|
|
72
70
|
except TypeError:
|
|
73
71
|
pass
|
|
74
72
|
|
|
73
|
+
try:
|
|
74
|
+
# Handle the case of right multiplication by scalar
|
|
75
|
+
if isinstance(left, IndexedFreeModuleElement):
|
|
76
|
+
R = (<IndexedFreeModuleElement>left)._parent._base
|
|
77
|
+
x = R.coerce(right)
|
|
78
|
+
return IndexedFreeModuleElement.__mul__(left, x)
|
|
79
|
+
except (TypeError, KeyError):
|
|
80
|
+
pass
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
# Handle the case of left multiplication by scalar
|
|
84
|
+
if isinstance(right, IndexedFreeModuleElement):
|
|
85
|
+
R = (<IndexedFreeModuleElement>right)._parent._base
|
|
86
|
+
x = R.coerce(left)
|
|
87
|
+
return IndexedFreeModuleElement.__mul__(x, right)
|
|
88
|
+
except (TypeError, KeyError):
|
|
89
|
+
pass
|
|
90
|
+
|
|
75
91
|
# Lift up to the UEA and try multiplication there
|
|
76
92
|
# We will eventually want to lift stuff up anyways,
|
|
77
93
|
# so just do it here.
|
|
@@ -117,7 +133,7 @@ cdef class LieAlgebraElement(IndexedFreeModuleElement):
|
|
|
117
133
|
s = codomain.zero()
|
|
118
134
|
if not self: # If we are 0
|
|
119
135
|
return s
|
|
120
|
-
names = self.
|
|
136
|
+
names = self._parent.variable_names()
|
|
121
137
|
if base_map is None:
|
|
122
138
|
def base_map(x):
|
|
123
139
|
return x
|
|
@@ -353,11 +369,28 @@ cdef class LieAlgebraElementWrapper(ElementWrapper):
|
|
|
353
369
|
"""
|
|
354
370
|
try:
|
|
355
371
|
# Try the normal coercion first
|
|
356
|
-
return
|
|
357
|
-
left, (right,), <object>NULL)
|
|
372
|
+
return ElementWrapper.__mul__(left, right)
|
|
358
373
|
except TypeError:
|
|
359
374
|
pass
|
|
360
375
|
|
|
376
|
+
try:
|
|
377
|
+
# Handle the case of right multiplication by scalar
|
|
378
|
+
if isinstance(left, LieAlgebraElementWrapper):
|
|
379
|
+
R = (<LieAlgebraElementWrapper>left)._parent._base
|
|
380
|
+
x = R.coerce(right)
|
|
381
|
+
return ElementWrapper.__mul__(left, x)
|
|
382
|
+
except (TypeError, KeyError):
|
|
383
|
+
pass
|
|
384
|
+
|
|
385
|
+
try:
|
|
386
|
+
# Handle the case of left multiplication by scalar
|
|
387
|
+
if isinstance(right, LieAlgebraElementWrapper):
|
|
388
|
+
R = (<LieAlgebraElementWrapper>right)._parent._base
|
|
389
|
+
x = R.coerce(left)
|
|
390
|
+
return ElementWrapper.__mul__(x, right)
|
|
391
|
+
except (TypeError, KeyError):
|
|
392
|
+
pass
|
|
393
|
+
|
|
361
394
|
# Lift up to the UEA and try multiplication there
|
|
362
395
|
# We will eventually want to lift stuff up anyways,
|
|
363
396
|
# so just do it here.
|
|
@@ -517,10 +550,12 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
517
550
|
|
|
518
551
|
sage: L.<X,Y,Z> = LieAlgebra(QQ, {('X','Y'): {'Z': 1}})
|
|
519
552
|
sage: S = L.subalgebra([X, Y])
|
|
553
|
+
sage: S.indices()
|
|
554
|
+
{'X', 'Y', 'Z'}
|
|
520
555
|
sage: el = S(2*Y + 9*Z)
|
|
521
|
-
sage: el[
|
|
556
|
+
sage: el['Y']
|
|
522
557
|
2
|
|
523
|
-
sage: el[
|
|
558
|
+
sage: el['Z']
|
|
524
559
|
9
|
|
525
560
|
"""
|
|
526
561
|
if self._monomial_coefficients is None:
|
|
@@ -529,7 +564,7 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
529
564
|
try:
|
|
530
565
|
return self._monomial_coefficients[i]
|
|
531
566
|
except KeyError:
|
|
532
|
-
return self.
|
|
567
|
+
return self._parent.base_ring().zero()
|
|
533
568
|
|
|
534
569
|
def _bracket_(self, x):
|
|
535
570
|
"""
|
|
@@ -561,12 +596,12 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
561
596
|
sage: L.<X,Y,Z> = LieAlgebra(ZZ, {('X','Y'): {'Z': 3}})
|
|
562
597
|
sage: S = L.subalgebra([X, Y])
|
|
563
598
|
sage: S.basis()
|
|
564
|
-
|
|
599
|
+
Finite family {'X': X, 'Y': Y, 'Z': 3*Z}
|
|
565
600
|
sage: S(2*Y + 9*Z).to_vector()
|
|
566
601
|
(0, 2, 9)
|
|
567
602
|
sage: S2 = L.subalgebra([Y, Z])
|
|
568
603
|
sage: S2.basis()
|
|
569
|
-
|
|
604
|
+
Finite family {'Y': Y, 'Z': Z}
|
|
570
605
|
sage: S2(2*Y + 9*Z).to_vector()
|
|
571
606
|
(0, 2, 9)
|
|
572
607
|
|
|
@@ -601,17 +636,18 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
601
636
|
sage: L.<X,Y,Z> = LieAlgebra(ZZ, {('X','Y'): {'Z': 3}})
|
|
602
637
|
sage: S = L.subalgebra([X, Y])
|
|
603
638
|
sage: S(2*Y + 9*Z).monomial_coefficients()
|
|
604
|
-
{
|
|
639
|
+
{'Y': 2, 'Z': 3}
|
|
605
640
|
sage: S2 = L.subalgebra([Y, Z])
|
|
606
641
|
sage: S2(2*Y + 9*Z).monomial_coefficients()
|
|
607
|
-
{
|
|
642
|
+
{'Y': 2, 'Z': 9}
|
|
608
643
|
"""
|
|
609
644
|
cdef Py_ssize_t k
|
|
645
|
+
indices = self._parent._indices
|
|
610
646
|
if self._monomial_coefficients is None:
|
|
611
|
-
sm = self.
|
|
647
|
+
sm = self._parent.module()
|
|
612
648
|
v = sm.coordinate_vector(self.to_vector())
|
|
613
|
-
self._monomial_coefficients = {k: v[k]
|
|
614
|
-
if v[k]}
|
|
649
|
+
self._monomial_coefficients = {indices[k]: v[k]
|
|
650
|
+
for k in range(len(v)) if v[k]}
|
|
615
651
|
if copy:
|
|
616
652
|
return dict(self._monomial_coefficients)
|
|
617
653
|
return self._monomial_coefficients
|
|
@@ -627,13 +663,13 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
627
663
|
sage: a = S(2*Y + 12*Z)
|
|
628
664
|
sage: b = S(X + 2*Y)
|
|
629
665
|
sage: (a + b).monomial_coefficients()
|
|
630
|
-
{
|
|
666
|
+
{'X': 1, 'Y': 4, 'Z': 4}
|
|
631
667
|
sage: a.monomial_coefficients() # We set a._monomial_coefficients
|
|
632
|
-
{
|
|
668
|
+
{'Y': 2, 'Z': 4}
|
|
633
669
|
sage: b.monomial_coefficients() # We set b._monomial_coefficients
|
|
634
|
-
{
|
|
670
|
+
{'X': 1, 'Y': 2}
|
|
635
671
|
sage: (a + b).monomial_coefficients() # This is now computed from a and b
|
|
636
|
-
{
|
|
672
|
+
{'X': 1, 'Y': 4, 'Z': 4}
|
|
637
673
|
"""
|
|
638
674
|
cdef LieSubalgebraElementWrapper ret, other = <LieSubalgebraElementWrapper> right
|
|
639
675
|
ret = type(self)(self._parent, self.value + other.value)
|
|
@@ -653,13 +689,13 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
653
689
|
sage: a = S(2*Y + 12*Z)
|
|
654
690
|
sage: b = S(X + 2*Y)
|
|
655
691
|
sage: (a - b).monomial_coefficients()
|
|
656
|
-
{
|
|
692
|
+
{'X': -1, 'Z': 4}
|
|
657
693
|
sage: a.monomial_coefficients() # We set a._monomial_coefficients
|
|
658
|
-
{
|
|
694
|
+
{'Y': 2, 'Z': 4}
|
|
659
695
|
sage: b.monomial_coefficients() # We set b._monomial_coefficients
|
|
660
|
-
{
|
|
696
|
+
{'X': 1, 'Y': 2}
|
|
661
697
|
sage: (a - b).monomial_coefficients() # This is now computed from a and b
|
|
662
|
-
{
|
|
698
|
+
{'X': -1, 'Z': 4}
|
|
663
699
|
"""
|
|
664
700
|
cdef LieSubalgebraElementWrapper ret, other = <LieSubalgebraElementWrapper> right
|
|
665
701
|
ret = type(self)(self._parent, self.value - other.value)
|
|
@@ -678,11 +714,11 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper):
|
|
|
678
714
|
sage: S = L.subalgebra([X, Y])
|
|
679
715
|
sage: a = S(2*Y + 12*Z)
|
|
680
716
|
sage: (2*a).monomial_coefficients()
|
|
681
|
-
{
|
|
717
|
+
{'Y': 4, 'Z': 8}
|
|
682
718
|
sage: a.monomial_coefficients() # We set a._monomial_coefficients
|
|
683
|
-
{
|
|
719
|
+
{'Y': 2, 'Z': 4}
|
|
684
720
|
sage: (2*a).monomial_coefficients() # This is now computed from a
|
|
685
|
-
{
|
|
721
|
+
{'Y': 4, 'Z': 8}
|
|
686
722
|
"""
|
|
687
723
|
# This was copied and IDK if it still applies (TCS):
|
|
688
724
|
# With the current design, the coercion model does not have
|