Pulses
BaseReadoutPulse
Bases: Pulse
, ABC
QuAM abstract base component for a general readout pulse.
Readout pulse classes should usually inherit from ReadoutPulse
, the
exception being when a custom integration weights function is required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The length of the pulse in samples. |
required |
digital_marker
|
(str, list)
|
The digital marker to use for the pulse. Default is "ON". |
required |
Source code in quam/components/pulses.py
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
|
apply_to_config(config)
Adds this readout pulse to the QUA configuration.
See QuamComponent.apply_to_config
for details.
Source code in quam/components/pulses.py
432 433 434 435 436 437 438 439 |
|
integration_weights_function()
abstractmethod
Abstract method to calculate the integration weights.
Returns:
Type | Description |
---|---|
Dict[str, List[Tuple[float, int]]]
|
Dict containing keys "real", "imag", "minus_real", "minus_imag". |
Dict[str, List[Tuple[float, int]]]
|
Values are lists of tuples of (weight, length) pairs. |
Source code in quam/components/pulses.py
402 403 404 405 406 407 408 409 410 |
|
DragCosinePulse
Bases: Pulse
Cosine based DRAG pulse that compensate for the leakage and AC stark shift.
These DRAG waveforms has been implemented following the next Refs.: Chen et al. PRL, 116, 020501 (2016) https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.116.020501 and Chen's thesis https://web.physics.ucsb.edu/~martinisgroup/theses/Chen2018.pdf
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The pulse length in ns. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
amplitude
|
float
|
The amplitude in volts. |
required |
alpha
|
float
|
The DRAG coefficient. |
required |
anharmonicity
|
float
|
f_21 - f_10 - The differences in energy between the 2-1 and the 1-0 energy levels, in Hz. |
required |
detuning
|
float
|
The frequency shift to correct for AC stark shift, in Hz. |
required |
Source code in quam/components/pulses.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
|
DragGaussianPulse
Bases: Pulse
Gaussian-based DRAG pulse that compensate for the leakage and AC stark shift.
These DRAG waveforms has been implemented following the next Refs.: Chen et al. PRL, 116, 020501 (2016) https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.116.020501 and Chen's thesis https://web.physics.ucsb.edu/~martinisgroup/theses/Chen2018.pdf
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The pulse length in ns. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
amplitude
|
float
|
The amplitude in volts. |
required |
sigma
|
float
|
The gaussian standard deviation. |
required |
alpha
|
float
|
The DRAG coefficient. |
required |
anharmonicity
|
float
|
f_21 - f_10 - The differences in energy between the 2-1 and the 1-0 energy levels, in Hz. |
required |
detuning
|
float
|
The frequency shift to correct for AC stark shift, in Hz. |
required |
subtracted
|
bool
|
If true, returns a subtracted Gaussian, such that the first and last points will be at 0 volts. This reduces high-frequency components due to the initial and final points offset. Default is true. |
required |
Source code in quam/components/pulses.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
|
FlatTopGaussianPulse
Bases: Pulse
Gaussian pulse with flat top QuAM component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The total length of the pulse in samples. |
required |
amplitude
|
float
|
The amplitude of the pulse in volts. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
flat_length
|
int
|
The length of the pulse's flat top in samples. The rise and fall lengths are calculated from the total length and the flat length. |
required |
Source code in quam/components/pulses.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 |
|
GaussianPulse
Bases: Pulse
Gaussian pulse QuAM component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amplitude
|
float
|
The amplitude of the pulse in volts. |
required |
length
|
int
|
The length of the pulse in samples. |
required |
sigma
|
float
|
The standard deviation of the gaussian pulse. Should generally be less than half the length of the pulse. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
subtracted
|
bool
|
If true, returns a subtracted Gaussian, such that the first and last points will be at 0 volts. This reduces high-frequency components due to the initial and final points offset. Default is true. |
required |
Source code in quam/components/pulses.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 |
|
Pulse
Bases: QuamComponent
QuAM base component for a pulse.
Pulses are added to a channel using
channel.operations["pulse_name"] = pulse
The Pulse
class is an abstract base class, and should not be instantiated
directly. Instead, use one of the subclasses such as:
- ConstantReadoutPulse
- DragPulse
- SquarePulse
- GaussianPulse
or create a custom subclass. In this case, the method waveform_function
should
be implemented.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation
|
str
|
The operation of the pulse, either "control" or "measurement". Default is "control". |
required |
length
|
int
|
The length of the pulse in samples. |
required |
digital_marker
|
(str, list)
|
The digital marker to use for the pulse. Can be a string, in which case it is a reference to a digital marker in the config, or a list of tuples of (sample, length) pairs. Default is None. |
required |
Note
The unique pulse label is automatically generated from the channel name and
the pulse name, the same for the waveform and digital marker names.
The pulse label is defined as "{channel_name}.{pulse_name}.pulse"
.
The waveform label is defined as "{channel_name}.{pulse_name}.wf"
.
The digital marker label is defined as "{channel_name}.{pulse_name}.dm"
.
Source code in quam/components/pulses.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
channel
property
The channel to which the pulse is attached, None if no channel is attached
apply_to_config(config)
Adds this pulse, waveform, and digital marker to the QUA configuration.
See QuamComponent.apply_to_config
for details.
Source code in quam/components/pulses.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
calculate_waveform()
Calculate the waveform of the pulse.
This function calls Pulse.waveform_function
, which should generally be
subclassed, to generate the waveform.
This function then processes the results such that IQ waveforms are cast into complex values.
Returns:
Type | Description |
---|---|
Union[float, complex, List[float], List[complex]]
|
The processed waveform, which can be either |
Union[float, complex, List[float], List[complex]]
|
|
Union[float, complex, List[float], List[complex]]
|
|
Union[float, complex, List[float], List[complex]]
|
|
Union[float, complex, List[float], List[complex]]
|
|
Source code in quam/components/pulses.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
play(amplitude_scale=None, duration=None, condition=None, chirp=None, truncate=None, timestamp_stream=None, continue_chirp=False, target='', validate=True)
Play the pulse on the channel.
The corresponding channel to play the pulse on is determined from the parent of the pulse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pulse_name
|
str
|
The name of the pulse to play. Should be registered in
|
required |
amplitude_scale
|
(float, _PulseAmp)
|
Amplitude scale of the pulse. Can be either a float, or qua.amp(float). |
None
|
duration
|
int
|
Duration of the pulse in units of the clock cycle (4ns). If not provided, the default pulse duration will be used. It is possible to dynamically change the duration of both constant and arbitrary pulses. Arbitrary pulses can only be stretched, not compressed. |
None
|
chirp
|
Union[(list[int], str), (int, str)]
|
Allows to perform piecewise linear sweep of the element's intermediate frequency in time. Input should be a tuple, with the 1st element being a list of rates and the second should be a string with the units. The units can be either: 'Hz/nsec', 'mHz/nsec', 'uHz/nsec', 'pHz/nsec' or 'GHz/sec', 'MHz/sec', 'KHz/sec', 'Hz/sec', 'mHz/sec'. |
None
|
truncate
|
Union[int, QUA variable of type int]
|
Allows playing only part of the pulse, truncating the end. If provided, will play only up to the given time in units of the clock cycle (4ns). |
None
|
condition
|
A logical expression to evaluate.
|
Will play analog pulse only if the condition's value is true. Any digital pulses associated with the operation will always play. |
None
|
timestamp_stream
|
Union[str, _ResultSource]
|
(Supported from
QOP 2.2) Adding a |
None
|
validate
|
bool
|
If True (default), validate that the pulse is registered in Channel.operations |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
If the pulse is not attached to a channel. |
KeyError
|
If the pulse is not registered in the channel's operations. |
Source code in quam/components/pulses.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
waveform_function()
Function that returns the waveform of the pulse.
The waveform function should use the relevant parameters from the pulse, which is passed as the only argument.
This function is called from Pulse.calculate_waveform
Returns:
Type | Description |
---|---|
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
The waveform of the pulse. Can be one of the following: |
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
|
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
|
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
|
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
|
Union[float, complex, List[float], List[complex], Tuple[float, float], Tuple[List[float], List[float]]]
|
|
Source code in quam/components/pulses.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
ReadoutPulse
Bases: BaseReadoutPulse
, ABC
QuAM abstract base component for most readout pulses.
This class is a subclass of ReadoutPulse
and should be used for most readout
pulses. It provides a default implementation of the integration_weights_function
method, which is suitable for most cases.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The length of the pulse in samples. |
required |
digital_marker
|
(str, list)
|
The digital marker to use for the pulse. Default is "ON". |
required |
integration_weights
|
(list[float], list[tuple[float, int]])
|
The integration weights, can be either - a list of floats (one per sample), the length must match the pulse length - a list of tuples of (weight, length) pairs, the sum of the lengths must match the pulse length |
required |
integration_weights_angle
|
float
|
The rotation angle for the integration weights in radians. |
required |
Source code in quam/components/pulses.py
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
|
SquarePulse
Bases: Pulse
Square pulse QuAM component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The length of the pulse in samples. |
required |
digital_marker
|
(str, list)
|
The digital marker to use for the pulse. |
required |
amplitude
|
float
|
The amplitude of the pulse in volts. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
Source code in quam/components/pulses.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 |
|
SquareReadoutPulse
Bases: ReadoutPulse
, SquarePulse
QuAM component for a square readout pulse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length
|
int
|
The length of the pulse in samples. |
required |
digital_marker
|
(str, list)
|
The digital marker to use for the pulse. Default is "ON". |
required |
amplitude
|
float
|
The constant amplitude of the pulse. |
required |
axis_angle
|
float
|
IQ axis angle of the output pulse in radians. If None (default), the pulse is meant for a single channel or the I port of an IQ channel If not None, the pulse is meant for an IQ channel (0 is X, pi/2 is Y). |
required |
integration_weights
|
(list[float], list[tuple[float, int]])
|
The integration weights, can be either - a list of floats (one per sample), the length must match the pulse length - a list of tuples of (weight, length) pairs, the sum of the lengths must match the pulse length |
required |
integration_weights_angle
|
float
|
The rotation angle for the integration weights in radians. |
required |
Source code in quam/components/pulses.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 |
|
WaveformPulse
Bases: Pulse
Pulse that uses a pre-defined waveform, as opposed to a function.
For a single channel, only waveform_I
is required.
For an IQ channel, both waveform_I
and waveform_Q
are required.
The length of the pulse is derived from the length of waveform_I
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
waveform_I
|
list[float]
|
The in-phase waveform. |
required |
waveform_Q
|
list[float]
|
The quadrature waveform. |
required |
Source code in quam/components/pulses.py
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
|