Moved readout scheme to phase table.

This commit is contained in:
jupfi 2024-07-11 21:26:28 +02:00
parent 9230e413d3
commit 9057b7245f
3 changed files with 27 additions and 5 deletions

View file

@ -15,6 +15,7 @@ class PhaseTable:
def __init__(self, quackseq): def __init__(self, quackseq):
"""Initializes the phase table.""" """Initializes the phase table."""
self.quackseq = quackseq self.quackseq = quackseq
self.readout_scheme = ReadoutScheme(self)
self.phase_array = self.generate_phase_array() self.phase_array = self.generate_phase_array()
def generate_phase_array(self): def generate_phase_array(self):
@ -182,6 +183,8 @@ class PhaseTable:
logger.info(phase_array) logger.info(phase_array)
self.readout_scheme.update_readout_scheme()
return phase_array return phase_array
def update_phase_array(self): def update_phase_array(self):
@ -206,3 +209,23 @@ class PhaseTable:
def n_parameters(self) -> int: def n_parameters(self) -> int:
"""The number of TX pulse parameters in the sequence.""" """The number of TX pulse parameters in the sequence."""
return self.phase_array.shape[1] return self.phase_array.shape[1]
class ReadoutScheme():
"""Readout Scheme for the phase table.
The rows are the phase cycles of the sequence.
The columns have two different types of options:
- The phase value of the phase cycle.
- The function that is applied to the phase cycle. Usually this is just +1, -1 or 0.
"""
def __init__(self, phase_table : PhaseTable) -> None:
"""Initializes the ReadoutOption."""
self.phase_table = phase_table
def update_readout_scheme(self):
"""Update the readout scheme of the sequence."""

View file

@ -15,7 +15,7 @@ from quackseq.options import (
FunctionOption, FunctionOption,
NumericOption, NumericOption,
Option, Option,
TableOption, ReadoutOption,
) )
from quackseq.functions import ( from quackseq.functions import (
RectFunction, RectFunction,
@ -179,8 +179,7 @@ class RXReadout(PulseParameter):
super().__init__(name) super().__init__(name)
self.add_option(BooleanOption(self.RX, False)) self.add_option(BooleanOption(self.RX, False))
# Readout Scheme for phase cycling - default is a positive sign with a 0 phase self.add_option(ReadoutOption(self.READOUT_SCHEME))
self.add_option(TableOption(self.READOUT_SCHEME, [[1, 0]]))
class Gate(PulseParameter): class Gate(PulseParameter):

View file

@ -378,7 +378,7 @@ class QuackSequence(PulseSequence):
# RX Specific functions # RX Specific functions
def set_rx(self, event : Event | str, rx: bool) -> None: def set_rx(self, event: Event | str, rx: bool) -> None:
"""Sets the receiver on or off. """Sets the receiver on or off.
Args: Args:
@ -390,7 +390,7 @@ class QuackSequence(PulseSequence):
event.parameters[self.RX_READOUT].get_option_by_name(RXReadout.RX).value = rx event.parameters[self.RX_READOUT].get_option_by_name(RXReadout.RX).value = rx
def set_rx_readout_scheme(self, event : Event | str, readout_scheme: list) -> None: def set_rx_readout_scheme(self, event: Event | str, readout_scheme: list) -> None:
"""Sets the readout scheme of the receiver. """Sets the readout scheme of the receiver.
Args: Args: