Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjoint(a) != conj(a) for a::Sym #425

Closed
olof3 opened this issue May 22, 2021 · 2 comments
Closed

adjoint(a) != conj(a) for a::Sym #425

olof3 opened this issue May 22, 2021 · 2 comments

Comments

@olof3
Copy link

olof3 commented May 22, 2021

For example,

@syms a
ishermitian([1 a; conj(a) 1])

returns false.

Since Sym <: Number and

@syms b real=true
adjoint(b) == conj(b)

I would have expected this to hold. Seems like the root cause is in SymPy itself :/, since there a.conjugate() != a.adjoint()?

@jverzani
Copy link
Collaborator

There was a recent PR that changed @syms and assumptions. Your syntax continues to work with @vars, but for @syms you now have:

julia> @syms a
(a,)

julia> ishermitian([1 a; conj(a) 1])
false

julia> ishermitian([1 a; adjoint(a) 1])
true

julia> @syms a::real
(a,)

julia> ishermitian([1 a; conj(a) 1])
true

Now, following the motto of "no good github issue goes without some improvement" (I'm sure some such proverb exists) I was going to say you should look at the docstring for @syms for more detail, but there is an extra new line that stops the display, so look here (https://github.com/JuliaPy/SymPy.jl/blob/master/src/constructors.jl#L59).

@olof3
Copy link
Author

olof3 commented May 22, 2021

Great, Thank you!

@olof3 olof3 closed this as completed May 22, 2021
jverzani added a commit that referenced this issue May 24, 2021
* add tilde, following Symbolics; fix issue from #425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants