Identity operator doesn't act on adjoint operator

33 views
Skip to first unread message

Michele Cotrufo

unread,
Jun 27, 2020, 2:52:31 PM6/27/20
to sympy
Is there a way to specify that the identity operator must act as identity also on the adjoint operators?

from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.operator import Operator
from sympy.physics.quantum import IdentityOperator
A = Operators('A')
Identity = IdentityOperator()
A * Identity #This gives A, correctly
B = Dagger(A)
B * Identity #This returns A^\dagger I . so it does not remove the identity operator

Oscar Benjamin

unread,
Jun 28, 2020, 3:17:15 PM6/28/20
to sympy
Hi Michele,

I don't know the quantum module so well but does qapply work in this case?

Oscar
> --
> 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 sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/83e0e21a-4f5a-48b9-9010-74a392928245o%40googlegroups.com.

Michele Cotrufo

unread,
Jun 29, 2020, 1:28:46 PM6/29/20
to sympy
It worked, thanks!


On Sunday, June 28, 2020 at 3:17:15 PM UTC-4, Oscar wrote:
Hi Michele,

I don't know the quantum module so well but does qapply work in this case?

Oscar

On Sat, 27 Jun 2020 at 19:52, Michele Cotrufo <michele...@gmail.com> wrote:
>
> Is there a way to specify that the identity operator must act as identity also on the adjoint operators?
>
> from sympy.physics.quantum.dagger import Dagger
> from sympy.physics.quantum.operator import Operator
> from sympy.physics.quantum import IdentityOperator
> A = Operators('A')
> Identity = IdentityOperator()
> A * Identity #This gives A, correctly
> B = Dagger(A)
> B * Identity #This returns A^\dagger I . so it does not remove the identity operator
>
> --
> 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 sy...@googlegroups.com.

Aaron Meurer

unread,
Jun 30, 2020, 5:48:32 PM6/30/20
to sympy
I don't know enough about the quantum module to know what sorts of
automatic evaluation would be expected, but this looks like it is a
bug. Can you open an issue on the issue tracker about it
https://github.com/sympy/sympy/issues/new

Aaron Meurer
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/1deb24bf-4d9b-4252-88dd-797dde4234f1o%40googlegroups.com.

Dhruv Mendiratta

unread,
Jul 1, 2020, 6:03:39 AM7/1/20
to sy...@googlegroups.com
Hi, I am a beginner in the field (about halfway through my first course) and I too think you are right about this being a bug. I think making `Dagger` a subclass of `Operator`  should work as a hermitian conjugate should behave as an operator.

Reply all
Reply to author
Forward
0 new messages