Return the action of this circuit as a gate

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