Skip to main content
IBM Quantum Platform
이 페이지는 Qiskit SDK 의 이전 버전에서 가져온 것으로, 최신 버전에는 존재하지 않습니다. 최신 버전으로 업데이트하시기를 권장합니다. 자세한 정보는 릴리스 정보를 참조하십시오.

AlignFunc

class qiskit.pulse.transforms.AlignFunc(duration, func)

GitHub

Bases: AlignmentKind

Allocate instructions at position specified by callback function.

The position is specified for each instruction of index j as a fractional coordinate in [0, 1] within the specified duration.

Instructions played on different channels are also arranged in a sequence. This alignment is convenient to create dynamical decoupling sequences such as UDD.

For example, UDD sequence with 10 pulses can be specified with following function.

def udd10_pos(j):
return np.sin(np.pi*j/(2*10 + 2))**2
Note

This context cannot be QPY serialized because of the callable. If you use this context, your program cannot be saved in QPY format.

Create new equispaced context.

Parameters

  • duration (int |ParameterExpression) – Duration of this context. This should be larger than the schedule duration. If the specified duration is shorter than the schedule duration, no alignment is performed and the input schedule is just returned. This duration can be parametrized.
  • func (Callable) – A function that takes an index of sub-schedule and returns the fractional coordinate of of that sub-schedule. The returned value should be defined within [0, 1]. The pulse index starts from 1.

Attributes

duration

Return context duration.

func

Return context alignment function.

is_sequential


Methods

align

align(schedule)

GitHub

Reallocate instructions according to the policy.

Only top-level sub-schedules are aligned. If sub-schedules are nested, nested schedules are not recursively aligned.

Parameters

schedule (Schedule) – Schedule to align.

Returns

Schedule with reallocated instructions.

Return type

Schedule

이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.