braket.ahs.field module

class braket.ahs.field.Field(time_series: TimeSeries, pattern: Pattern | None = None)[source]

Bases: object

A space and time dependent parameter of a program.

Parameters:
  • time_series (TimeSeries) – The time series representing this field.

  • pattern (Optional[Pattern]) – The local pattern of real numbers.

property time_series: TimeSeries

The time series representing this field.

Type:

TimeSeries

property pattern: Pattern | None

The local pattern of real numbers.

Type:

Optional[Pattern]

discretize(time_resolution: Decimal | None = None, value_resolution: Decimal | None = None, pattern_resolution: Decimal | None = None) Field[source]

Creates a discretized version of the field, where time, value and pattern are rounded to the closest multiple of their corresponding resolutions.

Parameters:
  • time_resolution (Optional[Decimal]) – Time resolution

  • value_resolution (Optional[Decimal]) – Value resolution

  • pattern_resolution (Optional[Decimal]) – Pattern resolution

Returns:

Field – A new discretized field.

static from_lists(times: list[Decimal], values: list[Decimal], pattern: list[Decimal]) Field[source]

Builds Field from lists of time points, values and pattern.

Parameters:
  • times (list[Decimal]) – The time points of the field

  • values (list[Decimal]) – The values of the field

  • pattern (list[Decimal]) – The pattern of the field

Raises:

ValueError – If the length of times and values differs.

Returns:

Field – Field.