This is a downside of the handlers system. The deductions aren't made
based on facts that the handlers return. This is one of the main
deficiencies that the satask/sathandlers system tries to fix. I don't
know if there's an easy fix to make it work in the handlers system.
You could also manually modify the SymmetricHandler class to check for
diagonal (this is obviously annoying, because it blatantly duplicates
the general fact in get_known_facts
https://github.com/sympy/sympy/blob/5827cafb1e1840915b3e7c9f62cd0d58fff9fc48/sympy/assumptions/ask.py#L1517).

The better way to fix it is to implement it in the sathandlers system.
No matrix stuff is implemented there yet, so it may require some
ground work.

Aaron Meurer

On Mon, Dec 12, 2016 at 6:57 PM, Andrey Torba <[email protected]> wrote:
> Hi,
>
> I'm working on the pull request.
>
> A 1x1 matrix is always diagonal. Diagonal implies symmetric. I have fixed
> AskDiagonalHandler such that this assertion pass:
>
>   V1 = MatrixSymbol('V1', 2, 1)
>   V2 = MatrixSymbol('V2', 2, 1)
>   expr = V1.T*(V1 + V2)
>   assert ask(Q.diagonal(expr)) is True
>
> Now I assume that inference module will deduce that this expression is also
> symmetric (since the expression is diagonal):
>
>   assert ask(Q.symmetric(expr)) is True                  # it is None!
>
> It returns None. Is anything missing? Can you show an example where this
> kind of inference works well?
>
> -Andrey
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/d84286f8-9a6f-469b-ac95-4a3c8b21cda2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JD3Ti69_KkW15kqz3ksXBbziP0a563R3u2u9%2BqN5LAcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to