def build_layers(self):
wire_names = self.wire_names(with_initial_value=True)<EOL>if not wire_names:<EOL><INDENT>return []<EOL><DEDENT>layers = [InputWire.fillup_layer(wire_names)]<EOL>for instruction_layer in self.instructions:<EOL><INDENT>layer = Layer(self.qregs, self.cregs)<EOL>for instruction in instruction_layer:<EOL><INDENT>layer, current_connections, connection_label =self._instruction_to_gate(instruction, layer)<EOL>layer.connections.append((connection_label, current_connections))<EOL>layer.connect_with("<STR_LIT>")<EOL><DEDENT>layers.append(layer.full_layer)<EOL><DEDENT>return layers<EOL>
Constructs layers.
Returns:
    list: List of DrawElements.
Raises:
    VisualizationError: When the drawing is, for some reason, impossible to be drawn.