def upper_tri(operator):
 entries = (operator.size[0] * operator.size[1])
 size = (((entries - operator.size[0]) // 2), 1)
 return lo.LinOp(lo.UPPER_TRI, size, [operator], None)

def upper_tri ( operator ) : entries = ( operator . size [ 0 ] * operator . size [ 1 ] ) size = ( ( ( entries - operator . size [ 0 ] ) // 2 ) , 1 ) return lo . LinOp ( lo . UPPER_TRI , size , [ operator ] , None )
vectorized upper triangular portion of a square matrix .