mirror of
https://github.com/nqrduck/quackseq.git
synced 2024-11-21 13:32:25 +00:00
Moved readout scheme to phase table.
This commit is contained in:
parent
9230e413d3
commit
9057b7245f
3 changed files with 27 additions and 5 deletions
|
@ -15,6 +15,7 @@ class PhaseTable:
|
|||
def __init__(self, quackseq):
|
||||
"""Initializes the phase table."""
|
||||
self.quackseq = quackseq
|
||||
self.readout_scheme = ReadoutScheme(self)
|
||||
self.phase_array = self.generate_phase_array()
|
||||
|
||||
def generate_phase_array(self):
|
||||
|
@ -182,6 +183,8 @@ class PhaseTable:
|
|||
|
||||
logger.info(phase_array)
|
||||
|
||||
self.readout_scheme.update_readout_scheme()
|
||||
|
||||
return phase_array
|
||||
|
||||
def update_phase_array(self):
|
||||
|
@ -206,3 +209,23 @@ class PhaseTable:
|
|||
def n_parameters(self) -> int:
|
||||
"""The number of TX pulse parameters in the sequence."""
|
||||
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."""
|
||||
|
|
@ -15,7 +15,7 @@ from quackseq.options import (
|
|||
FunctionOption,
|
||||
NumericOption,
|
||||
Option,
|
||||
TableOption,
|
||||
ReadoutOption,
|
||||
)
|
||||
from quackseq.functions import (
|
||||
RectFunction,
|
||||
|
@ -179,8 +179,7 @@ class RXReadout(PulseParameter):
|
|||
super().__init__(name)
|
||||
self.add_option(BooleanOption(self.RX, False))
|
||||
|
||||
# Readout Scheme for phase cycling - default is a positive sign with a 0 phase
|
||||
self.add_option(TableOption(self.READOUT_SCHEME, [[1, 0]]))
|
||||
self.add_option(ReadoutOption(self.READOUT_SCHEME))
|
||||
|
||||
|
||||
class Gate(PulseParameter):
|
||||
|
|
|
@ -378,7 +378,7 @@ class QuackSequence(PulseSequence):
|
|||
|
||||
# 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.
|
||||
|
||||
Args:
|
||||
|
@ -390,7 +390,7 @@ class QuackSequence(PulseSequence):
|
|||
|
||||
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.
|
||||
|
||||
Args:
|
||||
|
|
Loading…
Reference in a new issue