inner: Inner product operator

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The inner product

Usage

1
inner(M)

Arguments

M

square matrix

Details

The inner product of two vectors x and y is usually written <x,y> or x.y, but the most general form would be x'My where M is a positive-definite matrix. Noting that inner products are symmetric, that is <x,y>=<y,x> (we are considering the real case only), and multilinear, that is <x,ay+bz>=a<x,y>+b<x,z>, we see that the inner product is indeed a multilinear map, that is, a tensor.

Function inner(m) returns the 2-form that maps x,y to x'My.

Value

Returns a k-tensor, an inner product

Author(s)

Robin K. S. Hankin

See Also

kform

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
inner(diag(7))
inner(matrix(1:9,3,3))

## Compare the following two:
Alt(inner(matrix(1:9,3,3)))      # An alternating k tensor
as.kform(inner(matrix(1:9,3,3))) # Same thing coerced to a kform

f <- as.function(inner(diag(7)))
X <- matrix(rnorm(14),ncol=2)  # random element of (R^7)^2
f(X) - sum(X[,1]*X[,2]) # zero to numerical precision

## verify positive-definiteness:
g <- as.function(inner(crossprod(matrix(rnorm(56),8,7))))
stopifnot(g(kronecker(rnorm(7),t(c(1,1))))>0)

wedge documentation built on Sept. 4, 2019, 9:02 a.m.