QCHackers / tqec

Design automation software tools for Topological Quantum Error Correction
https://qchackers.github.io/tqec/
Apache License 2.0
63 stars 17 forks source link

Decreased code distance for logical CNOT circuits with X basis initialization/measurements #336

Closed inmzhang closed 4 days ago

inmzhang commented 1 week ago

As reported in #334, the logical error rates of the logical CNOT circuits with X basis initialization/measurements are suspiciously high compared to Z basis ones. And the exact circuit-level code distance is 2 instead of the expected 3.

The Z basis block graph is imported from the .dae file and looks like: 图片

The X basis block graph is constructed from a ZXGraph with the following code:

cnot_zx = ZXGraph("Logical CNOT ZX Graph")

cnot_zx.add_x_node(Position3D(0, 0, 0))
cnot_zx.add_z_node(Position3D(0, 0, 1))
cnot_zx.add_x_node(Position3D(0, 0, 2))
cnot_zx.add_x_node(Position3D(0, 0, 3))
cnot_zx.add_z_node(Position3D(0, 1, 1))
cnot_zx.add_x_node(Position3D(0, 1, 2))
cnot_zx.add_x_node(Position3D(1, 1, 0))
cnot_zx.add_x_node(Position3D(1, 1, 1))
cnot_zx.add_x_node(Position3D(1, 1, 2))
cnot_zx.add_x_node(Position3D(1, 1, 3))

cnot_zx.add_edge(Position3D(0, 0, 0), Position3D(0, 0, 1))
cnot_zx.add_edge(Position3D(0, 0, 1), Position3D(0, 0, 2))
cnot_zx.add_edge(Position3D(0, 0, 2), Position3D(0, 0, 3))
cnot_zx.add_edge(Position3D(0, 0, 1), Position3D(0, 1, 1))
cnot_zx.add_edge(Position3D(0, 1, 1), Position3D(0, 1, 2))
cnot_zx.add_edge(Position3D(0, 1, 2), Position3D(1, 1, 2))
cnot_zx.add_edge(Position3D(1, 1, 0), Position3D(1, 1, 1))
cnot_zx.add_edge(Position3D(1, 1, 1), Position3D(1, 1, 2))
cnot_zx.add_edge(Position3D(1, 1, 2), Position3D(1, 1, 3))
cnot_zx.to_block_graph("Logical CNOT Block Graph")

and looks like:

图片

There are two problems for the simulations of the above two block graphs:

  1. The structure of the two logical CNOT gates are not the same because the spatial boundaries are exchanged. For consistency, we need to change the code to generate the ZXGraph.
  2. The more deleterious problem is that currently we use the same CNOTs ordering within plaquettes for zx* and xz* cubes. The current ordering can prevent hook errors decreasing the circuit code distance for zx* cubes but failed for xz* cubes. This is the direct cause of the bug in this issue.
inmzhang commented 5 days ago

With the fix in #342, the simulation results of the six over-complete set of observables for logical CNOT gate, under uniform depolarizing noise model: logical_cnot_x_result_observable_0 logical_cnot_x_result_observable_1 logical_cnot_x_result_observable_2 logical_cnot_z_result_observable_0 logical_cnot_z_result_observable_1 logical_cnot_z_result_observable_2

afowler commented 5 days ago

Excellent! These all look correct now :-)

On Tue, Oct 8, 2024, 6:05 PM Yiming Zhang @.***> wrote:

With the fix in #342 https://github.com/QCHackers/tqec/pull/342, the simulation results of the six over-complete set of observables for logical CNOT gate, under uniform depolarizing noise model: logical_cnot_x_result_observable_0.png (view on web) https://github.com/user-attachments/assets/135b9805-ecee-47c3-931a-de3a307a2922 logical_cnot_x_result_observable_1.png (view on web) https://github.com/user-attachments/assets/eabf5eb1-ace4-47d7-ab84-f39e4ac74413 logical_cnot_x_result_observable_2.png (view on web) https://github.com/user-attachments/assets/66925a19-c92c-4858-b890-6d051599ad3a logical_cnot_z_result_observable_0.png (view on web) https://github.com/user-attachments/assets/02228a3f-8a54-4f34-b209-79a5f709725c logical_cnot_z_result_observable_1.png (view on web) https://github.com/user-attachments/assets/87fab036-2d61-48d9-ae6d-c621309f540f logical_cnot_z_result_observable_2.png (view on web) https://github.com/user-attachments/assets/56c118ce-0594-4a26-b24b-65a7e4c88fd5

— Reply to this email directly, view it on GitHub https://github.com/QCHackers/tqec/issues/336#issuecomment-2401072636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAXTCZ7CE6MVUVLEJKGODZ2R6NLAVCNFSM6AAAAABPPQ3HCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBRGA3TENRTGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>