3.6.5. qupulse.pulses.interpolation

This module defines strategies for interpolation between points in a pulse table or similar.

Classes:
  • InterpolationStrategy: Interface for interpolation strategies.

  • LinearInterpolationStrategy: Interpolates linearly between two points.

  • HoldInterpolationStrategy: Interpolates by holding the first point’s value.

  • JumpInterpolationStrategy: Interpolates by holding the second point’s value.

class qupulse.pulses.interpolation.HoldInterpolationStrategy[source]

Bases: qupulse.pulses.interpolation.InterpolationStrategy

An InterpolationStrategy that interpolates by holding the value of the start point for the entire intermediate space.

constant_value(start, end)[source]

The value of the interpolation if it is constant.

Parameters
  • start (Tuple[float, float]) – The start point of the interpolation as (time, value) pair.

  • end (Tuple[float, float]) – The end point of the interpolation as (time, value) pair.

Return type

Optional[float]

Returns

The value of the interpolation if it is constant

property expression: qupulse.expressions.ExpressionScalar

Returns a symbolic expression of the interpolation strategy using (v0,t0) and (v1, t1) to represent start and end point and t as free variable. Note that the expression is only valid for values of t between t0 and t1.

Return type

ExpressionScalar

property integral: qupulse.expressions.ExpressionScalar

Returns the symbolic integral of this interpolation strategy using (v0,t0) and (v1,t1) to represent start and end point.

Return type

ExpressionScalar

class qupulse.pulses.interpolation.InterpolationStrategy[source]

Bases: object

Defines a strategy to interpolate values between two points.

constant_value(start, end)[source]

The value of the interpolation if it is constant.

Parameters
  • start (Tuple[float, float]) – The start point of the interpolation as (time, value) pair.

  • end (Tuple[float, float]) – The end point of the interpolation as (time, value) pair.

Return type

Optional[float]

Returns

The value of the interpolation if it is constant

abstract property expression: qupulse.expressions.ExpressionScalar

Returns a symbolic expression of the interpolation strategy using (v0,t0) and (v1, t1) to represent start and end point and t as free variable. Note that the expression is only valid for values of t between t0 and t1.

Return type

ExpressionScalar

abstract property integral: qupulse.expressions.ExpressionScalar

Returns the symbolic integral of this interpolation strategy using (v0,t0) and (v1,t1) to represent start and end point.

Return type

ExpressionScalar

class qupulse.pulses.interpolation.JumpInterpolationStrategy[source]

Bases: qupulse.pulses.interpolation.InterpolationStrategy

An InterpolationStrategy that interpolates by holding the value of the end point for the entire intermediate space.

constant_value(start, end)[source]

The value of the interpolation if it is constant.

Parameters
  • start (Tuple[float, float]) – The start point of the interpolation as (time, value) pair.

  • end (Tuple[float, float]) – The end point of the interpolation as (time, value) pair.

Return type

Optional[float]

Returns

The value of the interpolation if it is constant

property expression: qupulse.expressions.ExpressionScalar

Returns a symbolic expression of the interpolation strategy using (v0,t0) and (v1, t1) to represent start and end point and t as free variable. Note that the expression is only valid for values of t between t0 and t1.

Return type

ExpressionScalar

property integral: qupulse.expressions.ExpressionScalar

Returns the symbolic integral of this interpolation strategy using (v0,t0) and (v1,t1) to represent start and end point.

Return type

ExpressionScalar

class qupulse.pulses.interpolation.LinearInterpolationStrategy[source]

Bases: qupulse.pulses.interpolation.InterpolationStrategy

An InterpolationStrategy that interpolates linearly between two points.

constant_value(start, end)[source]

The value of the interpolation if it is constant.

Parameters
  • start (Tuple[float, float]) – The start point of the interpolation as (time, value) pair.

  • end (Tuple[float, float]) – The end point of the interpolation as (time, value) pair.

Return type

Optional[float]

Returns

The value of the interpolation if it is constant

property expression: qupulse.expressions.ExpressionScalar

Returns a symbolic expression of the interpolation strategy using (v0,t0) and (v1, t1) to represent start and end point and t as free variable. Note that the expression is only valid for values of t between t0 and t1.

Return type

ExpressionScalar

property integral: qupulse.expressions.ExpressionScalar

Returns the symbolic integral of this interpolation strategy using (v0,t0) and (v1,t1) to represent start and end point.

Return type

ExpressionScalar