qutip-qip
qutip-qip copied to clipboard
Custom gates in LaTeX drawings do not display names, just a "U"
hello, I have a question in https://qutip-qip.readthedocs.io/en/latest/qip-simulator.html.
from qutip_qip.circuit import QubitCircuit from qutip_qip.operations import ( Gate, controlled_gate, hadamard_transform) def controlled_hadamard(): # Controlled Hadamard return controlled_gate( hadamard_transform(1), controls=0, targets=1, control_value=1) qc = QubitCircuit(N=3, num_cbits=3) qc.user_gates = {"cH": controlled_hadamard} qc.add_gate("QASMU", targets=[0], arg_value=[1.91063, 0, 0]) qc.add_gate("cH", targets=[0,1]) qc.add_gate("TOFFOLI", targets=[2], controls=[0, 1]) qc.add_gate("X", targets=[0]) qc.add_gate("X", targets=[1]) qc.add_gate("CNOT", targets=[1], controls=0)
in the circuit , the custom gate "cH" can show in here, but when I try to custom another gate, there are just a "U" in the circuit, it cannot display defined names. when I copy this code in a new jupyter notebook, it also show "U" in the circuit, and not "cH" like https://qutip-qip.readthedocs.io/en/latest/qip-simulator.html.
I want to ask, how can I display a custom name in circuit with latex.