Opened 11 years ago

Last modified 2 years ago

#10501 closed task

Deprecate adjoint in favor of adjugate — at Version 15

Reported by: rbeezer Owned by: jason, was
Priority: minor Milestone: sage-8.7
Component: linear algebra Keywords: notation, linear algebra, adjugate, matrices, determinants
Cc: was, mvngu, kohel, tornaria, mjo Merged in:
Authors: Kwankyu Lee Reviewers:
Report Upstream: N/A Work issues:
Branch: u/klee/10501 (Commits, GitHub, GitLab) Commit: 0669f64d384d8b42838d590a41a6bf9fcb115979
Dependencies: Stopgaps:

Status badges

Description (last modified by klee)

Matrix methods named adjoint and _adjoint are renamed adjugate and _adjugate and replacements are added that raise deprecation warnings.

This is part of the program at #10465.

Change History (16)

Changed 11 years ago by rbeezer

comment:1 Changed 11 years ago by rbeezer

  • Cc was mvngu kohel tornaria added
  • Status changed from new to needs_review

Three files caused doctest errors on a full run with only the necessary changes in sage/matrix. I've made changes in these other places to fix those failures, and the affected files now pass their tests. I'm running the full suite right now.

I've cc'ed folks who I think might be able to double-check that no complications have crept in. If you want to sneak a quick look at the patch, here's a quick guide:

Minh, David: sage/crypto/classical.py, inverse_key() for a Hill Cryptosystem
Gonzalo: sage/quadratic_forms/quadratic_form_ternary_Tornaria.py, adjoints of a form
William: sage/quadratic_forms/quadratic_form.py, adjoint_primitive()

comment:2 follow-up: Changed 11 years ago by tornaria

  • Status changed from needs_review to needs_work

I already stated some objections to this on the mailing list, but I'll repeat:

On deprecating "adjoint" meaning "matrix of cofactors"

  1. it's standard terminology and has meant this in sage for long
  2. "adjugate" is newer and (IMO) less standard terminology -- in particular it has no obvious translations

On using "adjoint" meaning "conjugate transpose"

  1. "conjugate transpose" is easy to say, and it's really what is meant
  2. the "adjoint operator" for a matrix seems ill-defined, because a matrix is not an operator but only a representation of an operator in some basis.

Moreover, if there are two colliding usages of the name "adjoint", I would find it more reasonable to keep the usage that is already traditional in Sage.

The usage of "adjoint" is ubiquitous in relation to quadratic forms afaict (and, as John Cremona pointed out, is where the term originates with Gauss on ternary quadratic forms)


Reference for "Adjoint of a matrix":

Bourbaki, Elements, book 2, chapter III, section 11, exercise 9:

