About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
qiskit.pulse.builder.build
build(backend=None, schedule=None, name=None, default_alignment='left', default_transpiler_settings=None, default_circuit_scheduler_settings=None)
Create a context manager for launching the imperative pulse builder DSL.
To enter a building context and starting building a pulse program:
from qiskit import execute, pulse
from qiskit.providers.fake_provider import FakeOpenPulse2Q
backend = FakeOpenPulse2Q()
d0 = pulse.DriveChannel(0)
with pulse.build() as pulse_prog:
pulse.play(pulse.Constant(100, 0.5), d0)
While the output program pulse_prog
cannot be executed as we are using a mock backend. If a real backend is being used, executing the program is done with:
qiskit.execute(pulse_prog, backend)
Parameters
- backend (Backend) – A Qiskit backend. If not supplied certain builder functionality will be unavailable.
- schedule (
Optional
[ScheduleBlock
]) – A pulseScheduleBlock
in which your pulse program will be built. - name (
Optional
[str
]) – Name of pulse program to be built. - default_alignment (
Union
[str
,AlignmentKind
,None
]) – Default scheduling alignment for builder. One ofleft
,right
,sequential
or an alignment context. - default_transpiler_settings (
Optional
[Dict
[str
,Any
]]) – Default settings for the transpiler. - default_circuit_scheduler_settings (
Optional
[Dict
[str
,Any
]]) – Default settings for the circuit to pulse scheduler.
Return type
AbstractContextManager
[ScheduleBlock
]
Returns
A new builder context which has the active builder initialized.
Was this page helpful?
Report a bug or request content on GitHub.