# LinearAlgebra and TaylorSeries not interacting as expected

**URL:** <https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679>\
**Category:** General Usage\
**Tags:** linearalgebra\
**Created:** [April 19, 2022, 11:13am UTC](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679 "2022-04-19T11:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [April 19, 2022, 11:13am UTC](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679/1 "2022-04-19T11:13:47Z")

</div>

I just found out that some bizarre behaviour I was getting when using `TaylorIntegration` was due to my use of `LinearAlgebra.norm` in my equation of motion… Apparently, `LinearAlgebra` considers a `Taylor1` (or `TaylorN`) object as a list, and doesn’t apply as expected… Here is a minimal working example with the result I thought I would get (with `mynorm`) and the actual output:

```julia
using TaylorSeries, LinearAlgebra
mynorm(vec) = sqrt(sum(transpose(vec) * vec))
v = [1., 0.] .+ Taylor1(1)
print(norm(v)) # 1.7320508075688774
print(mynorm(v)) # 1.0 + 1.0 t + 𝒪(t²)

```

Does someone happen to know why this is the case?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 19, 2022, 12:22pm UTC](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679/2 "2022-04-19T12:22:30Z")

</div>

> [@Alseidon](#):
>
> Apparently, `LinearAlgebra` considers a `Taylor1` (or `TaylorN` ) object as a list, and doesn’t apply as expected…

It’s not the `LinearAlgebra` package. The `TaylorSeries` package [defines the `norm`](https://github.com/JuliaDiff/TaylorSeries.jl/blob/c83da89375ddf36a1534e631aea2aae811eb0f38/src/other_functions.jl#L151-L168) of a `Taylor1` object to be the norm of its coefficients.

See the discussion linked here: [norm methods for AbstractSeries by blas-ko · Pull Request #128 · JuliaDiff/TaylorSeries.jl · GitHub](https://github.com/JuliaDiff/TaylorSeries.jl/pull/128)

---

<div class="post-metadata">

**Author:** ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Post date:** [April 19, 2022, 12:26pm UTC](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679/3 "2022-04-19T12:26:09Z")

</div>

Damn it, I didn’t see that TaylorSeries also defined `norm`… This explains a lot. The way this is defined still seems strange to me, but at least its origin makes sense now. Thanks a lot !
