Skip to content

'ᵀ as syntax for transpose #40070

@dnadlinger

Description

@dnadlinger

PR #38062 introduces 'ᵀ into Base.

We have had a' == adjoint(a) for a long time, so it is natural to "read" a' as aᴴ, a†, a*, or whatever your preferred math notation for the Hermitian conjugate/adjoint might be. Also, aᵀ pretty unambiguously means transpose(a).

Thus, it would be natural to assume that a'ᵀ would be equivalent to a†ᵀ, that is, transpose(adjoint(a)), or (for complex matrices) the element-wise complex conjugate.

However, that is not the case in the release candidate: a'ᵀ is defined as transpose(a)!

This strikes me as highly misleading – given how naturally Julia syntax maps to common math notation in most cases, I would have bet quite a bit on the interpretation as the transposed adjoint. This is one of those cases where one interpretation seems so natural to me that I wouldn't even have considered that somebody else could view it differently.

Perhaps this quite significantly depends on the types of mathematics one is in regular contact with? My educational background is maths/physics at ETH Zurich, and I work in quantum computing research these days. This is a context in which a'ᵀ (i.e. a†ᵀ, i.e. a*ᵀ, i.e. aᴴᵀ) actually makes sense and is reasonably common – in fact, A̅ := A†ᵀ is probably the most natural way of defining complex conjugation in many category-theory approaches to quantum mechanics –, so I can believe that this interpretation might be less immediate to people in other areas.

Still, I think it is clear that the design rationale provided in #38062, where @simeonschaub writes "I feel like transpose is really the only sensible meaning of 'ᵀ," hasn't been sufficiently examined. Since we are at rc3 already, it seems the way to go would be to pull this from 1.6 and reopen the discussion on a transposition operator for 1.7.

From my point of view, this is ambiguous enough to be a net design negative for the language as a whole – but certainly for the budding Julia quantum ecosystem, where the new operator would actively cause confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions