# Similar Symmetric matrix / type stability

**URL:** https://discourse.julialang.org/t/similar-symmetric-matrix-type-stability/21501
**Category:** New to Julia
**Tags:** question, linearalgebra, type-stability
**Created:** [March 5, 2019, 5:43pm UTC](https://discourse.julialang.org/t/similar-symmetric-matrix-type-stability/21501 "2019-03-05T17:43:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zymbuzz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zymbuzz/32/5482_2.png) [@zymbuzz](https://discourse.julialang.org/u/zymbuzz)
#### Post date: [March 5, 2019, 5:43pm UTC](https://discourse.julialang.org/t/similar-symmetric-matrix-type-stability/21501/1 "2019-03-05T17:43:37Z")

</div>

hi! I have another short newbie question. Why does the wrapper Symmetric() disappears, when one creates an uninitialised Symmetric matrix using a function similar()? This happens if dimensions are changed, see the matrix b2.

```julia
a1=randn(3,3)
a1=Symmetric(a1+a1')
b1=similar(a1)
typeof(b1)

a2=randn(3,3)
a2=Symmetric(a2+a2')
b2=similar(a2,2,2)
typeof(b2)

```

Does that have an effect on type-stability?

```julia
e=randn(2,2)
e=Symmetric(e+e')
b2.=e

```

Thanks

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [March 6, 2019, 8:54am UTC](https://discourse.julialang.org/t/similar-symmetric-matrix-type-stability/21501/2 "2019-03-06T08:54:11Z")

</div>

`similar(a2, 2, 2)` falls back to the generic method (you can see this with eg `@edit similar(a2, 2, 2)`.

Type stability means that output types can be calculated from input types. This should hold, as `similar(a2, 2, 2)` and `similar(a2)` are different calls.
