# sparseCoeffs -- Converts ring elements into vectors over the coefficient ring

## Synopsis

• Usage:
sparseCoeffs L
• Inputs:
• Optional inputs:
• Monomials => a list, default value null, a list of monomials to use as a basis for computing coordinate vectors
• Outputs:
• ,

## Description

This method converts a list of ring elements to coordinate vectors - returned as a matrix - relative to a list of monomials. If the user does not supply a monomial list, the list is taken to be the monomials occurring in the elements of the list (with repetition).

 i1 : A=QQ{a, b, c, d, e, f, g, h} o1 = A o1 : NCPolynomialRing i2 : F = a^2+b^2+c^2+d^2+e^2+f^2+g^2+h^2; i3 : sparseCoeffs(F) o3 = | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | 8 1 o3 : Matrix QQ <--- QQ i4 : bas = flatten entries basis(2,A); i5 : #bas o5 = 64 i6 : sparseCoeffs(F,Monomials=>bas) o6 = | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 1 | 64 1 o6 : Matrix QQ <--- QQ i7 : sparseCoeffs(toList (10:F),Monomials=>bas) o7 = | 1 1 1 1 1 1 1 1 1 1 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 1 1 1 1 1 1 1 1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1 1 1 1 1 1 1 1 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 0 0 0 0 0 0 0 0 0 0 | | 1 1 1 1 1 1 1 1 1 1 | 64 10 o7 : Matrix QQ <--- QQ

## Ways to use sparseCoeffs :

• "sparseCoeffs(List)"
• "sparseCoeffs(NCRingElement)"

## For the programmer

The object sparseCoeffs is .