qiskit/transpiler/passmanager.py
def append(self, passes, ignore_requires=None, ignore_preserves=None, max_iteration=None,
               **flow_controller_conditions):
        """
        Args:
            passes (list[BasePass] or BasePass): pass(es) to be added to schedule
            ignore_preserves (bool): ignore the preserves claim of passes. Default: False
            ignore_requires (bool): ignore the requires need of passes. Default: False
            max_iteration (int): max number of iterations of passes. Default: 1000
            flow_controller_conditions (kwargs): See add_flow_controller(): Dictionary of
            control flow plugins. Default:

                * do_while (callable property_set -> boolean): The passes repeat until the
                  callable returns False.
                  Default: `lambda x: False # i.e. passes run once`

                * condition (callable property_set -> boolean): The passes run only if the
                  callable returns True.
                  Default: `lambda x: True # i.e. passes run`

        Raises:
            TranspilerError: if a pass in passes is not a proper pass.
        """

        passset_options = {'ignore_requires': ignore_requires,
                           'ignore_preserves': ignore_preserves,
                           'max_iteration': max_iteration}

        options = self._join_options(passset_options)

        if isinstance(passes, BasePass):
            passes = [passes]

        for pass_ in passes:
            if not isinstance(pass_, BasePass):
                raise TranspilerError('%s is not a pass instance' % pass_.__class__)

        for name, param in flow_controller_conditions.items():
            if callable(param):
                flow_controller_conditions[name] = partial(param, self.fenced_property_set)
            else:
                raise TranspilerError('The flow controller parameter %s is not callable' % name)

        self.working_list.append(
            FlowController.controller_factory(passes, options, **flow_controller_conditions))
def append(self, passes, ignore_requires=None, ignore_preserves=None, max_iteration=None,
               **flow_controller_conditions):
        """
        Args:
            passes (list[BasePass] or BasePass): pass(es) to be added to schedule
            ignore_preserves (bool): ignore the preserves claim of passes. Default: False
            ignore_requires (bool): ignore the requires need of passes. Default: False
            max_iteration (int): max number of iterations of passes. Default: 1000
            flow_controller_conditions (kwargs): See add_flow_controller(): Dictionary of
            control flow plugins. Default:

                * do_while (callable property_set -> boolean): The passes repeat until the
                  callable returns False.
                  Default: `lambda x: False # i.e. passes run once`

                * condition (callable property_set -> boolean): The passes run only if the
                  callable returns True.
                  Default: `lambda x: True # i.e. passes run`

        Raises:
            TranspilerError: if a pass in passes is not a proper pass.
        """

        passset_options = {'ignore_requires': ignore_requires,
                           'ignore_preserves': ignore_preserves,
                           'max_iteration': max_iteration}

        options = self._join_options(passset_options)

        if isinstance(passes, BasePass):
            passes = [passes]

        for pass_ in passes:
            if not isinstance(pass_, BasePass):
                raise TranspilerError('%s is not a pass instance' % pass_.__class__)

        for name, param in flow_controller_conditions.items():
            if callable(param):
                flow_controller_conditions[name] = partial(param, self.fenced_property_set)
            else:
                raise TranspilerError('The flow controller parameter %s is not callable' % name)

        self.working_list.append(
            FlowController.controller_factory(passes, options, **flow_controller_conditions))
Args:
            passes (list[BasePass] or BasePass): pass(es) to be added to schedule
            ignore_preserves (bool): ignore the preserves claim of passes. Default: False
            ignore_requires (bool): ignore the requires need of passes. Default: False
            max_iteration (int): max number of iterations of passes. Default: 1000
            flow_controller_conditions (kwargs): See add_flow_controller(): Dictionary of
            control flow plugins. Default:

                * do_while (callable property_set -> boolean): The passes repeat until the
                  callable returns False.
                  Default: `lambda x: False # i.e. passes run once`

                * condition (callable property_set -> boolean): The passes run only if the
                  callable returns True.
                  Default: `lambda x: True # i.e. passes run`

        Raises:
            TranspilerError: if a pass in passes is not a proper pass.