Giter VIP home page Giter VIP logo

Comments (5)

tueda avatar tueda commented on August 27, 2024

Maybe, we could always enclose dot products in parentheses, even when not needed. This may be easier to implement than enclosing or not enclosing dot products in parentheses depending on context.

For reference, operator precedence in Mathematica:

https://reference.wolfram.com/language/tutorial/OperatorInputForms.html

The binary operator . (Dot) has a lower precedence than the binary operator ^ (Power).

from form.

vermaseren avatar vermaseren commented on August 27, 2024

from form.

tueda avatar tueda commented on August 27, 2024

I guess Mathematica treats 3.2 as an "atom". So, 3.2^4 is fine.

Indeed,

3.2^a

gives

Power[3.2`, a]

and

p.q^a

gives

Dot[p, Power[q, a]]

from form.

vermaseren avatar vermaseren commented on August 27, 2024

from form.

tueda avatar tueda commented on August 27, 2024

The dot operator perfectly works with vectors/tensors in a reasonable way.

For example, the Mathematica code

{1, 2}.{3, 4}^2

gives

41

This is the same as other languages, like Python:

import numpy as np

a = np.array([1, 2])
b = np.array([3, 4])

a@b**2

which also gives 41, not 121.

I think an expression $p \cdot q^2$ in math or physics papers would be understood as $p \cdot (q^2)$.

from form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.