Skip to content

vector-vector produc ts #396

@nbruin

Description

@nbruin

Multiplying a mix of vectors and matrices is allowed presently in sage, but it is not associative:

v=vector([1,2,3])
M=matrix([[1,0],[0,1],[1,1]])
w=vector([1,2])

print v*  M*w
print (v*M)*w
print v*(M*w)
///
(4, 10)
(4, 10)
(1, 4, 9)

It is a combination of vectors not knowing whether they are row- or column vectors (probably good)
and that v * w has the odd meaning of doing a component-wise multiplication. Perhaps it inherits the method from lists or something? It would be safest to explicitly cast an error if one tries to multiply vectors.

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/396

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions