This is perhaps related to this issue: https://github.com/sympy/sympy/issues/24153
On Mon, 21 Nov 2022 at 17:03, Iman <[email protected]> wrote: > > It runs on my PC. > I imported additional modules: > from sympy.physics.quantum import * > from sympy.physics.quantum.qubit import * > from sympy.physics.quantum.gate import * > from sympy.physics.quantum.grover import * > from sympy.physics.quantum.qft import QFT, IQFT, Fourier > from sympy.physics.quantum.circuitplot import circuit_plot > > Sorry about the confusion. > The output of a single Y(0) is correct. But two Y(0) multiplying is not. > represent(Y(0),nqubits=1) > > On Monday, November 21, 2022 at 11:56:14 AM UTC-5 Oscar wrote: >> >> 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/ed61e2bc-b3ca-4209-b31f-fe35bfff0233n%40googlegroups.com. -- 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/CAHVvXxT2Tybh--50V7HXFu8tm-OnwNiD2r7MJET5NzUE-7LQXg%40mail.gmail.com.
