2

I tried to follow the examples at Quantum Circuit Plotting with SymPy but I could not find the output picture.

My OS is Ubuntu and I typed all the commands in the terminal of IPython, as you can see here:

enter image description here

The output is similar to the one in that website,

<sympy.physics.quantum.circuitplot.CircuitPlot object at 0x7fa125ee5c10>

So, where is the output figure? In some folder?

PS: I run again and get another similar but different output

<sympy.physics.quantum.circuitplot.CircuitPlot at 0x7f6ff0903690>
karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

3

In all currently supported versions of Ubuntu open the terminal and type:

sudo apt install ipython python-sympy python-matplotlib # for Python 2.x in Ubuntu 18.04 and earlier

or

sudo apt install ipython3 python3-sympy python3-matplotlib # for Python 3.x 

Start the IPython interpreter with the --pylab option like this: ipython --pylab to enable showing the output plot as shown in the below screenshot. The Python code in the screenshot is identical to the code in the question.

enter image description here
X gate test

karel
  • 122,292
  • 133
  • 301
  • 332