# How can I get a list of the "coefficients" of Quaternion[1, 2, 3, 4]? [duplicate]

I want to input: Quaternion[1, 2, 3, 4] to get a list: {1,2,3,4}.

• You could always just List @@ q (see Apply). But then you can do almost anything with q = Quaternion[1,2,3,4] that you can do with {1,2,3,4}. For example, you can extract the 2nd part as q[[2]], etc. I am a bit tempted to vote to close as simple mistake. If you disagree, can you elaborate? Commented Feb 4, 2016 at 10:49
• @Szabolics Thank you. I was not aware that q[[2]] would extract the 2nd part. Now I am even more embarrassed to ask this question: I have: 7 + 5 Sqrt[2] but I want the list: {7,5}. Commented Feb 6, 2016 at 13:36
• This second question is not a simple one. The difficulty is deciding (i..e precisely defining) why the second term should be 5 and not 5 Sqrt[2] or something else. If we treat Sqrt[2] as special, we can use CoefficientList[7 + 5 Sqrt[2], Sqrt[2]]. Commented Feb 8, 2016 at 10:35
• Thank you very much Szabolics. I use CoefficientList quite often. I don't know why I did not think to try it here. Commented Feb 8, 2016 at 10:52