Questions tagged [dot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
34 views

Factor constants out of multiple dot products

I have expressions of the type (-y A.A).(-y A.A).(A x).(A x) (* Example 1 *) (-y A.A).(-y A.A).(A x) (* Example 2 *) The number of parenthesis factors can vary, ...
Ben's user avatar
  • 239
0 votes
1 answer
98 views

Scalar product of vectors using dummy indices

How can I rewrite the following expression $expr1= (A\cdot B)(C\cdot D)(E\cdot F) + (A^\prime\cdot B^\prime)(C^\prime\cdot D^\prime)(E^\prime\cdot F^\prime) +\cdots $ in terms of the components as $...
Harken's user avatar
  • 95
1 vote
2 answers
137 views

Plotting a discrete set of data points and continuous plot together

I am struggling to plot discrete set of lines ( black dashed line around the black point) along with a continuous plot ( blue and yellow curves). Following is the problem: Basically i want to plot ...
Rakesh's user avatar
  • 169
3 votes
2 answers
228 views

Speed up dot product with shifted vector

I have to calculate multiple dot products between a vector and consecutive part of another (longer) vector, shifted at certain number of elements. Naive implementation takes about 0.1 seconds. ...
Vsevolod A.'s user avatar
8 votes
2 answers
349 views

Dot Product and Simplification

How to simplify the expression a b . x/((a b) . x) Where a is a scalar and b and x are vectors. I have tried the usual Simplify, FullSimplify, TensorExpand etc. ...
Breugem's user avatar
  • 785
1 vote
0 answers
110 views

Why is the dot operator not just matrix multiplication?

It seems to me Mathematica does not have an inbuilt matrix multiplication operator. The dot operator fails as such, as is even noted under "Possible Issues" in its documentation it ...
cbartondock's user avatar
2 votes
0 answers
65 views

Dot product of arrays that are members of the same list

Lets say I have a list of n arrays: n=3; list = Table[RandomInteger[{-10, 10}, {2, 2}], n]; I would like to calculate the matrix corresponding to: ...
Gabriele Stevanato's user avatar
1 vote
1 answer
69 views

Clarification of the $MemberQ$

There are a number of expressions: ...
dtn's user avatar
  • 2,374
2 votes
1 answer
59 views

Simplifying expressions with dot or non-commutative product (without the help of NCAlgebra)

I have two expressions (with dot and non-commutative product): $f=J^T.x+J.x$ $g=J^T**x+J**x$ I want to simplify them and get the following expressions: $f=(J^T+J).x$ $g=(J^T+J)**x$ In an attempt to ...
dtn's user avatar
  • 2,374
0 votes
1 answer
673 views

dot product and norm [closed]

Can you solve the following problem in mathematica program? Thank you. Let x=(x1,x2,x3),y=(y1,y2,y3) and ⟨x,y⟩=x1y1+2x2y2+x3y3 be an inner product in a three-dimensional real vector space. Define the ...
Hakan A.'s user avatar
2 votes
0 answers
77 views

dot product of one thousand matrices [closed]

I have a time dependent matrix. In a thousand different times with the same time intervals I get the values of the matrices. Now, how can I DOT Product these thousand matrices in time order??
Mojtaba Rezaee's user avatar
0 votes
1 answer
90 views

Want to multiply same matix n times using dot product

I want to multiply same matrix using dot product for n times. U[n_]:=Apply[Dot,[MatrixExp[-I H ]],{i,0,n}]
user68207's user avatar
0 votes
0 answers
89 views

Dot Product doesn't behave like normal function

I am trying to slightly modify the Dot function by treating it like a usual function, but soon I notice something weird about it. Suppose there is a set ...
Lelouch's user avatar
  • 513
1 vote
0 answers
59 views

Take overall minus sign in front in dot product with symbolic variables

I have the following as the output of a calculation a.b+(-a).b and I would like Mathematica to evaluate this to zero. Is there a way to specify that for my ...
Alwin's user avatar
  • 181
0 votes
0 answers
91 views

Weird behavior of ℏ (\[HBar]) symbol on TensorExpand

I was trying to implement some tools to do commutators on quantum mechanics, just for fun. Then I noted a peculiarity: ...
Jacob Hilbert's user avatar
1 vote
0 answers
68 views

Symmetry of Command Dot

I would like to work with the command Dot assuming symmetry. Specifically with the order D[v[t].v[t], t] I get the following output ...
davidivadful's user avatar
1 vote
1 answer
307 views

Nonrectangular Tensor Encountered error with rectangular matrices

I have two matrices which are rectangular. This code works with other applications I have but not this one. ...
Aeroelasticity's user avatar
2 votes
1 answer
72 views

Making Dot linear also for Kronecker Products

I want to manipulate expressions like $$\big\{(aX+bY)\otimes Z \big\}\cdot \big\{U \otimes (c V+d W) \big\} $$ so that Mathematica (10) yields $$ (aX U+bYU)\otimes(cZV+dZW) = acXU\otimes ZV+bcYU\...
João 's user avatar
  • 155
5 votes
1 answer
108 views

How can I tell `Dot` to behave automatically linear?

I would like the number $a$ to be taken out: ...
João 's user avatar
  • 155
0 votes
1 answer
311 views

Trying to find the double dot product of a Rank 4 and Rank 2 tensor

I understand this question has been asked before, or something very similar to what I'm trying to accomplish at the very least, however I didn't understand much of what was happening in the other ...
IfIcantdoithomieitcantbedone's user avatar
1 vote
0 answers
121 views

Simplifying the dot product [closed]

Why does the code D[x.x, x] /. {1. x -> x, x .1 -> x} gives 1.x+x.1, while ...
Pxx's user avatar
  • 691
2 votes
2 answers
521 views

Distribute dot and multiplication on a sum

I have a simple problem, I would like to get the following: In= Distribute[a.(b+c)*d] Out= a.b*d+a.c*d Meaning that I would like the dot product and the ...
myorbs's user avatar
  • 125
0 votes
1 answer
48 views

How to plot two functions together when one of them needs to be a series of dots, with common labels and colors?

I have two functions that I want to plot together. I want to plot the non-linear and the linear (NL and L in my code) functions together, but I wish that the NL function is plotted as a series of dots ...
Adrián Silva Caballero's user avatar
3 votes
4 answers
640 views

Dot product result has wrong dimension [closed]

I'm doing a small project and I've encountered a problem while using Mathematica. I should mention that I'm kinda new to this software, so maybe it's just something I haven't grasped yet. Anyway, I ...
slim71's user avatar
  • 35
3 votes
1 answer
421 views

How to change node color in .dot file using pattern matching?

For example I have a dot file that describe a decision tree or binary tree In the file, the color of node is always gold, so I try to change it according the number in ...
partida's user avatar
  • 6,776
0 votes
0 answers
19 views

Matrix multiplication Q.W not working - Result=matrix Q . matrix W [duplicate]

When I write the code to do the dot product between two matrices, Mathematica does not compute it: How can I get the right matrix? EDIT Thank you for your willingness.
Gennaro Arguzzi's user avatar
4 votes
2 answers
148 views

Product but with Dot operation [duplicate]

I want to describe a way to express a chain of Dot Product like this: m[13].m[12].m[11].m[10].m[9].m[8].m[7].m[6] Something like ...
user559748's user avatar
4 votes
2 answers
231 views

Nested Matrix Dotproduct

For a given matrix M[n] of size $ n\times n $ I want to define the following list of matrix-expressions: ...
Ulrich Neumann's user avatar
1 vote
1 answer
132 views

Importing a .dot graph file, and changing vertex label format

I worked out how (one way...) to import a .dot graph format file into Mathematica using ...
user avatar
3 votes
1 answer
135 views

Dot Product of Matrices in NDSolve

How to efficiently solve a system of differential equations involving matrix dot product? The example below is solved extremely fast when the array structure is flattened out. Is there a way to reach ...
tukan's user avatar
  • 407
1 vote
2 answers
2k views

dot product not working [closed]

Im supposed to take the dot product of a function and itself. The matrix is a system of 4 equations defined to be : ...
Help Me's user avatar
  • 11
3 votes
1 answer
357 views

Orthogonalize with a custom inner product

Bug introduced in 9.0 or earlier and fixed in 10.0 I was trying to define a custom inner product function for Orthogonalize, and have been getting some odd behaviour. Here's a MWE: I try to compute ...
DaftWullie's user avatar
2 votes
2 answers
316 views

Generalized n-fold inner product for tensors, iteration and indexing or built in functions?

I'm very new to Mathematica, and struggling to convert one of the codes I'd written in MATLAB. I am trying to program a function for a generalised inner product between two tensors, that is for ...
konovification's user avatar
0 votes
1 answer
994 views

Adding dots to an empty region of space [closed]

I want to add dots to the maze so far I know only how to get one dot on the maze. I don't know if there is way without using coordinates. So it would look like this with the dots added (source: ...
pacman's user avatar
  • 71
0 votes
0 answers
132 views

Expressing the output product using dot

I have an expression of the form Hbar.H where H and Hbar are vectors. How can I get the ...
Abhishek Pal's user avatar
10 votes
1 answer
368 views

TensorReduce and Dot

I'm manipulating abstract tensors with Mathematica. I have a question. With the assumptions $Assumptions = (R | r) ∈ Arrays[{4}]; I can do two operations: ...
MaPo's user avatar
  • 909
3 votes
2 answers
298 views

Summing matrix products

I need to compute a double sum over a weighted matrix product: $L[M]=\sum_{i,j}^{N}\Lambda[[i]]\;\omega[[i]].M.\omega^{\dagger}[[j]]$. $\Lambda$ is a list of with N complex values(weights) and $\...
Chris_Han's user avatar
5 votes
3 answers
627 views

Bilinear Dot Function

In mathematics the matrix product is a bilinear operation $$ \alpha A \cdot(\beta B + \gamma C) = \alpha\beta ( A \cdot B )+ \alpha \gamma (A\cdot C ), $$ where capital letters denote matrices and ...
murphy's user avatar
  • 1,249
6 votes
0 answers
1k views

Is it possible to simplify an expression in vector form, which involves crossproduct and dot product?

I often need to simplify expressions involving cross product and dot product, for example: f = Dot[Cross[Cross[p1 - p, e1], Cross[p2 - p, e2]], Cross[p3 - p, e3]] ...
larry's user avatar
  • 695
1 vote
1 answer
2k views

Using the Norm Function

I am trying to take the norm of a general vector and show that for vectors, v,w, that Norm[v cross w]^2==Norm[v]^2*Norm[w]^2-(v dot w)^2 In Mathematica, here are my steps: ...
Jack Armstrong's user avatar
2 votes
2 answers
780 views

Pulling out a prefactor from a dot product

I have three complicated vectors u, v and w as well as three simple prefactors ...
ranguwud's user avatar
  • 143
6 votes
3 answers
570 views

Factor out the scalar multiplier for the dot product of 2x2 matrices

If yy and zz are 2x2 Hermitian matrices, is there a way that I can mark them (with a property?) as Hermitian so that Mathematica can assume that it can factor out and simplify scalar multipliers from ...
David B's user avatar
  • 271
1 vote
1 answer
247 views

Unexpected inefficiency when calculating matrix product by Dot

There is an unexpected inefficiency when I calculate matrix product by Dot. The only relevant part of my code is presented as follows: ...
AchillesJJ's user avatar
5 votes
2 answers
740 views

Dot product for lists

Suppose we want to get the dot product for the following lists aa and bb, whose elements (a, ...
renphysics's user avatar
  • 1,550
22 votes
3 answers
1k views

Why is calling Dot with many arguments so inefficient?

Say I want to multiply a reasonably large list of symbolic matrices. ...
murphy's user avatar
  • 1,249
14 votes
1 answer
464 views

Why does partitioning increase Dot execution speed?

I have noticed that multiplying a list of matrices can be significantly sped up by partitioning the list, calculating the product of the partitions matrices, and then multiplying the results. ...
murphy's user avatar
  • 1,249
4 votes
1 answer
2k views

Draw grid with points

How would I draw a grid with dots on specified intersections? The image below shows the basic idea: If I wanted to label the grid lines with index numbers or letters, how would I do that?
Tyler Durden's user avatar
  • 4,048