Composite Gates

Composite gates are gates that expand into a set of gates and therefore all composite gates can be constructed manually. However, particularly in the case of the CONJUGATE gate, composite gates are much easier to use.

  • CNOTChain: This composite gate creates a chain of CNOT gates linking the qubits in the target_qubits. For example, this CNOTChain gate...

    { 
        "gate_type": "CNOTChain",
        "target_qubits": [0, 2, 3]
    }
    

    ...would expand to:

    [
        { 
            "gate_type": "CNOT",
            "control_qubits": [0],
            "target_qubits": [2]
        },
        { 
            "gate_type": "CNOT",
            "control_qubits": [2],
            "target_qubits": [3]
        }
    ]
    
  • CONJUGATE: This gate will:

    1. Apply all the gates in the within_gates array in the gate object.
    2. Apply all the gates in the apply_gates array in the gate object.
    3. Apply the adjoint of all gates in the within_gates in the opposite order they were applied.

    For example, this CONJUGATE gate...

    { 
        "comment": "****** 110 => 1 ******",
        "gate_type": "CONJUGATE",
        "within_gates": [
            {   
                "gate_type": "X",
                "target_qubits": [2]
            }
        ],
        "apply_gates": [
            { 
                "gate_type": "X",
                "control_qubits": [0, 1, 2],
                "target_qubits": [3]
            }
        ]
    }
    

    ...would expand to:

    [
        {   
            "gate_type": "X",
            "target_qubits": [2]
        },
        { 
            "gate_type": "X",
            "control_qubits": [0, 1, 2],
            "target_qubits": [3]
        },
        {   
            "gate_type": "X",
            "target_qubits": [2],
            "adjoint": true
        }
    ]