OpenMath Content Dictionary: linalg1

Canonical URL:
http://www.openmath.org/cd/linalg1.ocd
CD File:
linalg1.ocd
CD as XML Encoded OpenMath:
linalg1.omcd
Defines:
determinant, matrix_selector, outerproduct, scalarproduct, transpose, vector_selector, vectorproduct
Date:
2001-03-12
Version:
2
Review Date:
2003-04-01
Status:
official
Uses CD:
alg1, arith1, linalg2, logic1, relation1, transc1

Operations on Matrices (independent of the matrix representation).


vectorproduct

This symbol represents the vector product function. It takes two three dimensional vector arguments and returns a three dimensional vector. It is defined as follows: if we write a as [a_1,a_2,a_3] and b as [b_1,b_2,b_3] then the vector product denoted a x b = [a_2b_3 - a_3b_2 , a_3b_1 - a_1b_3 , a_1b_2 - a_2b_1]. Note that the vector product is often referred to as the cross product.

Commented Mathematical property (CMP):
if we write a as [a_1,a_2,a_3] and b as [b_1,b_2,b_3] then the vector product denoted a x b = [a_2b_3 - a_3b_2 , a_3b_1 - a_1b_3 , a_1b_2 - a_2b_1]
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="linalg1" name="vectorproduct"/>
      <OMV name="A"/>
      <OMV name="B"/>
    </OMA>
    <OMA>
      <OMS cd="logic1" name="and"/>
      <OMA>
        <OMS cd="arith1" name="minus"/>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 2 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 3 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 3 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 2 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
      </OMA>
      <OMA>
        <OMS cd="arith1" name="minus"/>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 3 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 1 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 1 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 3 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
      </OMA>
      <OMA>
        <OMS cd="arith1" name="minus"/>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 1 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 2 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
	<OMA>
	  <OMS cd="arith1" name="times"/>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 2 </OMI>
	    <OMV name="A"/>
	  </OMA>
	  <OMA>
	    <OMS cd="linalg1" name="vector_selector"/>
	    <OMI> 1 </OMI>
	    <OMV name="B"/>
	  </OMA>
	</OMA>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (vectorproduct ( A, B) , and (minus (times (vector_selector ( 2 , A) , vector_selector ( 3 , B) ) , times (vector_selector ( 3 , A) , vector_selector ( 2 , B) ) ) , minus (times (vector_selector ( 3 , A) , vector_selector ( 1 , B) ) , times (vector_selector ( 1 , A) , vector_selector ( 3 , B) ) ) , minus (times (vector_selector ( 1 , A) , vector_selector ( 2 , B) ) , times (vector_selector ( 2 , A) , vector_selector ( 1 , B) ) ) ) )

Signatures:
sts


[Next: scalarproduct] [Last: matrix_selector] [Top]

scalarproduct

This symbol represents the scalar product function. It takes two vector arguments and returns a scalar value. The scalar product of two vectors a, b is defined as |a| * |b| * cos(\theta), where \theta is the angle between the two vectors and |.| is a euclidean size function. Note that the scalar product is often referred to as the dot product.

