# If I have a length 6 vector, is there a way I can \`reshape\` that into a 3x3 symmet

**URL:** <https://discourse.julialang.org/t/if-i-have-a-length-6-vector-is-there-a-way-i-can-reshape-that-into-a-3x3-symmet/54769>\
**Category:** General Usage\
**Created:** [February 7, 2021, 1:51am UTC](https://discourse.julialang.org/t/if-i-have-a-length-6-vector-is-there-a-way-i-can-reshape-that-into-a-3x3-symmet/54769 "2021-02-07T01:51:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 7, 2021, 1:51am UTC](https://discourse.julialang.org/t/if-i-have-a-length-6-vector-is-there-a-way-i-can-reshape-that-into-a-3x3-symmet/54769/1 "2021-02-07T01:51:14Z")

</div>

If I have a length 6 vector, is there a way I can `reshape` that into a 3x3 symmetric matrix cleanly/efficiently? Currently I just hardcode the element places.

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1612662663184500?thread_ts=1612662663.184500&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![pjentsch0](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pjentsch0/32/15148_2.png) [@pjentsch0](https://discourse.julialang.org/u/pjentsch0)\
**Post date:** [February 7, 2021, 4:52am UTC](https://discourse.julialang.org/t/if-i-have-a-length-6-vector-is-there-a-way-i-can-reshape-that-into-a-3x3-symmet/54769/2 "2021-02-07T04:52:08Z")

</div>

`julia> SHermitianCompact(SA[1,2,3,4,5,6]) 3×3 SHermitianCompact{3, Int64, 6} with indices SOneTo(3)×SOneTo(3): 1 2 3 2 4 5 3 5 6`
