# to SUM tensor with array

**URL:** <https://community.wolfram.com/t/to-sum-tensor-with-array/3816>\
**Category:** Questions\
**Tags:** algebra\
**Created:** [October 28, 2014, 8:36pm UTC](https://community.wolfram.com/t/to-sum-tensor-with-array/3816 "2014-10-28T20:36:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marferit](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@marferit](https://community.wolfram.com/u/marferit)\
**Post date:** [October 28, 2014, 8:36pm UTC](https://community.wolfram.com/t/to-sum-tensor-with-array/3816/1 "2014-10-28T20:36:41Z")

</div>

Hi,  
I have

B = {a, b} and

geom1Q = {{{0., -0.0975248}, {0., -0.666667}, {0.,-0.75}, {0., -0.833333}, {0., -0.916667}, {0., -1.}}, {{0., -0.0995336}, {0., -0.199067}} }

**I’d sum automatically B[[1]] with geom1Q[[1,All,2]] and B[[2]] with geom1Q[[2,All,2]]**  
to have

**QQ = {{{0., -0.0975248+a}, {0., -0.666667+a}, {0.,-0.75+a}, {0., -0.833333+a}, {0., -0.916667+a}, {0., -1+a.}}, {{0., -0.0995336+b}, {0., -0.199067+b}} }**

So I have written this

**QQ = Table[Map[# + B[[i]] &, geom1Q[[i,All]] ] , {i, 1, Length[B]}]**

but my result is

QQ = {{{0.+a, -0.0975248+a}, {0.+a, -0.666667+a}, {0.+a,-0.75+a}, {0.+a, -0.833333+a}, {0.+a, -0.916667+a}, {0.+a, -1+a.}}, {{0.+b, -0.0995336+b}, {0.+b, -0.199067+b}} }

I need your help.  
Thank you  
Margherita

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [October 29, 2014, 12:10am UTC](https://community.wolfram.com/t/to-sum-tensor-with-array/3816/2 "2014-10-29T00:10:40Z")

</div>

Not particularly elegant, but gives the result:

```
MapThread[Transpose[{#1, #2}] &, {geom1Q[[All, All, 1]], geom1Q[[All, All, 2]] + B}]

```

Cheers,

M.

---

<div class="post-metadata">

**Author:** ![marferit](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@marferit](https://community.wolfram.com/u/marferit)\
**Post date:** [October 29, 2014, 9:38pm UTC](https://community.wolfram.com/t/to-sum-tensor-with-array/3816/3 "2014-10-29T21:38:41Z")

</div>

Thank you
