login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

# Edit detail for QuadraticForm revision 4 of 4

 1 2 3 4 Editor: test1 Time: 2017/01/27 18:18:43 GMT+0 Note:

changed:
-QuadraticForm(n, K): T == Impl where
-    n: PositiveInteger
-    K: Field
-    SM ==> SquareMatrix
-    V  ==> DirectProduct
-
-    T ==> AbelianGroup with
-        quadraticForm: SM(n, K) -> %
-            ++ square matrix m.
-        matrix: % -> SM(n, K)
-            ++ matrix(qf) creates a square matrix from the quadratic form qf.
-        elt: (%, V(n, K)) -> K
-            ++ elt(qf,v) evaluates the quadratic form qf on the vector v,
-            ++ producing a scalar.
-        coerce: % -> InputForm
-
-        Rep := SM(n,K)
-
-        import List InputForm
-
-        coerce(q:%):InputForm ==
-                InputForm)$Lisp pretend InputForm]) - - quadraticForm m == - not symmetric? m => - error "quadraticForm requires a symmetric matrix" - m::% - matrix q == q pretend SM(n,K) - elt(q,v) == dot(v, (matrix q * v)) -\end{spad} added: fricas )show QuadraticForm QuadraticForm(n: PositiveInteger,K: Field) is a domain constructor Abbreviation for QuadraticForm is QFORM This constructor is exposed in this frame. ------------------------------- Operations -------------------------------- ?*? : (Integer,%) -> % ?*? : (PositiveInteger,%) -> % ?+? : (%,%) -> % ?-? : (%,%) -> % -? : % -> % ?=? : (%,%) -> Boolean 0 : () -> % coerce : % -> OutputForm ?.? : (%,DirectProduct(n,K)) -> K hash : % -> SingleInteger latex : % -> String matrix : % -> SquareMatrix(n,K) opposite? : (%,%) -> Boolean sample : () -> % zero? : % -> Boolean ?~=? : (%,%) -> Boolean ?*? : (NonNegativeInteger,%) -> % convert : % -> InputForm if SquareMatrix(n,K) has KONVERT(INFORM) hashUpdate! : (HashState,%) -> HashState quadraticForm : SquareMatrix(n,K) -> % subtractIfCan : (%,%) -> Union(%,"failed") fricas parse(s:String):InputForm == ncParseFromString(s)$Lisp pretend InputForm
Function declaration parse : String -> InputForm has been added to workspace.
Type: Void
fricas
parse("Integer")
fricas
Compiling function parse with type String -> InputForm
 (1)
Type: InputForm

Test

fricas
 (2)
fricas
qf::InputForm
 (3)
Type: InputForm
fricas
unparse %
 (4)
Type: String
fricas
parse %
 (5)
Type: InputForm
fricas