Commented Mathematical property (CMP):
a.b = |a| * |b| * cos(\theta), where \theta is the angle between the two vectors that is |atan(a_2/a_1)-atan(b_2/b_1)|. N.B. The FMP displays the two dimensional case only.
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="linalg1" name="scalarproduct"/>
      <OMV name="a"/>
      <OMV name="b"/>
    </OMA>
    <OMA>
      <OMS cd="arith1" name="times"/>
      <OMA>
        <OMS cd="arith1" name="root"/>
	<OMA>
	  <OMS cd="arith1" name="plus"/>
	  <OMA>
	    <OMS cd="arith1" name="power"/>
	    <OMA>
	      <OMS cd="linalg1" name="vector_selector"/>
	      <OMI> 1 </OMI>
	      <OMV name="a"/>
	    </OMA>
	    <OMI> 2 </OMI>
	  </OMA>
	  <OMA>
	    <OMS cd="arith1" name="power"/>
	    <OMA>
	      <OMS cd="linalg1" name="vector_selector"/>
	      <OMI> 2 </OMI>
	      <OMV name="a"/>
	    </OMA>
	    <OMI> 2 </OMI>
	  </OMA>
	</OMA>
	<OMI> 2 </OMI>
      </OMA>
      <OMA>
        <OMS cd="arith1" name="root"/>
	<OMA>
	  <OMS cd="arith1" name="plus"/>
	  <OMA>
	    <OMS cd="arith1" name="power"/>
	    <OMA>
	      <OMS cd="linalg1" name="vector_selector"/>
	      <OMI> 1 </OMI>
	      <OMV name="b"/>
	    </OMA>
	    <OMI> 2 </OMI>
	  </OMA>
	  <OMA>
	    <OMS cd="arith1" name="power"/>
	    <OMA>
	      <OMS cd="linalg1" name="vector_selector"/>
	      <OMI> 2 </OMI>
	      <OMV name="b"/>
	    </OMA>
	    <OMI> 2 </OMI>
	  </OMA>
	</OMA>
	<OMI> 2 </OMI>
      </OMA>
      <OMA>
        <OMS cd="transc1" name="cos"/>
	<OMA>
	  <OMS cd="arith1" name="abs"/>
	  <OMA>
	    <OMS cd="arith1" name="minus"/>
	    <OMA>
	      <OMS cd="transc1" name="arctan"/>
	      <OMA>
	        <OMS cd="arith1" name="divide"/>
		<OMA>
		  <OMS cd="linalg1" name="vector_selector"/>
		  <OMI> 2 </OMI>
		  <OMV name="a"/>
		</OMA>
		<OMA>
		  <OMS cd="linalg1" name="vector_selector"/>
		  <OMI> 1 </OMI>
		  <OMV name="a"/>
		</OMA>
	      </OMA>
	    </OMA>
	    <OMA>
	      <OMS cd="transc1" name="arctan"/>
	      <OMA>
	        <OMS cd="arith1" name="divide"/>
		<OMA>
		  <OMS cd="linalg1" name="vector_selector"/>
		  <OMI> 2 </OMI>
		  <OMV name="b"/>
		</OMA>
		<OMA>
		  <OMS cd="linalg1" name="vector_selector"/>
		  <OMI> 1 </OMI>
		  <OMV name="b"/>
		</OMA>
	      </OMA>
	    </OMA>
	  </OMA>
	</OMA>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (scalarproduct ( a, b) , times (root (plus (power (vector_selector ( 1 , a) , 2 ) , power (vector_selector ( 2 , a) , 2 ) ) , 2 ) , root (plus (power (vector_selector ( 1 , b) , 2 ) , power (vector_selector ( 2 , b) , 2 ) ) , 2 ) , cos (abs (minus (arctan (divide (vector_selector ( 2 , a) , vector_selector ( 1 , a) ) ) , arctan (divide (vector_selector ( 2 , b) , vector_selector ( 1 , b) ) ) ) ) ) ) )

Signatures:
sts


[Next: outerproduct] [Previous: vectorproduct] [Top]

outerproduct

This symbol represents the outer product function. It takes two vector arguments and returns a matrix. It is defined as follows: if we write the {i,j}'th element of the matrix to be returned as m_{i,j}, then: m_{i,j}=a_i * b_j where a_i,b_j are the i'th and j'th elements of a, b respectively.

Commented Mathematical property (CMP):
outerproduct(a,b)_{i,j} = a_i * b_j
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="linalg1" name="matrix_selector"/>
      <OMV name="i"/>
      <OMV name="j"/>
      <OMA>
        <OMS cd="linalg1" name="outerproduct"/>
	<OMV name="a"/>
	<OMV name="b"/>
      </OMA>
    </OMA>
    <OMA>
      <OMS cd="arith1" name="times"/>
      <OMA>
        <OMS cd="linalg1" name="vector_selector"/>
	<OMV name="i"/>
	<OMV name="a"/>
      </OMA>
      <OMA>
        <OMS cd="linalg1" name="vector_selector"/>
	<OMV name="j"/>
	<OMV name="b"/>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (matrix_selector ( i, j, outerproduct ( a, b) ) , times (vector_selector ( i, a) , vector_selector ( j, b) ) )

Signatures:
sts


[Next: transpose] [Previous: scalarproduct] [Top]

transpose

This symbol represents a unary function that denotes the transpose of the given matrix or vector

Example:
A representation of the equation transpose matrix([0,1],[2,3]) = matrix([0,2],[1,3]) N.B. in this example the row oriented view of matrix construction is being assumed.
<OMOBJ>
  <OMA>
    <OMS cd="relation1" name="eq"/>
    <OMA>
      <OMS cd="linalg1" name="transpose"/>
      <OMA>
        <OMS cd="linalg2" name="matrix"/>
        <OMA>
          <OMS cd="linalg2" name="matrixrow"/>
          <OMI> 0 </OMI>
          <OMI> 1 </OMI>
        </OMA>
        <OMA>
          <OMS cd="linalg2" name="matrixrow"/>
          <OMI> 2 </OMI>
          <OMI> 3 </OMI>
        </OMA>
      </OMA>
    </OMA>
    <OMA>
      <OMS cd="linalg2" name="matrix"/>
      <OMA>
        <OMS cd="linalg2" name="matrixrow"/>
        <OMI> 0 </OMI>
        <OMI> 2 </OMI>
      </OMA>
      <OMA>
        <OMS cd="linalg2" name="matrixrow"/>
        <OMI> 1 </OMI>
        <OMI> 3 </OMI>
      </OMA>
    </OMA>
  </OMA>
