Opened 10 years ago

Last modified 10 years ago

#11553 closed enhancement

Matrix morphism additions — at Version 5

Reported by: rbeezer Owned by: jason, was
Priority: minor Milestone: sage-4.7.2
Component: linear algebra Keywords: sd32 bijective identity inverse
Cc: SimonKing, mmarco Merged in:
Authors: Rob Beezer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #11552 Stopgaps:

Status badges

Description (last modified by rbeezer)

Adds three methods to the matrix morphism class:

  1. is_bijective()
  2. is_identity()
  3. inverse()

I did not notice that __invert___ via ~ was available by using tab-completion, which should explain the last one.

If there is a theme, it is better support for compositions of these morphisms.

Depends

  1. #11552

Apply:

  1. trac_11553-matrix-morphisms-additions-v2.patch

Change History (8)

Changed 10 years ago by rbeezer

comment:1 Changed 10 years ago by rbeezer

  • Authors set to Rob Beezer
  • Cc SimonKing mmarco added
  • Dependencies set to #11552
  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 10 years ago by mmarco

The surjectivity test doesn't work fine over other euclidian domains:

sage: R=PolynomialRing(QQ,'x')
sage: A=FreeModule(R,2)
sage: B=FreeModule(R,2)
sage: H=A.hom([B([x^2-1,1]),B([x^2,1])])
sage: H   
Free module morphism defined by the matrix
[x^2 - 1       1]
[    x^2       1]
Domain: Ambient free module of rank 2 over the principal ideal domain ...
Codomain: Ambient free module of rank 2 over the principal ideal domain ...
sage: H.image()
Free module of degree 2 and rank 2 over Univariate Polynomial Ring in x over Rational Field
Echelon basis matrix:
[ 1  0]
[ 0 -1]        
sage: H.is_surjective()
False
sage: H.is_injective()
True
sage: H.inverse()
Free module morphism defined by the matrix
[      -1        1]
[     x^2 -x^2 + 1]
Domain: Ambient free module of rank 2 over the principal ideal domain ...
Codomain: Ambient free module of rank 2 over the principal ideal domain ...
sage: H.is_identity()
False

But

sage: F=A.hom([B([x^2-1,1]),B([-x^2,-1])])
sage: F.image()
Free module of degree 2 and rank 2 over Univariate Polynomial Ring in x over Rational Field
Echelon basis matrix:
[1 0]
[0 1]     
sage: F.is_surjective()
True
sage: F.is         
sage: F.is_identity()
False

I think the problem is in ticket 11552, it still needs work.

comment:3 Changed 10 years ago by rbeezer

Strikes me there is a more general problem with free module equality, which I will ask about on sage-devel:

sage: R = PolynomialRing(QQ, 'a')
sage: x = vector(R, [1, 0])
sage: y = vector(R, [0, 1])
sage: z = vector(R, [0,-1])
sage: A = (R^2).span([x, y])
sage: B = (R^2).span([x, z])
sage: A == B
False
sage: A.is_submodule(B)
True
sage: B.is_submodule(A)
True

which at its root might be

sage: S = matrix([x, y])
sage: S._echelon_form_PID()[1]
[1 0]
[0 1]
sage: T = matrix([x, z])
sage: T._echelon_form_PID()[1]
[ 1  0]
[ 0 -1]

comment:4 Changed 10 years ago by rbeezer

See #11579 for an isolation of the problem above. Surjectivity will be fixed on #11552.

comment:5 Changed 10 years ago by rbeezer

  • Description modified (diff)

v2 patch adds a nullity() method for matrix morphisms, as a companion to the rank() method.

Note: See TracTickets for help on using tickets.