sigpy_pulse_opts.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. class SigpyPulseOpts:
  2. def __init__(
  3. self,
  4. pulse_type: str = "slr",
  5. ptype: str = "st",
  6. ftype: str = "ls",
  7. d1: float = 0.01,
  8. d2: float = 0.01,
  9. cancel_alpha_phs: bool = False,
  10. n_bands: int = 3,
  11. band_sep: int = 20,
  12. phs_0_pt: str = "None",
  13. ):
  14. self.pulse_type = pulse_type
  15. if pulse_type == "slr":
  16. self.ptype = ptype
  17. self.ftype = ftype
  18. self.d1 = d1
  19. self.d2 = d2
  20. self.cancel_alpha_phs = cancel_alpha_phs
  21. if pulse_type == "sms":
  22. self.ptype = ptype
  23. self.ftype = ftype
  24. self.d1 = d1
  25. self.d2 = d2
  26. self.cancel_alpha_phs = cancel_alpha_phs
  27. self.n_bands = n_bands
  28. self.band_sep = band_sep
  29. self.phs_0_pt = phs_0_pt
  30. def __str__(self) -> str:
  31. s = "Pulse options:"
  32. s += "\nptype: " + str(self.ptype)
  33. s += "\nftype: " + str(self.ftype)
  34. s += "\nd1: " + str(self.d1)
  35. s += "\nd2: " + str(self.d2)
  36. s += "\ncancel_alpha_phs: " + str(self.cancel_alpha_phs)
  37. return s