On Mon, 21 Nov 2022 at 16:51, Iman <[email protected]> wrote:
>
> I encountered a issue with the output of the following script:
>
> from sympy.physics.quantum import *
> represent(Y(0)*Y(0),nqubits=1)
>
> I am expecting the ouput being a 2 by 2 identity matrix. But instead,
> the output is a single number 1.
>
> I don't know if it is a bug in the Python code or I misused the python
> function.
It probably is a bug but the code shown does not run for another reason:
In [1]: from sympy.physics.quantum import *
...: represent(Y(0)*Y(0),nqubits=1)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-ba167e22823e> in <cell line: 2>()
1 from sympy.physics.quantum import *
----> 2 represent(Y(0)*Y(0),nqubits=1)
NameError: name 'Y' is not defined
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAHVvXxTRrdepk6bSqYnCmETV29jT00gQX%2BMaL868OFKcjS%3DqOQ%40mail.gmail.com.