code: def asgate(self) -> Gate:
          
          gate = identity_gate(self.qubits)
          for elem in self.elements:
              gate = elem.asgate() @ gate
          return gate
docs: Return the action of this circuit as a gate