Skip to content

is_symmetric() fails badly for symbolic matrices #41125

@orlitzky

Description

@orlitzky

There are plenty of discussions floating around about fixing comparison with zero in inexact rings. This is another example of that issue,

sage: x11, x12, x22 = SR.var("x11, x12, x21", domain="real")
sage: X = matrix(SR, [[x11,x12],[0,x22]])
sage: X
[x11 x12]
[  0 x21]
sage: X.is_symmetric()
True

But maybe we can work around the fact that

sage: bool(x12 != 0)
False

by changing the implementation of is_symmetric()? For example...

sage: not (x12 - 0).is_zero()
True

Then at least we would not have all triangular matrices being symmetric.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions