-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a use case or problem? Please describe.
There are common notations for some gates supported by QCircuit, but Cirq's circuit_to_latex_using_qcircuit doesn't use them. This includes:
- SWAP gate which rendered as rectangle with "SWAP" inside it, instead of two crosses connected by a line.
- Multi-controlled X gate, where some controls are "1" and some are "0". Conventional notation for "0" controls is unfilled circle.
Describe the solution you'd like
Add special handling for common conventional notations (supported by QCircuit) to circuit_to_latex_using_qcircuit.
[optional] Describe alternatives/workarounds you've considered
I wrote a find-and-replace post-processing script which produces desired result in my case:
def process_latex(s):
s = s.replace('\\multigate{1}{\\text{SWAP}}', '\\qswap')
s = s.replace('\\ghost{\\text{SWAP}}', '\\qswap\\qwx')
s = s.replace('\\gate{\\text{@}}','\\control')
s = s.replace('\\gate{\\text{(0)}}','\\ctrlo{}')
s = s.replace('\\gate{\\text{X}}','\\targ')
while ' ' in s:
s = s.replace(' ', ' ')
return s
[optional] Additional context (e.g. screenshots)
Example of circuit, its current rendering and desired rendering (which was obtained with a script above):
What is the urgency from your perspective for this issue? Is it blocking important work?
P3
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
