{
  "record_type": "psiquantum.circuit",
  "title": "Gate Styles",
  "copyright": "Copyright © 2025 PsiQuantum Corp.  All rights reserved.",
  "operations": [
    {
      "id": "column",
      "type": "column",
      "input_registers": "*",
      "children": [
        {
          "id": "group",
          "type": "group",
          "input_registers": "a,b,c",
          "name": "basic gates",
          "children": [
            {
              "id": "a",
              "type": "register",
              "label": "\\text{basic gates}",
              "style": {
                "rail_state": "allocated"
              }
            },
            {
              "id": "b",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 3,
              "style": {
                "expanded": false,
                "rail_state": "allocated"
              }
            },
            {
              "id": "c",
              "type": "register",
              "label": "\\textcolor{gray}{(controls)}",
              "size": 2,
              "rail_names": "T,F",
              "style": {
                "rail_height": 20,
                "show_rail_labels": true,
                "expanded": true
              }
            },
            {
              "id": "gate2",
              "type": "gate",
              "gate_type": "write",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]",
              "parameters": {
                "register_value": "123",
                "bit_value": "1"
              }
            },
            {
              "id": "gate",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate4",
              "type": "gate",
              "gate_type": "cnot",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate19",
              "type": "gate",
              "gate_type": "swap",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate3",
              "type": "gate",
              "gate_type": "read",
              "input_registers": "a,b[0],b[1]"
            },
            {
              "id": "spacer3",
              "type": "separator",
              "input_registers": "a,b,c",
              "tags": [
                "spacer"
              ],
              "style": {
                "rail_state": "free",
                "width": 10
              }
            },
            {
              "id": "gate5",
              "type": "gate",
              "gate_type": "lelbow",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate51",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate6",
              "type": "gate",
              "gate_type": "relbow",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate74",
              "type": "gate",
              "gate_type": "lelbow",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate75",
              "type": "gate",
              "gate_type": "measurement",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]",
              "parameters": {
                "value": "",
                "basis": ""
              }
            },
            {
              "id": "spacer9",
              "type": "separator",
              "input_registers": "a,b,c",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 10,
                "rail_state": "free"
              }
            },
            {
              "id": "gate76",
              "type": "gate",
              "gate_type": "lelbow",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]"
            },
            {
              "id": "gate77",
              "type": "gate",
              "gate_type": "measurement",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]",
              "parameters": {
                "value": "20",
                "basis": "x"
              }
            },
            {
              "id": "gate101",
              "type": "gate",
              "gate_type": "measurement",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]",
              "parameters": {
                "value": "20",
                "basis": "y"
              }
            },
            {
              "id": "gate102",
              "type": "gate",
              "gate_type": "measurement",
              "input_registers": "a,b[0],b[1]",
              "controlled_by": "c[0],!c[1]",
              "parameters": {
                "value": "20",
                "basis": "z"
              }
            },
            {
              "id": "spacer10",
              "type": "separator",
              "input_registers": "a,b,c",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 10,
                "rail_state": "free"
              }
            }
          ]
        },
        {
          "id": "group2",
          "type": "group",
          "input_registers": "a2,b2,c2",
          "name": "letter gates",
          "children": [
            {
              "id": "a2",
              "type": "register",
              "label": "\\text{letter gates}",
              "style": {
                "margin": {
                  "t": "20"
                }
              }
            },
            {
              "id": "b2",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 3,
              "style": {
                "expanded": false
              }
            },
            {
              "id": "c2",
              "type": "register",
              "label": "\\textcolor{gray}{(controls)}",
              "size": 2,
              "rail_names": "T,F",
              "style": {
                "rail_height": 20,
                "show_rail_labels": true,
                "expanded": true
              }
            },
            {
              "id": "gate33",
              "type": "gate",
              "gate_type": "x",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate34",
              "type": "gate",
              "gate_type": "y",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate35",
              "type": "gate",
              "gate_type": "z",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "spacer4",
              "type": "separator",
              "input_registers": "a2,b2,c2",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 5
              }
            },
            {
              "id": "gate47",
              "type": "gate",
              "gate_type": "r",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate48",
              "type": "gate",
              "gate_type": "rx",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate49",
              "type": "gate",
              "gate_type": "ry",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate50",
              "type": "gate",
              "gate_type": "rz",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "spacer",
              "type": "separator",
              "input_registers": "a2,b2,c2",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 5
              }
            },
            {
              "id": "gate41",
              "type": "gate",
              "gate_type": "rootx",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate42",
              "type": "gate",
              "gate_type": "rootx_inv",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate43",
              "type": "gate",
              "gate_type": "rooty",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate44",
              "type": "gate",
              "gate_type": "rooty_inv",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate45",
              "type": "gate",
              "gate_type": "rootz",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            },
            {
              "id": "gate46",
              "type": "gate",
              "gate_type": "rootz_inv",
              "input_registers": "a2,b2[0],b2[1]",
              "controlled_by": "c2[0],!c2[1]"
            }
          ]
        },
        {
          "id": "group3",
          "type": "group",
          "input_registers": "a3,b3,c3",
          "name": "special gates",
          "children": [
            {
              "id": "a3",
              "type": "register",
              "label": "\\text{more gates}",
              "style": {
                "margin": {
                  "t": "20"
                }
              }
            },
            {
              "id": "b3",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 3,
              "style": {
                "expanded": false
              }
            },
            {
              "id": "c3",
              "type": "register",
              "label": "\\textcolor{gray}{(controls)}",
              "size": 2,
              "rail_names": "T,F",
              "style": {
                "show_rail_labels": true,
                "expanded": true
              }
            },
            {
              "id": "partial",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 2,
              "style": {
                "show_rail_labels": true,
                "expanded": false,
                "margin": {
                  "h": "5"
                },
                "rail_height": 35
              }
            },
            {
              "id": "gate59",
              "type": "gate",
              "gate_type": "phase",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "parameters": {
                "angle": "20"
              },
              "control_type": "control.phase"
            },
            {
              "id": "gate60",
              "type": "gate",
              "gate_type": "s",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s"
            },
            {
              "id": "gate61",
              "type": "gate",
              "gate_type": "s_inv",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s_inv"
            },
            {
              "id": "gate62",
              "type": "gate",
              "gate_type": "t",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.t"
            },
            {
              "id": "gate63",
              "type": "gate",
              "gate_type": "t_inv",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.t_inv"
            },
            {
              "id": "spacer8",
              "type": "separator",
              "input_registers": "a3,b3,c3",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 5
              }
            },
            {
              "id": "gate70",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": ""
              }
            },
            {
              "id": "gate106",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "0"
              },
              "tags": ["show_as_identity"]
            },
            {
              "id": "gate106a",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "0"
              }
            },
            {
              "id": "gate71",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "15"
              }
            },
            {
              "id": "gate103",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "22.5"
              }
            },
            {
              "id": "gate104",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "45"
              }
            },
            {
              "id": "gate72",
              "type": "gate",
              "gate_type": "ppr",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": "90"
              }
            },
            {
              "id": "gate73",
              "type": "gate",
              "gate_type": "ppm",
              "input_registers": "a3,b3[0],b3[1]",
              "controlled_by": "c3[0],!c3[1],partial[0],!partial[1]",
              "control_type": "control.s",
              "parameters": {
                "angle": ""
              }
            }
          ]
        },
        {
          "id": "group5",
          "type": "group",
          "input_registers": "a5,b5,c5",
          "name": "control types",
          "children": [
            {
              "id": "a5",
              "type": "register",
              "label": "\\text{control types}",
              "style": {
                "margin": {
                  "t": "20"
                },
                "rail_height": 99
              }
            },
            {
              "id": "c5",
              "type": "register",
              "label": "\\textcolor{gray}{(controls)}",
              "size": 2,
              "rail_names": "T,F",
              "style": {
                "show_rail_labels": true,
                "expanded": true
              }
            },
            {
              "id": "partial3",
              "type": "register",
              "size": 2,
              "label": "\\textcolor{gray}{(partial)}",
              "style": {
                "show_rail_labels": true,
                "expanded": false,
                "margin": {
                  "h": "5"
                },
                "rail_height": 22,
                "label_el": {
                  "visible": true
                }
              }
            },
            {
              "id": "routine5",
              "type": "routine",
              "name": "routine",
              "label": "\\small\\begin{gather}\ndot \\\\\ncontrol \\\\\ntype\n\\end{gather}",
              "input_registers": "a5",
              "controlled_by": "c5[0],!c5[1],partial3[0],!partial3[1]",
              "tags": [
                "vertical"
              ]
            },
            {
              "id": "routine6",
              "type": "routine",
              "name": "hexagon",
              "label": "\\small\\begin{gather}\nhexagon \\\\\ncontrol \\\\\ntype\n\\end{gather}",
              "input_registers": "a5,b5[0],b5[1]",
              "controlled_by": "c5[0],!c5[1],partial3[0],!partial3[1]",
              "tags": [
                "vertical"
              ],
              "control_type": "control.hexagon"
            },
            {
              "id": "routine7",
              "type": "routine",
              "name": "multiplex",
              "label": "\\small\\begin{gather}\nmultiplexor \\\\\ncontrol \\\\\ntype\n\\end{gather}",
              "input_registers": "a5,b5[0],b5[1]",
              "controlled_by": "c5[0],!c5[1],partial3[0],!partial3[1]",
              "tags": [
                "vertical"
              ],
              "control_type": "control.multiplexor"
            },
            {
              "id": "routine8",
              "type": "routine",
              "name": "partial",
              "label": "\\small\\begin{gather}\npartial \\\\\ncontrol \\\\\ntype\n\\end{gather}",
              "input_registers": "a5,b5[0],b5[1]",
              "controlled_by": "c5[0],!c5[1],partial3[0],!partial3[1]",
              "tags": [
                "vertical"
              ],
              "control_type": "control.partial"
            }
          ]
        },
        {
          "id": "group4",
          "type": "group",
          "input_registers": "a4,b4,c4",
          "name": "colors",
          "children": [
            {
              "id": "a4",
              "type": "register",
              "label": "\\text{colors!}",
              "style": {
                "rail_state": "allocated",
                "margin": {
                  "t": "20"
                }
              }
            },
            {
              "id": "b4",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 3,
              "style": {
                "expanded": false,
                "rail_state": "allocated"
              }
            },
            {
              "id": "c4",
              "type": "register",
              "label": "\\textcolor{gray}{(controls)}",
              "size": 2,
              "rail_names": "T,F",
              "style": {
                "rail_height": 20,
                "show_rail_labels": true,
                "expanded": true,
                "rail_state": "allocated"
              }
            },
            {
              "id": "partial2",
              "type": "register",
              "label": "\\textcolor{gray}{(partial)}",
              "size": 2,
              "style": {
                "rail_height": 20,
                "show_rail_labels": true,
                "expanded": false,
                "rail_state": "allocated"
              }
            },
            {
              "id": "gate78",
              "type": "gate",
              "gate_type": "write",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "red"
              ]
            },
            {
              "id": "gate79",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "red"
              ]
            },
            {
              "id": "gate80",
              "type": "gate",
              "gate_type": "cnot",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "red"
              ]
            },
            {
              "id": "gate81",
              "type": "gate",
              "gate_type": "swap",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "red"
              ]
            },
            {
              "id": "gate100",
              "type": "gate",
              "gate_type": "x",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "red"
              ],
              "control_type": "control.phase"
            },
            {
              "id": "gate90",
              "type": "gate",
              "gate_type": "measurement",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "parameters": {
                "value": "n",
                "basis": "z"
              },
              "tags": [
                "red"
              ]
            },
            {
              "id": "spacer11",
              "type": "separator",
              "input_registers": "a4,b4,c4",
              "tags": [
                "spacer"
              ],
              "style": {
                "width": 10,
                "rail_state": "GAP"
              }
            },
            {
              "id": "gate91",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "orange"
              ]
            },
            {
              "id": "gate92",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "yellow"
              ]
            },
            {
              "id": "gate93",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "lime"
              ]
            },
            {
              "id": "gate94",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "green"
              ]
            },
            {
              "id": "gate95",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "blue"
              ]
            },
            {
              "id": "gate96",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "purple"
              ]
            },
            {
              "id": "gate97",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "pink"
              ]
            },
            {
              "id": "gate98",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "tan"
              ]
            },
            {
              "id": "gate99",
              "type": "gate",
              "gate_type": "hadamard",
              "input_registers": "a4,b4[0],b4[1]",
              "controlled_by": "c4[0],!c4[1],partial2[0],!partial2[1]",
              "tags": [
                "gray"
              ]
            }
          ]
        }
      ],
      "style": {
        "align_children": "start"
      }
    }
  ]
}
