From 31ffe3401b5e24a6f7f8f6b399e9251036cfbb4f Mon Sep 17 00:00:00 2001 From: nikolai Date: Sat, 1 Mar 2025 18:16:49 -0500 Subject: [PATCH 1/8] successfully created testcase for recreation of formatting discrepancies --- .../cirq/contrib/qcircuit/qcircuit_test.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index a6f7f408612..ad3c50ecf24 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -101,6 +101,7 @@ def test_teleportation_diagram(): &\lstick{\text{bob}}& \qw& \qw&\targ \qw\qwx& \qw & \qw&\targ \qw\qwx&\control \qw\qwx&\qw\\ \\ }""".strip() + print(circuit) assert_has_qcircuit_diagram( circuit, expected_diagram, qubit_order=cirq.QubitOrder.explicit([ali, car, bob]) ) @@ -165,3 +166,29 @@ def test_sqrt_iswap_diagram(): \\ }""".strip() assert_has_qcircuit_diagram(circuit, expected_diagram) + +def test_latex_formatting(): + # test for proper rendering of failing latex formats + q0, q1, q2 = cirq.LineQubit.range(3) + + # custom gate with a control for zero and one + custom_gate = cirq.X.controlled(2, control_values=(0, 1)) + + circuit = cirq.Circuit( + custom_gate(q0, q1, q2), + custom_gate(q2, q0, q1), + custom_gate(q1, q2, q0), + cirq.SWAP(q0, q1), + cirq.SWAP(q1, q2) + ) + print(circuit) + + expected_diagram = r""" +\Qcircuit @R=1em @C=0.75em { + \\ + &\lstick{\text{q(0)}}& \qw&\ctrlo{} \qw &\control \qw &\targ \qw &\qswap \qw& \qw&\qw\\ + &\lstick{\text{q(1)}}& \qw&\control \qw\qwx&\targ \qw\qwx&\ctrlo{} \qw\qwx&\qswap\qwx \qw&\qswap \qw&\qw\\ + &\lstick{\text{q(2)}}& \qw&\targ \qw\qwx&\ctrlo{} \qw\qwx&\control \qw\qwx& \qw&\qswap\qwx \qw&\qw\\ +}""".strip() + + assert_has_qcircuit_diagram(circuit, expected_diagram) \ No newline at end of file From e1c21bba815b6cd696e2c9721982d93762d1341c Mon Sep 17 00:00:00 2001 From: nikolai Date: Tue, 4 Mar 2025 14:51:13 -0500 Subject: [PATCH 2/8] failing testcase debugging complete - functions marked to be modified --- cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py | 6 ++++++ .../cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | 5 +++++ cirq-core/cirq/contrib/qcircuit/qcircuit_test.py | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py index 0f6cae2c68f..8ceb05d5361 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py @@ -64,6 +64,9 @@ def hardcoded_qcircuit_diagram_info(op: ops.Operation) -> Optional[protocols.Cir return protocols.CircuitDiagramInfo(symbols) if symbols else None + +#TODO: Modification required here to fix \targ \control \ctrlo{} issues + def convert_text_diagram_info_to_qcircuit_diagram_info( info: protocols.CircuitDiagramInfo, ) -> protocols.CircuitDiagramInfo: @@ -74,6 +77,9 @@ def convert_text_diagram_info_to_qcircuit_diagram_info( return protocols.CircuitDiagramInfo(symbols) + +#TODO: Modification required here to fix the multigate/swap/ ghost/swap issue + def multigate_qcircuit_diagram_info( op: ops.Operation, args: protocols.CircuitDiagramInfoArgs ) -> Optional[protocols.CircuitDiagramInfo]: diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py index 69bbf36ab51..b86086a800f 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py @@ -16,6 +16,11 @@ import cirq.contrib.qcircuit as ccq +# Update - Debugging complete - new testcases required +#TODO: Testcase required here for methods: +# convert_text_diagram_info_to_qcircuit_diagram_info +# multigate_qcircuit_diagram_info + def test_get_qcircuit_diagram_info(): qubits = cirq.NamedQubit('x'), cirq.NamedQubit('y') diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index ad3c50ecf24..d6e9d456b7f 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -191,4 +191,6 @@ def test_latex_formatting(): &\lstick{\text{q(2)}}& \qw&\targ \qw\qwx&\ctrlo{} \qw\qwx&\control \qw\qwx& \qw&\qswap\qwx \qw&\qw\\ }""".strip() - assert_has_qcircuit_diagram(circuit, expected_diagram) \ No newline at end of file + assert_has_qcircuit_diagram(circuit, expected_diagram) + +# test_latex_formatting() \ No newline at end of file From 05864207f6a81c9cc765028c2eef976b4ce45f40 Mon Sep 17 00:00:00 2001 From: nikolai Date: Mon, 17 Mar 2025 20:44:39 -0400 Subject: [PATCH 3/8] LaTex conversion for custom control gate and swap gate complete --- .../qcircuit/pdf_test_files/test_pdf.pdf | Bin 0 -> 24946 bytes .../qcircuit/pdf_test_files/test_pdf.tex | 21 +++++++ .../contrib/qcircuit/qcircuit_diagram_info.py | 56 ++++++++++++++---- .../qcircuit/qcircuit_diagram_info_test.py | 10 +--- .../cirq/contrib/qcircuit/qcircuit_test.py | 8 +-- 5 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 cirq-core/cirq/contrib/qcircuit/pdf_test_files/test_pdf.pdf create mode 100644 cirq-core/cirq/contrib/qcircuit/pdf_test_files/test_pdf.tex diff --git a/cirq-core/cirq/contrib/qcircuit/pdf_test_files/test_pdf.pdf b/cirq-core/cirq/contrib/qcircuit/pdf_test_files/test_pdf.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3483e782e87d0ddce0fa80dd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=;5u9aMrfNFBrj3o8F4+p^Y%Mt_HexL z^c$Fxn&{G#_Z{!5q4x)0mH5(|-1ih54u{EN(^X)@BplhV#*$%?U~%x7>yf;=ZGvt= zmR6N8D}Pj8Zbr;v1yUmr##|NvQHu!mT$3aVOTxFU8HW zy%Pcps zE#MJUcEZ6T{*j&sB}?LKsT4LulXlUXuQ2af@L&yH;AV0i_O}RirxZGZqP#L8im~gFD%oi+H1e%0 zlu~ij#}$culonsR94N->dnx;uF@`(eU4NBv?A1(~REsA_XIz5JSY{}`f8lkQnZ~O# z62`p^e8E~()$1$43QYme@AB~TWBlL2*8e9D{}^)pO(eb}oPQPx=+7F#|1XKSgf{=I z5SO9KuL|*ZYV^+n@x%8^NVOXf!a1RUYBL~einf+Ov~*br*Z3uP`8^Dhf&*1)Cm_!H zKE&^U>c5cEm$-R=KW&M!0O;~;%C?GH2tAOqr4{f8fYbAV0o*kZ;zY8Q<^@X7FkV3@9~YR96%1wt+9^9({!ZvGY=61P{!@M2(-mQb4TQr& z*Z}YP&liA@=I7-HS%Lnt3BiCPaQOl`{>ugv1dik1Y~V{B|HTG{!gv9-|JB9|69TS_ zUu}F~7;vV3wLxG&wEn9N3;_%LeO@TQcm~S;zw`w|ApF1gA_V^Xcu-#OZ{tDvAip02KFH5=AYI|W>V+%tdj=pLO Optional[Tuple[int, int]]: if (args.label_map is None) or (args.known_qubits is None): @@ -70,10 +83,18 @@ def hardcoded_qcircuit_diagram_info(op: ops.Operation) -> Optional[protocols.Cir def convert_text_diagram_info_to_qcircuit_diagram_info( info: protocols.CircuitDiagramInfo, ) -> protocols.CircuitDiagramInfo: - labels = [escape_text_for_latex(e) for e in info.wire_symbols] - if info.exponent != 1: - labels[0] += '^{' + str(info.exponent) + '}' - symbols = tuple(r'\gate{' + l + '}' for l in labels) + symbols = None + if len(info.wire_symbols) == 3 and \ + '(0)' in info.wire_symbols and \ + '@' in info.wire_symbols and \ + 'X' in info.wire_symbols: + labels = [escape_text_for_latex_custom_control_gate(e) for e in info.wire_symbols] + symbols = tuple(l for l in labels) + else: + labels = [escape_text_for_latex(e) for e in info.wire_symbols] + if info.exponent != 1: + labels[0] += '^{' + str(info.exponent) + '}' + symbols = tuple(r'\gate{' + l + '}' for l in labels) return protocols.CircuitDiagramInfo(symbols) @@ -95,17 +116,26 @@ def multigate_qcircuit_diagram_info( info = protocols.circuit_diagram_info(op, args, default=None) min_index, n_qubits = multigate_parameters - name = escape_text_for_latex( - str(op.gate).rsplit('**', 1)[0] if isinstance(op, ops.GateOperation) else str(op) - ) - if (info is not None) and (info.exponent != 1): - name += '^{' + str(info.exponent) + '}' - box = r'\multigate{' + str(n_qubits - 1) + '}{' + name + '}' - ghost = r'\ghost{' + name + '}' + + symbols = None assert args.label_map is not None assert args.known_qubits is not None - symbols = tuple(box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits) - # Force exponent=1 to defer to exponent formatting given above. + + if (op.gate == ops.SWAP): + box = r'\qswap' + ghost = r'\qswap\qwx' + symbols = tuple(box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits) + else: + name = escape_text_for_latex( + str(op.gate).rsplit('**', 1)[0] if isinstance(op, ops.GateOperation) else str(op) + ) + if (info is not None) and (info.exponent != 1): + name += '^{' + str(info.exponent) + '}' + box = r'\multigate{' + str(n_qubits - 1) + '}{' + name + '}' + ghost = r'\ghost{' + name + '}' + symbols = tuple(box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits) + # Force exponent=1 to defer to exponent formatting given above. + return protocols.CircuitDiagramInfo(symbols, connected=False) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py index b86086a800f..585376c4ce1 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py @@ -15,12 +15,6 @@ import cirq import cirq.contrib.qcircuit as ccq - -# Update - Debugging complete - new testcases required -#TODO: Testcase required here for methods: -# convert_text_diagram_info_to_qcircuit_diagram_info -# multigate_qcircuit_diagram_info - def test_get_qcircuit_diagram_info(): qubits = cirq.NamedQubit('x'), cirq.NamedQubit('y') @@ -53,7 +47,7 @@ def test_get_qcircuit_diagram_info(): ) actual_info = ccq.get_qcircuit_diagram_info(op, args) expected_info = cirq.CircuitDiagramInfo( - (r'\ghost{\text{SWAP}}', r'\multigate{1}{\text{SWAP}}'), connected=False + (r'\qswap\qwx', r'\qswap'), connected=False ) assert actual_info == expected_info @@ -71,3 +65,5 @@ def test_get_qcircuit_diagram_info(): actual_info = ccq.get_qcircuit_diagram_info(op, cirq.CircuitDiagramInfoArgs.UNINFORMED_DEFAULT) assert actual_info == expected_info + +test_get_qcircuit_diagram_info() \ No newline at end of file diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index d6e9d456b7f..e94a26a8802 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -15,6 +15,7 @@ import cirq import cirq.contrib.qcircuit as ccq import cirq.testing as ct +import cirq.contrib.qcircuit.qcircuit_pdf as pdf def assert_has_qcircuit_diagram(actual: cirq.Circuit, desired: str, **kwargs) -> None: @@ -101,7 +102,6 @@ def test_teleportation_diagram(): &\lstick{\text{bob}}& \qw& \qw&\targ \qw\qwx& \qw & \qw&\targ \qw\qwx&\control \qw\qwx&\qw\\ \\ }""".strip() - print(circuit) assert_has_qcircuit_diagram( circuit, expected_diagram, qubit_order=cirq.QubitOrder.explicit([ali, car, bob]) ) @@ -181,7 +181,6 @@ def test_latex_formatting(): cirq.SWAP(q0, q1), cirq.SWAP(q1, q2) ) - print(circuit) expected_diagram = r""" \Qcircuit @R=1em @C=0.75em { @@ -189,8 +188,7 @@ def test_latex_formatting(): &\lstick{\text{q(0)}}& \qw&\ctrlo{} \qw &\control \qw &\targ \qw &\qswap \qw& \qw&\qw\\ &\lstick{\text{q(1)}}& \qw&\control \qw\qwx&\targ \qw\qwx&\ctrlo{} \qw\qwx&\qswap\qwx \qw&\qswap \qw&\qw\\ &\lstick{\text{q(2)}}& \qw&\targ \qw\qwx&\ctrlo{} \qw\qwx&\control \qw\qwx& \qw&\qswap\qwx \qw&\qw\\ + \\ }""".strip() - assert_has_qcircuit_diagram(circuit, expected_diagram) - -# test_latex_formatting() \ No newline at end of file + assert_has_qcircuit_diagram(circuit, expected_diagram) \ No newline at end of file From a1484fd0edd5a0dba993c4f52300b67f4e1aca27 Mon Sep 17 00:00:00 2001 From: nikolai Date: Tue, 18 Mar 2025 12:30:27 -0400 Subject: [PATCH 4/8] added pdf test (which is currently out of scope for this issue) and cleaned up other files --- .../contrib/qcircuit/qcircuit_diagram_info.py | 6 ---- .../qcircuit/qcircuit_diagram_info_test.py | 4 +-- .../cirq/contrib/qcircuit/qcircuit_test.py | 34 ++++++++++++++++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py index abd325b916e..6f666a36741 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py @@ -77,9 +77,6 @@ def hardcoded_qcircuit_diagram_info(op: ops.Operation) -> Optional[protocols.Cir return protocols.CircuitDiagramInfo(symbols) if symbols else None - -#TODO: Modification required here to fix \targ \control \ctrlo{} issues - def convert_text_diagram_info_to_qcircuit_diagram_info( info: protocols.CircuitDiagramInfo, ) -> protocols.CircuitDiagramInfo: @@ -98,9 +95,6 @@ def convert_text_diagram_info_to_qcircuit_diagram_info( return protocols.CircuitDiagramInfo(symbols) - -#TODO: Modification required here to fix the multigate/swap/ ghost/swap issue - def multigate_qcircuit_diagram_info( op: ops.Operation, args: protocols.CircuitDiagramInfoArgs ) -> Optional[protocols.CircuitDiagramInfo]: diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py index 585376c4ce1..61cf38b6515 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py @@ -64,6 +64,4 @@ def test_get_qcircuit_diagram_info(): assert actual_info == expected_info actual_info = ccq.get_qcircuit_diagram_info(op, cirq.CircuitDiagramInfoArgs.UNINFORMED_DEFAULT) - assert actual_info == expected_info - -test_get_qcircuit_diagram_info() \ No newline at end of file + assert actual_info == expected_info \ No newline at end of file diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index e94a26a8802..e81946dee28 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -191,4 +191,36 @@ def test_latex_formatting(): \\ }""".strip() - assert_has_qcircuit_diagram(circuit, expected_diagram) \ No newline at end of file + assert_has_qcircuit_diagram(circuit, expected_diagram) + +def test_pdf_custom_gates(): + # test for proper rendering of failing latex formats in a pdf + q0, q1, q2 = cirq.LineQubit.range(3) + + # custom gate with a control for zero and one + custom_gate = cirq.X.controlled(2, control_values=(0, 1)) + + circuit = cirq.Circuit( + custom_gate(q0, q1, q2), + custom_gate(q2, q0, q1), + custom_gate(q1, q2, q0), + cirq.SWAP(q0, q1), + cirq.SWAP(q1, q2) + ) + + pdf_kwargs = { + 'compiler': 'latexmk', + 'compiler_args': [ + '-pdf', + '-f', + '-pdflatex=xelatex', + '-quiet' + ] + } + + remove = ['aux', 'fdb_latexmk', 'fls', 'log'] + + # This test was facing errors due to technical issues in qcuircuit_pdf.py that are out of scope of my issue (4685) + # It will remain commented out until a resolution is found, or until it is realized that this test is not necessary + + # pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", pdf_kwargs, None, remove) From 0cb9db23ca3d4974f31263eff3f963b39cd68392 Mon Sep 17 00:00:00 2001 From: nikolai Date: Tue, 18 Mar 2025 16:33:20 -0400 Subject: [PATCH 5/8] fixed lint and formatting issues --- .../contrib/qcircuit/qcircuit_diagram_info.py | 33 ++++++------ .../qcircuit/qcircuit_diagram_info_test.py | 6 +-- .../cirq/contrib/qcircuit/qcircuit_test.py | 50 +++++++++---------- 3 files changed, 39 insertions(+), 50 deletions(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py index 6f666a36741..73af462803e 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py @@ -33,18 +33,7 @@ def escape_text_for_latex(text): return r'\text{' + escaped + '}' def escape_text_for_latex_custom_control_gate(text): - return ( - text.replace('(0)', r'\ctrlo{}') - .replace('@', r'\control') - .replace('X', r'\targ') - ) - -def escape_text_for_latex_swap_gate(text): - return ( - text.replace('SWAP', r'\qswap') - .replace('@', r'\control') - .replace('X', r'\targ') - ) + return text.replace('(0)', r'\ctrlo{}').replace('@', r'\control').replace('X', r'\targ') def get_multigate_parameters(args: protocols.CircuitDiagramInfoArgs) -> Optional[Tuple[int, int]]: if (args.label_map is None) or (args.known_qubits is None): @@ -81,10 +70,12 @@ def convert_text_diagram_info_to_qcircuit_diagram_info( info: protocols.CircuitDiagramInfo, ) -> protocols.CircuitDiagramInfo: symbols = None - if len(info.wire_symbols) == 3 and \ - '(0)' in info.wire_symbols and \ - '@' in info.wire_symbols and \ - 'X' in info.wire_symbols: + if ( + len(info.wire_symbols) == 3 + and '(0)' in info.wire_symbols + and '@' in info.wire_symbols + and 'X' in info.wire_symbols + ): labels = [escape_text_for_latex_custom_control_gate(e) for e in info.wire_symbols] symbols = tuple(l for l in labels) else: @@ -115,10 +106,12 @@ def multigate_qcircuit_diagram_info( assert args.label_map is not None assert args.known_qubits is not None - if (op.gate == ops.SWAP): + if op.gate == ops.SWAP: box = r'\qswap' ghost = r'\qswap\qwx' - symbols = tuple(box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits) + symbols = tuple( + box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits + ) else: name = escape_text_for_latex( str(op.gate).rsplit('**', 1)[0] if isinstance(op, ops.GateOperation) else str(op) @@ -127,7 +120,9 @@ def multigate_qcircuit_diagram_info( name += '^{' + str(info.exponent) + '}' box = r'\multigate{' + str(n_qubits - 1) + '}{' + name + '}' ghost = r'\ghost{' + name + '}' - symbols = tuple(box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits) + symbols = tuple( + box if (args.label_map[q] == min_index) else ghost for q in args.known_qubits + ) # Force exponent=1 to defer to exponent formatting given above. return protocols.CircuitDiagramInfo(symbols, connected=False) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py index 61cf38b6515..8780f48f1c0 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py @@ -30,9 +30,7 @@ def test_get_qcircuit_diagram_info(): ) actual_info = ccq.get_qcircuit_diagram_info(op, args) name = r'{\text{SWAP}^{0.5}}' - expected_info = cirq.CircuitDiagramInfo( - (r'\multigate{1}' + name, r'\ghost' + name), exponent=1, connected=False - ) + expected_info = cirq.CircuitDiagramInfo((r'\multigate{1}' + name, r'\ghost' + name), exponent=1, connected=False) assert actual_info == expected_info gate = cirq.SWAP @@ -64,4 +62,4 @@ def test_get_qcircuit_diagram_info(): assert actual_info == expected_info actual_info = ccq.get_qcircuit_diagram_info(op, cirq.CircuitDiagramInfoArgs.UNINFORMED_DEFAULT) - assert actual_info == expected_info \ No newline at end of file + assert actual_info == expected_info diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index e81946dee28..b0f9c87b648 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -15,7 +15,7 @@ import cirq import cirq.contrib.qcircuit as ccq import cirq.testing as ct -import cirq.contrib.qcircuit.qcircuit_pdf as pdf +# import cirq.contrib.qcircuit.qcircuit_pdf as pdf def assert_has_qcircuit_diagram(actual: cirq.Circuit, desired: str, **kwargs) -> None: @@ -179,7 +179,7 @@ def test_latex_formatting(): custom_gate(q2, q0, q1), custom_gate(q1, q2, q0), cirq.SWAP(q0, q1), - cirq.SWAP(q1, q2) + cirq.SWAP(q1, q2), ) expected_diagram = r""" @@ -193,34 +193,30 @@ def test_latex_formatting(): assert_has_qcircuit_diagram(circuit, expected_diagram) -def test_pdf_custom_gates(): - # test for proper rendering of failing latex formats in a pdf - q0, q1, q2 = cirq.LineQubit.range(3) + +# def test_pdf_custom_gates(): +# # test for proper rendering of failing latex formats in a pdf +# q0, q1, q2 = cirq.LineQubit.range(3) - # custom gate with a control for zero and one - custom_gate = cirq.X.controlled(2, control_values=(0, 1)) +# # custom gate with a control for zero and one +# custom_gate = cirq.X.controlled(2, control_values=(0, 1)) - circuit = cirq.Circuit( - custom_gate(q0, q1, q2), - custom_gate(q2, q0, q1), - custom_gate(q1, q2, q0), - cirq.SWAP(q0, q1), - cirq.SWAP(q1, q2) - ) +# circuit = cirq.Circuit( +# custom_gate(q0, q1, q2), +# custom_gate(q2, q0, q1), +# custom_gate(q1, q2, q0), +# cirq.SWAP(q0, q1), +# cirq.SWAP(q1, q2), +# ) - pdf_kwargs = { - 'compiler': 'latexmk', - 'compiler_args': [ - '-pdf', - '-f', - '-pdflatex=xelatex', - '-quiet' - ] - } +# pdf_kwargs = { +# 'compiler': 'latexmk', +# 'compiler_args': ['-pdf', '-f', '-pdflatex=xelatex', '-quiet'], +# } - remove = ['aux', 'fdb_latexmk', 'fls', 'log'] +# remove = ['aux', 'fdb_latexmk', 'fls', 'log'] - # This test was facing errors due to technical issues in qcuircuit_pdf.py that are out of scope of my issue (4685) - # It will remain commented out until a resolution is found, or until it is realized that this test is not necessary +# # This test was facing errors due to technical issues in qcuircuit_pdf.py that are out of scope of my issue (4685) +# # It will remain commented out until a resolution is found, or until it is realized that this test is not necessary - # pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", pdf_kwargs, None, remove) +# # pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", pdf_kwargs, None, remove) From 23269f6ad00b52fa5295c1209f36fac69cea656f Mon Sep 17 00:00:00 2001 From: nikolai Date: Tue, 18 Mar 2025 18:21:26 -0400 Subject: [PATCH 6/8] further fixed formatting and lint issues --- cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py | 4 +++- .../cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | 9 +++++---- cirq-core/cirq/contrib/qcircuit/qcircuit_test.py | 8 +++++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py index 73af462803e..e792a7b84ff 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info.py @@ -32,9 +32,11 @@ def escape_text_for_latex(text): ) return r'\text{' + escaped + '}' + def escape_text_for_latex_custom_control_gate(text): return text.replace('(0)', r'\ctrlo{}').replace('@', r'\control').replace('X', r'\targ') + def get_multigate_parameters(args: protocols.CircuitDiagramInfoArgs) -> Optional[Tuple[int, int]]: if (args.label_map is None) or (args.known_qubits is None): return None @@ -71,7 +73,7 @@ def convert_text_diagram_info_to_qcircuit_diagram_info( ) -> protocols.CircuitDiagramInfo: symbols = None if ( - len(info.wire_symbols) == 3 + len(info.wire_symbols) == 3 and '(0)' in info.wire_symbols and '@' in info.wire_symbols and 'X' in info.wire_symbols diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py index 8780f48f1c0..a7a03bde2ed 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py @@ -15,6 +15,7 @@ import cirq import cirq.contrib.qcircuit as ccq + def test_get_qcircuit_diagram_info(): qubits = cirq.NamedQubit('x'), cirq.NamedQubit('y') @@ -30,7 +31,9 @@ def test_get_qcircuit_diagram_info(): ) actual_info = ccq.get_qcircuit_diagram_info(op, args) name = r'{\text{SWAP}^{0.5}}' - expected_info = cirq.CircuitDiagramInfo((r'\multigate{1}' + name, r'\ghost' + name), exponent=1, connected=False) + expected_info = cirq.CircuitDiagramInfo( + (r'\multigate{1}' + name, r'\ghost' + name), exponent=1, connected=False + ) assert actual_info == expected_info gate = cirq.SWAP @@ -44,9 +47,7 @@ def test_get_qcircuit_diagram_info(): label_map=qubit_map, ) actual_info = ccq.get_qcircuit_diagram_info(op, args) - expected_info = cirq.CircuitDiagramInfo( - (r'\qswap\qwx', r'\qswap'), connected=False - ) + expected_info = cirq.CircuitDiagramInfo((r'\qswap\qwx', r'\qswap'), connected=False) assert actual_info == expected_info qubit_map = {q: i for q, i in zip(qubits, (2, 5))} diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index b0f9c87b648..6b5f5cb82a9 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -15,6 +15,7 @@ import cirq import cirq.contrib.qcircuit as ccq import cirq.testing as ct + # import cirq.contrib.qcircuit.qcircuit_pdf as pdf @@ -167,10 +168,11 @@ def test_sqrt_iswap_diagram(): }""".strip() assert_has_qcircuit_diagram(circuit, expected_diagram) + def test_latex_formatting(): # test for proper rendering of failing latex formats q0, q1, q2 = cirq.LineQubit.range(3) - + # custom gate with a control for zero and one custom_gate = cirq.X.controlled(2, control_values=(0, 1)) @@ -190,14 +192,14 @@ def test_latex_formatting(): &\lstick{\text{q(2)}}& \qw&\targ \qw\qwx&\ctrlo{} \qw\qwx&\control \qw\qwx& \qw&\qswap\qwx \qw&\qw\\ \\ }""".strip() - + assert_has_qcircuit_diagram(circuit, expected_diagram) # def test_pdf_custom_gates(): # # test for proper rendering of failing latex formats in a pdf # q0, q1, q2 = cirq.LineQubit.range(3) - + # # custom gate with a control for zero and one # custom_gate = cirq.X.controlled(2, control_values=(0, 1)) From 1780947a9b5184538dc62eb614a20fcb48a010f8 Mon Sep 17 00:00:00 2001 From: nikolai Date: Tue, 18 Mar 2025 19:52:10 -0400 Subject: [PATCH 7/8] the last of the lint errors, hopefully --- cirq-core/cirq/contrib/qcircuit/qcircuit_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index 6b5f5cb82a9..b9509c56f6c 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -218,7 +218,15 @@ def test_latex_formatting(): # remove = ['aux', 'fdb_latexmk', 'fls', 'log'] -# # This test was facing errors due to technical issues in qcuircuit_pdf.py that are out of scope of my issue (4685) -# # It will remain commented out until a resolution is found, or until it is realized that this test is not necessary - -# # pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", pdf_kwargs, None, remove) +# # This test was facing errors due to technical issues in qcuircuit_pdf.py +# # that are out of scope of my issue (4685) +# # It will remain commented out until a resolution is found, +# # or until it is realized that this test is not necessary + +# pdf.circuit_to_pdf_using_qcircuit_via_tex( +# circuit, +# "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", +# pdf_kwargs, +# None, +# remove +# ) From 3898f9e75fcf7edf7259e35e0e63c0ef606b75c1 Mon Sep 17 00:00:00 2001 From: nikolai Date: Wed, 19 Mar 2025 10:40:10 -0400 Subject: [PATCH 8/8] fixed last of the formatting issues, hopefully --- cirq-core/cirq/contrib/qcircuit/qcircuit_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py index b9509c56f6c..7dc2b826838 100644 --- a/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py +++ b/cirq-core/cirq/contrib/qcircuit/qcircuit_test.py @@ -218,15 +218,15 @@ def test_latex_formatting(): # remove = ['aux', 'fdb_latexmk', 'fls', 'log'] -# # This test was facing errors due to technical issues in qcuircuit_pdf.py +# # This test was facing errors due to technical issues in qcuircuit_pdf.py # # that are out of scope of my issue (4685) -# # It will remain commented out until a resolution is found, +# # It will remain commented out until a resolution is found, # # or until it is realized that this test is not necessary # pdf.circuit_to_pdf_using_qcircuit_via_tex( -# circuit, -# "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", -# pdf_kwargs, -# None, +# circuit, +# "./cirq-core/cirq/contrib/qcircuit/pdf_test_files/test", +# pdf_kwargs, +# None, # remove # )