Result Object Reference¶
-
class
_ResultStream
¶ -
average
() → qm.qua._dsl._ResultStream¶ Perform a running average on a stream item. The Output of this operation is the running average of the values in the stream starting from the beginning of the QUA program.
-
boolean_to_int
() → qm.qua._dsl._ResultStream¶ converts boolean to integer number - 1 for true and 0 for false
-
buffer
(*args) → qm.qua._dsl._ResultStream¶ Gather items into vectors - creates an array of input stream items and outputs the array as one item. only outputs full buffers.
- Parameters
length – number of items to gather
skip – number of items to skip for each buffer. starts with the first item of each buffer.
-
buffer_and_skip
(length, skip) → qm.qua._dsl._ResultStream¶ Gather items into vectors - creates an array of input stream items and outputs the array as one item. only outputs full buffers.
- Parameters
length – number of items to gather
skip – number of items to skip for each buffer. starts with the first item of each buffer.
-
convolution
(constant_vector, mode=None) → qm.qua._dsl._ResultStream¶ Computes discrete, linear convolution of one-dimensional constant vector and one-dimensional vector item of the input stream.
- Parameters
constant_vector – vector of numbers
mode – “full”, “same” or “valid”
-
dot_product
(vector) → qm.qua._dsl._ResultStream¶ Computes dot product of the given vector and each item of the input stream
- Parameters
vector – constant vector of numbers
-
fft
() → qm.qua._dsl._ResultStream¶ Computes one-dimensional discrete fourier transform for every item in the stream. item can be a vector of numbers, in this case fft will assume all imaginary numbers are 0. item can also be a vector of number pairs - in this case for each pair- the first will be real and second imaginary
-
flatten
() → qm.qua._dsl._ResultStream¶ deconstruct an array item - and send its elements one by one as items
-
histogram
(bins) → qm.qua._dsl._ResultStream¶ Compute the histogram of all items in stream
- Parameters
bins – vector or pairs. each pair indicates the edge of each bin. example: [[1,10],[11,20]] - two bins, one between 1 and 10, second between 11 and 20
-
map
(function) → qm.qua._dsl._ResultStream¶ transform the item by applying a function to it
- Parameters
function – function to transform each item to a different item. predefined functions are defined in “FUNCTIONS” object. for example, to compute fft on each item you should write “stream.map(FUNCTIONS.fft())”
-
multiply_by
(scalar_or_vector) → qm.qua._dsl._ResultStream¶ Multiply the input stream item by a constant scalar or vector . the input item can be either scalar or vector.
- Parameters
scalar_or_vector – either a scalar number, or a vector of scalars.
-
save
(tag)¶ Save only the last item received in stream This will add to
JobResults
aMultipleNamedJobResult
object.- Parameters
tag – result name
-
save_all
(tag)¶ Save all items received in stream. This will add to
JobResults
aSingleNamedJobResult
object.- Parameters
tag – result name
-
skip
(length) → qm.qua._dsl._ResultStream¶ suppress the first n items of the stream
- Parameters
length – number of items to skip
-
skip_last
(length) → qm.qua._dsl._ResultStream¶ suppress the last n items of the stream
- Parameters
length – number of items to skip
-
take
(length) → qm.qua._dsl._ResultStream¶ outputs only the first n items of the stream
- Parameters
length – number of items to take
-
tuple_convolution
(mode=None) → qm.qua._dsl._ResultStream¶ Computes discrete, linear convolution of two one-dimensional vectors that received as the one item from the input stream
- Parameters
mode – “full”, “same” or “valid”
-
tuple_dot_product
() → qm.qua._dsl._ResultStream¶ Computes dot product of the given item of the input stream - that should include two vectors
-
tuple_multiply
() → qm.qua._dsl._ResultStream¶ Computes multiplication of the given item of the input stream - that can be any combination of scalar and vectors
-
zip
(other) → qm.qua._dsl._ResultStream¶ Combine the emissions of two streams to one item that is a tuple of items of input streams
- Parameters
other – second stream to combine with self
-
-
class
_ResultSource
(_ResultStream)¶ A python object representing a source of values that can be processing in a
stream_processing()
pipelineThis interface is chainable, which means that calling most methods on this object will create a new streaming
See the base class
_ResultStream
for operations-
input1
() → qm.qua._dsl._ResultSource¶ A stream of raw ADC data from input 1. Only relevant when saving data from measure statement.
-
input2
() → qm.qua._dsl._ResultSource¶ A stream of raw ADC data from input 2. Only relevant when saving data from measure statement.
-
timestamps
() → qm.qua._dsl._ResultStream¶ Get a stream with only the timestamps of the stream-items
-
with_timestamps
() → qm.qua._dsl._ResultStream¶ Get a stream with the relevant timestamp for each stream-item
-