def __init__(self, *params, wires=None, do_queue=True):
    self._name = self.__class__.__name__
    self.queue_idx = None
    if (wires is None):
        raise ValueError('Must specify the wires that {} acts on'.format(self.name))
    if isinstance(wires, Wires):
        self._wires = wires
    else:
        self._wires = Wires(wires)
    if ((self.num_wires != AllWires) and (self.num_wires != AnyWires) and (len(self._wires) != self.num_wires)):
        raise ValueError('{}: wrong number of wires. {} wires given, {} expected.'.format(self.name, len(self._wires), self.num_wires))
    if (len(params) != self.num_params):
        raise ValueError('{}: wrong number of parameters. {} parameters passed, {} expected.'.format(self.name, len(params), self.num_params))
    if self.do_check_domain:
        for p in params:
            self.check_domain(p)
    self.data = list(params)
    if do_queue:
        self.queue()
def __init__(self, *params, wires=None, do_queue=True):
    self._name = self.__class__.__name__
    self.queue_idx = None
    if (wires is None):
        raise ValueError('Must specify the wires that {} acts on'.format(self.name))
    if isinstance(wires, Wires):
        self._wires = wires
    else:
        self._wires = Wires(wires)
    if ((self.num_wires != AllWires) and (self.num_wires != AnyWires) and (len(self._wires) != self.num_wires)):
        raise ValueError('{}: wrong number of wires. {} wires given, {} expected.'.format(self.name, len(self._wires), self.num_wires))
    if (len(params) != self.num_params):
        raise ValueError('{}: wrong number of parameters. {} parameters passed, {} expected.'.format(self.name, len(params), self.num_params))
    if self.do_check_domain:
        for p in params:
            self.check_domain(p)
    self.data = list(params)
    if do_queue:
        self.queue()