Skip to content

Commit

Permalink
Move scale/phase/detuning properties into TemplateWaveform
Browse files Browse the repository at this point in the history
  • Loading branch information
notmgsk committed Oct 21, 2020
1 parent 91cffcf commit 500dd63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 54 deletions.
9 changes: 9 additions & 0 deletions pyquil/quilatom.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,15 @@ class TemplateWaveform(QuilAtom):
duration: float
""" The duration [seconds] of the waveform. """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def num_samples(self, rate: float) -> int:
"""The number of samples in the reference implementation of the waveform.
Expand Down
54 changes: 0 additions & 54 deletions pyquil/quiltwaveforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ class FlatWaveform(TemplateWaveform):
iq: Complex
""" A raw IQ value. """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "flat("
output += ", ".join(
Expand Down Expand Up @@ -128,15 +119,6 @@ class GaussianWaveform(TemplateWaveform):
t0: float
""" The center time coordinate of the Gaussian (seconds). """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "gaussian("
output += ", ".join(
Expand Down Expand Up @@ -172,15 +154,6 @@ class DragGaussianWaveform(TemplateWaveform):
alpha: float
""" Dimensionles DRAG parameter. """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "drag_gaussian("
output += ", ".join(
Expand Down Expand Up @@ -232,15 +205,6 @@ class HrmGaussianWaveform(TemplateWaveform):
second_order_hrm_coeff: float
""" Second order coefficient (see Warren 1984). """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "hrm_gaussian("
output += ", ".join(
Expand Down Expand Up @@ -289,15 +253,6 @@ class ErfSquareWaveform(TemplateWaveform):
pad_right: float
""" Amount of zero-padding to add to the right of the pulse (seconds). """

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "erf_square("
output += ", ".join(
Expand Down Expand Up @@ -331,15 +286,6 @@ def samples(self, rate: float) -> np.ndarray:
@waveform("boxcar_kernel")
class BoxcarAveragerKernel(TemplateWaveform):

scale: Optional[float] = None
""" An optional global scaling factor. """

phase: Optional[float] = None
""" An optional phase shift factor. """

detuning: Optional[float] = None
""" An optional frequency detuning factor. """

def out(self) -> str:
output = "boxcar_kernel("
output += ", ".join([f"duration: {self.duration}"] + _optional_field_strs(self))
Expand Down

0 comments on commit 500dd63

Please sign in to comment.