Beispiel #1
0
class ScheduleIRJob(Message):
    """
    The unit of work to be executed.
    """

    num_shots: int
    """How many repetitions the job should be executed for."""

    resources: Resources
    """The resources required by the job."""

    program: Program
    """The actual program to be executed."""

    operating_point: Dict[str, Dict] = field(default_factory=dict)
    """Operating points or static instrument channel settings
          (mapping control_name (instrument name) -> instrument channel settings
          (instrument settings) dictionary)."""

    filter_pipeline: Dict[str, FilterNode] = field(default_factory=dict)
    """The filter pipeline. Mapping of node labels to
          FilterNode's."""

    job_id: InitVar[Optional[str]] = None
    """A unique ID to help the submitter track the job."""
    def _extend_by_deprecated_fields(self, d):
        super()._extend_by_deprecated_fields(d)

    def __post_init__(self, job_id):
        if job_id is not None:
            warn('job_id is deprecated; please don\'t set it anymore')
Beispiel #2
0
class Instrument(Message):
    """
    Instrument settings.
    """

    address: str
    """The full address of a QPU."""

    module: str
    """Full python import path for the module that includes
          the instrument driver."""

    instrument_type: str
    """Instrument type (driver class name)."""

    mnio_connections: Dict[str, MNIOConnection] = field(default_factory=dict)
    """MNIO network connections between Tsunami instruments"""

    channels: Dict[str, Any] = field(default_factory=dict)
    """Mapping of channel labels to channel settings"""

    virtual: bool = False
    """Whether the instrument is virtual."""

    setup: Dict[str, Any] = field(default_factory=dict)
    """Any additional information used by the instrument for
Beispiel #3
0
class Resources(Message):
    """
    The resources required by a job
    """

    qubits: List[str] = field(default_factory=list)
    """A list of qubits blocked/required by a job."""

    frames: Dict[str, Frame] = field(default_factory=dict)
    """RF/UHF frames by label."""

    frames_to_controls: Dict[str, str] = field(default_factory=dict)
    """Mapping of frames to control channels by labels."""
Beispiel #4
0
class BinaryExecutableResponse(Message):
    """
    Program to run on the QPU.
    """

    program: str
    """Execution settings and sequencer binaries."""

    memory_descriptors: Dict[str, ParameterSpec] = field(default_factory=dict)
    """Internal field for constructing patch tables."""

    ro_sources: List[Any] = field(default_factory=list)
    """Internal field for reshaping returned buffers."""
Beispiel #5
0
class RewriteArithmeticResponse(Message):
    """
    The data needed to run programs with gate arithmetic on the hardware.
    """

    quil: str
    """Native Quil rewritten with no arithmetic in gate parameters."""

    original_memory_descriptors: Dict[str, ParameterSpec] = field(default_factory=dict)
    """The declared memory descriptors in the Quil of the related request."""

    recalculation_table: Dict[ParameterAref, str] = field(default_factory=dict)
    """A mapping from memory references to the original gate arithmetic."""
Beispiel #6
0
class Capture(Instruction):
    """
    Specify an acquisition on an rx-frame as well as the
      filters to apply.
    """

    frame: str
    """The rx-frame label on which to trigger the acquisition."""

    duration: float
    """The duration of the acquisition in [seconds]"""

    filters: List[str] = field(default_factory=list)
    """An ordered list of labels of filter kernels to apply to
          the captured waveform."""

    send_to_host: bool = True
    """Transmit the readout bit back to Lodgepole.
          (Unnecessary for fully calibrated active reset captures)."""

    phase: float = 0.0e+0
    """Static phase angle [units of tau=2pi] by which the
          envelope quadratures are rotated."""

    detuning: float = 0.0e+0
    """Detuning [Hz] with which the pulse envelope should be
Beispiel #7
0
class FlatWaveform(TemplateWaveform):
    """
    Flat pulse.
    """

    iq: List[float] = field(default_factory=list)
    """Individual IQ point to hold constant"""
Beispiel #8
0
class NativeQuilMetadata(Message):
    """
    Metadata for a native quil program.
    """

    final_rewiring: List[int] = field(default_factory=list)
    """Output qubit index relabeling due to SWAP insertion."""

    gate_depth: Optional[int] = None
    """Maximum number of successive gates in the native quil program."""

    gate_volume: Optional[int] = None
    """Total number of gates in the native quil program."""

    multiqubit_gate_depth: Optional[int] = None
    """Maximum number of successive two-qubit gates in the native quil program."""

    program_duration: Optional[float] = None
    """Rough estimate of native quil program length in nanoseconds."""

    program_fidelity: Optional[float] = None
    """Rough estimate of the fidelity of the full native quil program, uses specs."""

    topological_swaps: Optional[int] = None
    """Total number of SWAPs in the native quil program."""
Beispiel #9
0
class Waveform(AbstractWaveform):
    """
    A waveform envelope defined by specific IQ values for a specific frame.
    """

    iqs: List[float] = field(default_factory=list)
    """The raw waveform envelope samples, alternating I and Q values."""
