# Add operator @ for matrix multiplication

**URL:** <https://internals.rust-lang.org/t/add-operator-for-matrix-multiplication/16026>\
**Category:** language design\
**Created:** [January 26, 2022, 8:47am UTC](https://internals.rust-lang.org/t/add-operator-for-matrix-multiplication/16026 "2022-01-26T08:47:03Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![steffahn](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/steffahn/32/13288_2.png) [@steffahn](https://internals.rust-lang.org/u/steffahn)\
**Post date:** [January 26, 2022, 2:24pm UTC](https://internals.rust-lang.org/t/add-operator-for-matrix-multiplication/16026/17 "2022-01-26T14:24:19Z")

</div>

> [@pipehappy](#):
>
> But 1. the @ is already in the language and its description is in the bottom section of that chapter in the book, 2. it's used as dot product in other language, thus less surprise.

For the record, `@` already has a meaning in Rust, as a binary operator in patterns. The fact that this meaning has nothing to do with matrix multiplication is rather an argument _against_ using `@`.

Also note that you seem to be using the term “[dot product](https://en.wikipedia.org/wiki/Dot_product)” wrong. It’s IMO rather unfortunate that python’s `.dot` method, as well as Rust’s [ndarray](https://docs.rs/ndarray/latest/ndarray/struct.ArrayBase.html#method.dot-1) use a method called “dot” for matrix multiplication (even though, for two vectors, the dot product [aka “scalar product”] _can_ be the same as matrix multiplication, if the left one is made into a row-vector and the second into a column-vector).

Also note that I’ve personally _never_ seen “@” being used for matrix multiplication before in any programming language that I knew (I obviously don’t know Python all that well).

---

_[View the full topic](https://internals.rust-lang.org/t/add-operator-for-matrix-multiplication/16026)._
