zero: Zero tensors and zero forms

zeroR Documentation

Zero tensors and zero forms

Description

\loadmathjax

Correct idiom for generating zero \mjseqnk-tensors and \mjseqnk-forms

Usage

zeroform(n)
zerotensor(n)
is.zero(x)
is.empty(x)

Arguments

n

Arity of the \mjseqnk-form or \mjseqnk-tensor

x

Object to be tested for zero

Value

Returns an object of class kform or ktensor.

Note

Idiom such as as.ktensor(rep(1,n),0) and as.kform(rep(1,5),0) and indeed as.kform(1:5,0) is incorrect as the arity of the tensor is lost.

A \mjseqn0-form is not the same thing as a zero tensor. A \mjseqn0-form maps \mjseqnV^0 to the reals; a scalar. A zero tensor maps \mjseqnV^k to zero. Some discussion is given at scalar.Rd.

Author(s)

Robin K. S. Hankin

See Also

scalar

Examples


zerotensor(5)
zeroform(3)


x <- rform(k=3)
x*0 == zeroform(3)       # should be true
x   == x + zeroform(3)  # should be true

y <- rtensor(k=3)
y*0 == zerotensor(3)    # should be true
y   == y+zerotensor(3)  # should be true


## Following idiom is plausible but fails because as.ktensor(coeffs=0)
## and as.kform(coeffs=0) do not retain arity:

## as.ktensor(1+diag(5)) +  as.ktensor(rep(1,5),0)   # fails
## as.kform(matrix(1:6,2,3)) + as.kform(1:3,0)   # also fails



stokes documentation built on Aug. 19, 2023, 1:07 a.m.