The adjoint of a square matrix X of order n over A is the matrix X = (det (A'")) of minors of A" of order n — 1.

(Note that the term also shows at the index of terminology of the book)

PS: searching for

"The adjoint of a square matrix" bourbaki

in books.google.com, yields the above passage.

comment:3 in reply to: ↑ 2 Changed 11 years ago by rbeezer

Replying to tornaria:

Hi Gonzalo,

I certainly read your postings to the mailing list carefully and appreciated the points you raised. However, I had not realized you were so opposed to the change.

After some discussion, I asked 'Is there any objection to deprecating the current .adjoint() function (which returns a matrix of cofactors) and renaming it as the "adjugate"?'

It was not meant to be an official vote, but I got +1 replies from Grout, Cremona, Loeffler and Stein. Dima P and Karl Crisman had earlier voiced support. There were no objections stated once I asked the question carefully. So I have been proceeding on the assumption that there was strong support.

I do not believe I changed any of the names of the commands for quadratic forms, though I can see that causing confusion if the adjoint of a matrix becomes the conjugate transpose.

I have written a patch (#10471) with the conjugate_transpose(), which I find a really clumsy command, but workable in the interim. William has suggested a more general adjoint function, which I would need to think about some more, but maybe that does not help with any of your objections (sounds like maybe that is worse in your view).

I have twice now taught a "matrix analysis" course and it seems to me that adjoint gets used regularly (but maybe not consistently) for the conjugate transpose. I am in the middle of making a major push to add significant amount of Sage code to my introductory linear algebra text, which is going very nicely. But I need to also fix my "complex inner product" since I defined it with the conjugation on the "wrong" half. So I would really like to keep Sage, my text, and the word "adjoint" all consistent with each other when I get to that point in a few weeks.

Do you have some suggestions for a way forward?

Thanks, Rob

comment:4 Changed 9 years ago by mjo

  • Cc mjo added

+1 from me. I hit this today, and just checked a handful of books:

  • Atkinson, An Introduction to Numerical Analysis, 1989. Section 7.1.
  • Axler, Linear Algebra Done Right, 1997. Ch. 6.
  • Marcus & Minc, Introduction to Linear Algebra, 1988. Section 1.4.
  • Meyer, Matrix Analysis and Applied Linear Algebra, 2000. Section 3.2.
  • Rudin, Functional Analysis, 1991. Chapter 4.
  • Shilov, Linear Algebra, 1977. Section 7.6.

All of which use the "new" meaning. In the interest of fairness, I also found,

  • Edwards, Elementary Linear Algebra, 2000. Section 3.4.

Which uses the cofactor definition.

comment:5 follow-up: Changed 9 years ago by jhpalmieri

Hmm. Given two completely different uses of the word "adjoint" in this situation, I wonder if the right solution is to avoid it completely (with a deprecation warning for a while). If we use the "new" meaning, there will still be people who type A.adjoint() expecting the old meaning, and vice versa. Something like A.conjugate_transpose() can be found by tab completion; is that good enough? Is A.adjugate() the right name for the other version?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 9 years ago by mjo

Replying to jhpalmieri:

Hmm. Given two completely different uses of the word "adjoint" in this situation, I wonder if the right solution is to avoid it completely (with a deprecation warning for a while). If we use the "new" meaning, there will still be people who type A.adjoint() expecting the old meaning, and vice versa. Something like A.conjugate_transpose() can be found by tab completion; is that good enough? Is A.adjugate() the right name for the other version?


Did someone seriously implement m.conjugate_transpose() as a shortcut for m.conjugate().transpose()? =)

I never thought to look for another method, I just did the operations individually.

From what I understand, the terms "adjoint" and "adjunct" come from higher algebra, most of which is over my head. If that's the case, books written after e.g. category theory became popular will probably gravitate towards the new terminology. Although it does suck to have to deprecate adjoint, give it a new name, and then give something else the old name.

Most of us have access to math departments; maybe we could do a survey of people working in linear algebra? If the result is overwhelming, rename it.

comment:7 in reply to: ↑ 6 ; follow-up: Changed 9 years ago by rbeezer

Replying to mjo:

Did someone seriously implement m.conjugate_transpose() as a shortcut for m.conjugate().transpose()? =)

Yep, that was me. ;-) But the BDFL suggested it. Required reading:

https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/YjImMWVVwo4

You will see a lot of support for changes. You'll see one conscientious objector. I dropped it. If someone else wants to carry the torch, I'll have their back.

Rob

comment:8 in reply to: ↑ 7 ; follow-up: Changed 9 years ago by kcrisman

Did someone seriously implement m.conjugate_transpose() as a shortcut for m.conjugate().transpose()? =)

It's not as bad as you think, because tab-completion doesn't work on m.conjugate(), though it would be awesome if Sage could magically know that...

Rob, so what does the latest version of your book do?

comment:9 in reply to: ↑ 8 Changed 9 years ago by rbeezer

Replying to kcrisman:

Rob, so what does the latest version of your book do?

conjugate-transpose has always been called "adjoint," in line with my experience teaching numerical linear algebra. I even have my inner product conjugating the correct vector now. ;-)

See: http://linear.ups.edu/html/section-MO.html#subsection-AM

I almost never have need to reference the matrix of cofactors (proposed as adjugate here), but do use it one exercise about building a matrix inverse this way.

See: Exercise PDM.T20 in http://linear.ups.edu/html/section-PDM.html

Rob

comment:10 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:11 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:12 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:13 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:14 Changed 3 years ago by klee

  • Authors set to Kwankyu Lee
  • Branch set to u/klee/10501
  • Commit set to 0669f64d384d8b42838d590a41a6bf9fcb115979
  • Milestone changed from sage-6.4 to sage-8.4
  • Priority changed from major to minor
  • Status changed from needs_work to needs_review

I want to revive this ticket. So here is the needed patch.

One thing not found in Rob's original patch is alias adjoint_classical of adjugate. The alias is used in quadratic form code in Sage.


New commits:

0669f64Deprecate adjoint for adjugate and adjoint_classical

comment:15 Changed 3 years ago by klee

  • Description modified (diff)
Note: See TracTickets for help on using tickets.