Qiskit-terra: Show pi in the text drawer as ฯ€

Created on 20 Aug 2020  ยท  10Comments  ยท  Source: Qiskit/qiskit-terra


What is the expected enhancement?

Based on a discussion in #4931, there's interest in displaying pi in the text drawer as ฯ€instead of pi.

                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
Change from   q_0: โ”ค RX(pij) โ”œ     to   q_0: โ”ค RX(ฯ€j)  โ”œ
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

To do this on all platforms requires completion of #4900 and modifying pi_check and 24 tests.

good first issue enhancement

All 10 comments

Can I be assigned this issue please? I'd like to give it a shot, I actually think it might be a good first issue.

It's ok by me. @1ucian0 Ok by you?

Sure

ping @PaulMcElligott ! Any news?

Still working on it.
Have been busy. I'll have more time tomorrow morning.

another ping @PaulMcElligott?

Hi @1ucian0. I have managed to recreate the issue, but I'm having difficulty recreating it in a new environment. I have been following @aasfaw's episode closely. I am new to using git & anaconda.

Method to reproduce

from qiskit import *
import numpy as np
import sympy
from sympy.abc import pi
pi = np.pi
qr = QuantumRegister(1)
circuit_all = QuantumCircuit(qr)
circuit_all.rx(pi,0)
circuit_all.draw()
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
q10_0: โ”ค RX(pi) โ”œ
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
circuit_all.draw(output='mpl')

mpl (below) subtext uses the greek letter 'π' instead of the latinized 'pi'
image

Action plan

  1. Attempt pass in a greek letter π using sympy in the notebook.
  2. Inspect visualization.matplotlib.py to see what the mpl uses for greek letters and try to insert it in the code in visualiztions.txt.py

You might be overthinking this one.

Either inpt in pi_check can take the self.encoding as input, or you replace pi by ฯ€ after that (if the encoding allows it).

@PaulMcElligott are you still in it? can I try this one? @1ucian0

Sure! Go ahead @alejomonbar

Was this page helpful?
0 / 5 - 0 ratings