P1504R0: On vectors, tensors, matrices, and hypermatrice Vincent Riverdy presenting Vincent: this paper is a comment following a discussion in LEWGI on Monday Vincent: I'm a physicist. This influence my choice of vocabulary Vincent: LEWGI asked if it is necessary to have both a row_vector and a column_vector Vincent: we need to get the first layer right, get the proper building block Vincent: some terms are overloaded (e.g. vector) Vincent discusses what a vector is, with different sets of axis. The mathematical structure is more than its representation Vincent: identifying a vector to its coordinates is wrong and leads to inconsistencies Vincent: a tensor is not a cube of numbers (same idea) Vincent: this leads to problems with covariance, contravariance and such Vincent: a matrix is not a rank-2 tensor, nor a geometric object. It's a rank-2 array of numbers Vincent: if we define vector wrong, it will make the desing of a tensor library of top of it difficult Vincent: we have more abstraction capabilities than C or Fortran, particularly with concepts. The only type we really need is a hypermatrix Vincent: rank 0 hypermatrices are scalars, rank 1 are vectors, etc. Vincent: standardization can be done in layers. Layer 0 is mdspan, layer 1 is mdspan + storage (what Bob called engine), layer 2 is a mathematical multidimensional array, layer 3 is a host of geometrical objects such as vectors and tensors Bob: I'm hearing that using the name vector imposes a geometrical meaning that it might be premature to apply (Vincent explains) Vincent: a vector does not reduce to its coordinates Bob: if we named things better, would we avoid this objection? Mark: should we change the dot-product? Vincent: yes Bob: std::vector will still cause a naming problem. Also, layers 0 and 1 are where we're trying to go. I think our proposal suits these Vincent: it's on layer 1 GuyD: we're on a linear algebra paper; we don't plan to move into higher abstractions Vincent: yes, but if we use the name vector the way it's used right now, we won't be able to write a proper tensor library Graham: I think you're describing how tensor libraries have been written for years: most don't even define a coordinate system, such a thing can intervene if needed, you just need to add a transform. Thus, I'm not sure why we need this thing, and if we do, their proposal is customizable enough Vincent: for users that deal with several coordinate systems, being able to inject a coordinate system will be necessary Vincent suggests names to finish his presentation Bob: the primary flaw you see is our use of the name vector. This will bring conceptual impedence mismatch later Graham: I'd argue the opposite. We should use the names that appear in existing practice. I do physics, people use the word vector Stephan: it's not new terminology Graham: it's established terminology Vincent: naming things improperly breaks invariants