OKlibrary  0.2.1.6
QuadraticForms.dem
Go to the documentation of this file.
00001 /* Oliver Kullmann, 25.1.2008 (Swansea) */
00002 /* Copyright 2008 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00022 if oklib_test_demos then
00023  if oklib_test_demos_level < 1 then return()$
00024 
00025 oklib_include("OKlib/ComputerAlgebra/LinearAlgebra/Lisp/QuadraticForms.mac");
00026 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac");
00027 
00028 "Squares matrices M_n of order n with zeros on the diagonal and 1 elsewhere:"$
00029 
00030 M(n) := 1+zeromatrix(n,n)-ident(n);
00031 
00032 M(4);
00033 
00034 "We have M(n) = adjacency_matrix(complete_graph(n)):"$
00035 
00036 load(graphs)$
00037 assert(adjacency_matrix(complete_graph(4)) = M(4));
00038 
00039 "The hermitian defect of the matrices M_n of order n is 1."$
00040 
00041 assert(hermitian_def(M(20)) = 1);
00042 assert(hermitian_rank(M(20)) = 20 - 1);
00043