qiskit.pulse.ScheduleBlock.filter¶
-
ScheduleBlock.
filter
(*filter_funcs, channels=None, instruction_types=None, time_ranges=None, intervals=None, check_subroutine=True)[source]¶ Return a new
Schedule
with only the instructions from thisScheduleBlock
which pass though the provided filters; i.e. an instruction will be retained iff every function infilter_funcs
returnsTrue
, the instruction occurs on a channel type contained inchannels
, the instruction type is contained ininstruction_types
, and the period over which the instruction operates is fully contained in one specified intime_ranges
orintervals
.If no arguments are provided,
self
is returned.Note
This method is currently not supported. Support will be soon added please create an issue if you believe this must be prioritized.
- Parameters
filter_funcs (
List
[Callable
]) – A list of Callables which take a (int, Union[‘Schedule’, Instruction]) tuple and return a bool.channels (
Optional
[Iterable
[Channel
]]) – For example,[DriveChannel(0), AcquireChannel(0)]
.instruction_types (
Union
[Iterable
[ABCMeta
],ABCMeta
,None
]) – For example,[PulseInstruction, AcquireInstruction]
.time_ranges (
Optional
[Iterable
[Tuple
[int
,int
]]]) – For example,[(0, 5), (6, 10)]
.intervals (
Optional
[Iterable
[Tuple
[int
,int
]]]) – For example,[(0, 5), (6, 10)]
.check_subroutine (
bool
) – Set True to individually filter instructions inside of a subroutine defined by theCall
instruction.
- Returns
Schedule
consisting of instructions that matches with filtering condition.- Raises
PulseError – When this method is called. This method will be supported soon.