Skip to content

← tensor_math package

UpperTriangular

Extract the upper triangular part of a symmetric matrix.

This also works with data that is a multi-way array but which has two dimensions of same length, such that the slices along these two dimensions can be interpreted as matrices. This node allows to specify the axes that constitute the edges of the matrix, and will replace these two axes by a new axis of type feature that has only the upper-triangular elements, vectorized. The new axis will appear at the beginning of the data. A common use case is when one calculates a value between all pairs of channels, but only wants to retain half of the values due to symmetry. In this case, one would specify both axes as space. Version 1.1.0

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: AnyNumeric (can be None)
  • data direction: INOUT

axis1

First axis of matrix. This is the first axis type that runs along the matrix from which we want select the upper triangular part. You can also enter the axis label here as in space.mylabel. (If the incoming data is an array instead of a Packet, you may specify the axis index here.)

  • verbose name: Axis1
  • default value: space
  • port type: ComboPort
  • value type: str (can be None)

axis2

Second axis of matrix. This is the second axis type that runs along the matrix from which we want select the upper triangular part. You can also enter the axis label here as in space.mylabel. (If the incoming data is an array instead of a Packet, you may specify the axis index here.)

  • verbose name: Axis2
  • default value: space
  • port type: ComboPort
  • value type: str (can be None)

use_lower

Use lower triangular matrix instead. If selected, the lower triangular part is taken instead.

  • verbose name: Use Lower Triangular Instead
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

diagonal_offset

Diagonal offset. Allows to shift the diagonal up (positive values) or down (negative values). 0 is the regular diagonal.

  • verbose name: Diagonal Offset
  • default value: 0
  • port type: IntPort
  • value type: int (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)