Beispiel #10
0
class QPU(Message):
    """
    Configuration info for the QPU
    """

    chip_label: str
    """The fabrication label for the QPU chip."""

    qubits: List[str] = field(default_factory=list)
    """A list of qubits labels."""

    controls: Dict[str, List] = field(default_factory=dict)
    """A mapping of control labels to tuples (instrument
          label, channel label)."""

    controls_by_qubit: Dict[str, List] = field(default_factory=dict)
    """A map of qubit label to list of controls that should be
Beispiel #11
0
class FilterKernel(AbstractKernel):
    """
    A filter kernel to produce scalar readout features from acquired readout waveforms.
    """

    iqs: List[float] = field(default_factory=list)
    """The raw kernel coefficients, alternating real and imaginary parts."""

    bias: float = 0.0e+0
    """The kernel is offset by this real value. Can be used to ensure the decision threshold lies at 0.0."""
Beispiel #12
0
class Program(Message):
    """
    The dynamic aspects (waveforms, readout kernels, scheduled
  instructions and parameters) of a job.
    """

    waveforms: Dict[str, AbstractWaveform] = field(default_factory=dict)
    """The waveforms appearing in the program by waveform
          label."""

    filters: Dict[str, AbstractKernel] = field(default_factory=dict)
    """The readout filter kernels appearing in the program by
          feature label."""

    scheduled_instructions: List[Dict] = field(default_factory=list)
    """The ordered sequence scheduled instruction objects."""

    parameters: Dict[str, ParameterSpec] = field(default_factory=dict)
    """A mapping of dynamic parameter names to their type
Beispiel #13
0
class DataAxis(Message):
    """
    A data axis allows to label element(s) of a stream.
    """

    name: str
    """Label for the axis, e.g., 'time' or 'shot_index'."""

    points: List[float] = field(default_factory=list)
    """The sequence of values along the axis."""
Beispiel #14
0
class ActiveReset(Message):
    """
    An active reset control sequence consisting of a repeated
      sequence of a measurement block and a feedback block conditional on the
      outcome of a specific measurement bit.  Regardless of the measurement
      outcomes the total duration of the control sequence is [attempts x
      (measurement_duration + feedback_duration)].  The total
      measurement_duration must be chosen to allow for enough time after any
      Capture commands for the measurement bit to propagate back to the gate
      cards that are actuating the feedback.
    """

    time: float
    """Time at which the ActiveReset begins in [seconds]."""

    measurement_duration: float
    """The duration of measurement block in [seconds]. The
          measurement bit is expected to have arrived on the QGS after
          this time relative to the overall start of the ActiveReset block."""

    feedback_duration: float
    """The duration of feedback block in [seconds]"""

    measurement_bit: int
    """The address of the readout bit to condition the
          feedback on.  The bit is first accessed after measurement_duration
          has elapsed."""

    attempts: int = 3
    """The number of times to repeat the active reset sequence."""

    measurement_instructions: List[Dict] = field(default_factory=list)
    """The ordered sequence of scheduled measurement
          instructions."""

    apply_feedback_when: bool = True
    """Apply the feedback when the measurement_bit equals the
          value of this flag."""

    feedback_instructions: List[Dict] = field(default_factory=list)
    """The ordered sequence of scheduled feedback instructions."""
Beispiel #15
0
class DeployedRack(Message):
    """
    The rack configuration for lodgepole.
    """

    rack_meta: RackMeta
    """Meta information about the deployed rack."""

    qpu: QPU
    """Information about the QPU."""

    instruments: Dict[str, Instrument] = field(default_factory=dict)
    """Mapping of instrument name to instrument settings."""
Beispiel #16
0
class RPCError(Message):
    """
    A error message for JSONRPC requests.
    """

    error: str
    """The error message."""

    id: str
    """The RPC request id."""

    jsonrpc: str = "2.0"
    """The JSONRPC version."""

    warnings: List[RPCWarning] = field(default_factory=list)
    """A list of warnings that occurred during request processing."""
Beispiel #17
0
class RPCReply(Message):
    """
    The reply for a JSONRPC request.
    """

    id: str
    """The RPC request id."""

    jsonrpc: str = "2.0"
    """The JSONRPC version."""

    result: Optional[Any] = None
    """The RPC result."""

    warnings: List[RPCWarning] = field(default_factory=list)
    """A list of warnings that occurred during request processing."""
Beispiel #18
0
class Capture(Instruction):
    """
    Specify an acquisition on an rx-frame as well as the 
      filters to apply.
    """

    frame: str
    """The rx-frame label on which to trigger the acquisition."""

    duration: float
    """The duration of the acquisition in [seconds]"""

    filters: List[str] = field(default_factory=list)
    """An ordered list of labels of filter kernels to apply to 
          the captured waveform."""

    send_to_host: bool = True
    """Transmit the readout bit back to Lodgepole. 
Beispiel #19
0
class FilterNode(Message):
    """
    A node in the filter pipeline.
    """

    module: str
    """Absolute python module import path in which the filter
          class is defined."""

    filter_type: str
    """The type (class name) of the filter."""

    source: str
    """Filter node label of the input to this node."""

    publish: bool
    """If True, return the output of this node with the job
          results (and publish a stream for it)."""

    params: Dict[str, float] = field(default_factory=dict)
    """Additional filter parameters."""
Beispiel #20
0
class Receiver(Message):
    """
    The receiver settings generated by the low-level
      translator.
    """

    instrument: str
    """The instrument name"""

    channel: str
    """The instrument channel (label)"""

    stream: str
    """Name of the associated (raw) output stream that
          should be published."""

    publish: bool
    """Whether to publish the raw output stream."""

    data_axes: List[DataAxis] = field(default_factory=list)
    """Ordered list of DataAxis objects that together