How to simplify 1.w? w is any vector
example:
{1, 2, 3}
1 is a scalar, result of 1.w is
1.{1, 2, 3}
I want it to be {1, 2, 3}
How to simplify 1.w? w is any vector
example:
{1, 2, 3}
1 is a scalar, result of 1.w is
1.{1, 2, 3}
I want it to be {1, 2, 3}
. refers to the contraction (dot product) of two general tensors (array, list, matrix, vector). For example:
a.b
This will contract the last index of a with the first index of b. Scalar multiplication, what you want, can be written in (at least) 3 ways:
1{1,2,3}
1*{1,2,3}
Times[1,{1,2,3}]
w = {1, 2, 3};
1. is an approximate real number. Multiplying an approximate real number times a list or array of exact numbers will produce a list or array of approximate real numbers.
1. w
(* {1., 2., 3.} *)
If you want exact numbers, use Rationalize
1. w // Rationalize
(* {1, 2, 3} *)