qiskit-documentation/docs/api/qiskit/0.42/qiskit.pulse.builder.refere...

34 lines
1.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: reference
description: API reference for qiskit.pulse.builder.reference
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.pulse.builder.reference
---
# qiskit.pulse.builder.reference
<Function id="qiskit.pulse.builder.reference" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/pulse/builder.py" signature="reference(name, *extra_keys)">
Refer to undefined subroutine by string keys.
A [`Reference`](qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") instruction is implicitly created and a schedule can be separately registered to the reference at a later stage.
```python
from qiskit import pulse
with pulse.build() as main_prog:
pulse.reference("x_gate", "q0")
with pulse.build() as subroutine:
pulse.play(pulse.Gaussian(160, 0.1, 40), pulse.DriveChannel(0))
main_prog.assign_references(subroutine_dict={("x_gate", "q0"): subroutine})
```
**Parameters**
* **name** (`str`) Name of subroutine.
* **extra\_keys** (`str`) Helper keys to uniquely specify the subroutine.
</Function>