How can I create a custom gate in qiskit that is plotted using latex formatting (or another type of formatting)? For example the following code generates a circuit diagram
from qiskit import QuantumCircuit from qiskit.circuit import Gate qc = QuantumCircuit(1, 1) qc.append(Gate(name=r'X_t', num_qubits=1, params=), ) qc.measure([0, ], [0,]) qc.draw(output='latex', interactive=False, filename='test.png')
The custom gate is labelled as X_t, but I want the name to be formatted as an X with subscript t. I tried variations as
qc.append(Gate(name=r'$X_t$', num_qubits=1, params=), )
but that does not work.
Note: reported on github as well https://github.com/Qiskit/qiskit-terra/issues/3171