def _multiplex(self, target_gate, list_of_angles):
list_len = len(list_of_angles)<EOL>local_num_qubits = int(math.log2(list_len)) + <NUM_LIT:1><EOL>q = QuantumRegister(local_num_qubits)<EOL>circuit = QuantumCircuit(q, name="<STR_LIT>" + local_num_qubits.__str__())<EOL>lsb = q[<NUM_LIT:0>]<EOL>msb = q[local_num_qubits - <NUM_LIT:1>]<EOL>if local_num_qubits == <NUM_LIT:1>:<EOL><INDENT>circuit.append(target_gate(list_of_angles[<NUM_LIT:0>]), [q[<NUM_LIT:0>]])<EOL>return circuit<EOL><DEDENT>angle_weight = scipy.kron([[<NUM_LIT:0.5>, <NUM_LIT:0.5>], [<NUM_LIT:0.5>, -<NUM_LIT:0.5>]],<EOL>np.identity(<NUM_LIT:2> ** (local_num_qubits - <NUM_LIT:2>)))<EOL>list_of_angles = angle_weight.dot(np.array(list_of_angles)).tolist()<EOL>multiplex_1 = self._multiplex(target_gate, list_of_angles[<NUM_LIT:0>:(list_len // <NUM_LIT:2>)])<EOL>circuit.append(multiplex_1.to_instruction(), q[<NUM_LIT:0>:-<NUM_LIT:1>])<EOL>circuit.append(CnotGate(), [msb, lsb])<EOL>multiplex_2 = self._multiplex(target_gate, list_of_angles[(list_len // <NUM_LIT:2>):])<EOL>if list_len > <NUM_LIT:1>:<EOL><INDENT>circuit.append(multiplex_2.to_instruction().mirror(), q[<NUM_LIT:0>:-<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>circuit.append(multiplex_2.to_instruction(), q[<NUM_LIT:0>:-<NUM_LIT:1>])<EOL><DEDENT>circuit.append(CnotGate(), [msb, lsb])<EOL>return circuit<EOL>
Return a recursive implementation of a multiplexor circuit,
where each instruction itself has a decomposition based on
smaller multiplexors.

The LSB is the multiplexor "data" and the other bits are multiplexor "select".

Args:
    target_gate (Gate): Ry or Rz gate to apply to target qubit, multiplexed
        over all other "select" qubits
    list_of_angles (list[float]): list of rotation angles to apply Ry and Rz

Returns:
    DAGCircuit: the circuit implementing the multiplexor's action