</OMOBJ>

eq (transpose (matrix (matrixrow ( 0 , 1 ) , matrixrow ( 2 , 3 ) ) ) , matrix (matrixrow ( 0 , 2 ) , matrixrow ( 1 , 3 ) ) )

Signatures:
sts


[Next: determinant] [Previous: outerproduct] [Top]

determinant

This symbol denotes the unary function which returns the determinant of its argument, the argument should be a square matrix.

Commented Mathematical property (CMP):
The determinant of an identity matrix is 1
Formal Mathematical property (FMP):
<OMOBJ>
  <OMA>
    <OMS cd="logic1" name="implies"/>
    <OMA>
      <OMS cd="logic1" name="and"/>
      <OMA>
        <OMS cd="logic1" name="implies"/>
	<OMA>
	  <OMS cd="relation1" name="neq"/>
	  <OMV name="i"/>
	  <OMV name="j"/>
	</OMA>
	<OMA>
	  <OMS cd="relation1" name="eq"/>
	  <OMA>
	    <OMS cd="linalg1" name="matrix_selector"/>
	    <OMV name="i"/>
	    <OMV name="j"/>
	    <OMV name="M"/>
	  </OMA>
	  <OMS cd="alg1" name="zero"/>
	</OMA>
      </OMA>
      <OMA>
        <OMS cd="logic1" name="implies"/>
	<OMA>
	  <OMS cd="relation1" name="eq"/>
	  <OMV name="i"/>
	  <OMV name="j"/>
	</OMA>
	<OMA>
	  <OMS cd="relation1" name="eq"/>
	  <OMA>
	    <OMS cd="linalg1" name="matrix_selector"/>
	    <OMV name="i"/>
	    <OMV name="j"/>
	    <OMV name="M"/>
	  </OMA>
	  <OMS cd="alg1" name="one"/>
	</OMA>
      </OMA>
    </OMA>
    <OMA>
      <OMS cd="relation1" name="eq"/>
      <OMA>
        <OMS cd="linalg1" name="determinant"/>
	<OMV name="M"/>
      </OMA>
      <OMS cd="alg1" name="one"/>
    </OMA>
  </OMA>
</OMOBJ>

implies (and (implies (neq ( i, j) , eq (matrix_selector ( i, j, M) , zero) ) , implies (eq ( i, j) , eq (matrix_selector ( i, j, M) , one) ) ) , eq (determinant ( M) , one) )

Signatures:
sts


[Next: vector_selector] [Previous: transpose] [Top]

vector_selector

This symbol represents the function which allows individual entries to be selected from a vector, or a matrixrow. It takes two arguments. The first argument is the position in the vector (or matrixrow) of the required entry, the second argument is the vector (or matrixrow) in question. The indexing is one based, i.e. the first element is indexed by one.

Example:
Representation of a specification of selection of the second element of the specific vector [3,6,9]. N.B. in this example the row oriented view of vector construction is being assumed
<OMOBJ>
  <OMA>
  <OMS cd="linalg1" name="vector_selector"/>
    <OMI>2</OMI>
    <OMA>
    <OMS cd="linalg2" name="vector"/>
      <OMI> 3 </OMI>
      <OMI> 6 </OMI>
      <OMI> 9 </OMI>
    </OMA>     
  </OMA>
</OMOBJ>

vector_selector (2, vector ( 3 , 6 , 9 ) )

Example:
Representation of a specification of selection of the second element of the specific matrixrow [0,1,0]. N.B. in this example the row oriented view of matrixrow construction is being assumed
<OMOBJ>
  <OMA>
  <OMS cd="linalg1" name="vector_selector"/>
    <OMI>2</OMI>
    <OMA>
    <OMS cd="linalg2" name="matrixrow"/>
      <OMI> 0 </OMI>
      <OMI> 1 </OMI>
      <OMI> 0 </OMI>
    </OMA>     
  </OMA>
</OMOBJ>

vector_selector (2, matrixrow ( 0 , 1 , 0 ) )

Signatures:
sts


[Next: matrix_selector] [Previous: determinant] [Top]

matrix_selector

This symbol represents the function which allows individual entries to be selected from a matrix. It takes three arguments, the first is the index of the row and the second is the index of the column of the required element, the third argument is the matrix in question. The indexing is one based, i.e. the element in the top left hand corner is indexed by (1,1).

Example:
Representation of a specification of selection of the top left hand entry to the matrix M.
<OMOBJ>
  <OMA>
    <OMS cd="linalg1" name="matrix_selector"/>
    <OMI> 1 </OMI>
    <OMI> 1 </OMI>
    <OMV name="M"/>
  </OMA>     
</OMOBJ>

matrix_selector ( 1 , 1 , M)

Signatures:
sts


[First: vectorproduct] [Previous: vector_selector] [Top]