bbndb.qgl module

Channels is where we store information for mapping virtual (qubit) channel to real channels.

Created on Jan 19, 2012 in the QGL package

Original Author: Colm Ryan Modified By: Graham Rowlands (moved to bbndb using sqlalchemy)

Copyright 2013 Raytheon BBN Technologies

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class bbndb.qgl.Attenuator(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

address
ch(name)[source]
channel_db_id
channels
get_chan(name)[source]
id
label
model
standalone
class bbndb.qgl.AttenuatorChannel(**kwargs)[source]

Bases: bbndb.qgl.PhysicalChannel, bbndb.qgl.ChannelMixin

Physical Channel on an Attenutator

DCsource
DCsource_id
attenuation
attenuator
attenuator_id
channel
channel_db_id
delay
generator
generator_id
id
instrument
label
log_chan
receiver
receiver_id
sampling_rate
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
type
class bbndb.qgl.Channel(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Every channel has a label and some printers.

channel_db_id
id
label
type
class bbndb.qgl.ChannelDatabase(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

DCSources
all_instruments()[source]
attenuators
channels
generators
id
instruments
label
notes
processors
receivers
spectrum_analyzers
time
transceivers
transmitters
class bbndb.qgl.ChannelMixin[source]

Bases: object

id = Column(None, Integer(), ForeignKey('channel.id'), table=None, primary_key=True, nullable=False)
class bbndb.qgl.DCSource(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

address
channel_db_id
id
label
level
mode
model
output
phys_chans
pump_source
standalone
class bbndb.qgl.DatabaseItem[source]

Bases: object

channel_db_id = Column(None, Integer(), ForeignKey('channeldatabase.id'), table=None)
id = Column(None, Integer(), table=None, primary_key=True, nullable=False)
label = Column(None, String(), table=None, nullable=False)
standalone = Column(None, Boolean(), table=None, nullable=False, default=ColumnDefault(False))
class bbndb.qgl.DigitalInput(**kwargs)[source]

Bases: bbndb.qgl.PhysicalChannel, bbndb.qgl.ChannelMixin

A digital input channel on a Processor.

DCsource
DCsource_id
channel
channel_db_id
delay
generator
generator_id
id
instrument
label
log_chan
meas_chan_id
processor
processor_id
receiver
receiver_id
sampling_rate
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
type
class bbndb.qgl.Edge(**kwargs)[source]

Bases: bbndb.qgl.LogicalChannel, bbndb.qgl.ChannelMixin

Defines an arc/directed edge between qubit vertices. If a device supports bi-directional connectivity, that is represented with two independent Edges.

An Edge is also effectively an abstract channel, so it carries the same properties as a Qubit channel.

channel_db_id
frequency
gate_chan
gate_chan_id
id
isforward(source, target)[source]

Test whether (source, target) matches the directionality of the edge.

label
phys_chan_id
pulse_params
source_id
target_id
type
class bbndb.qgl.Generator(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

DCsource_id
address
channel_db_id
frequency
id
label
model
phys_chans
power
reference
spectrumanalyzer_id
standalone
class bbndb.qgl.Instrument(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

address
channel_db_id
id
label
model
parameters
standalone
class bbndb.qgl.LogicalChannel(**kwargs)[source]

Bases: bbndb.qgl.ChannelMixin, bbndb.qgl.Channel

The main class from which we will generate sequences. At some point it needs to be assigned to a physical channel.

frequency: modulation frequency of the channel (can be positive or negative)
channel_db_id
frequency
gate_chan
gate_chan_id
id
label
phys_chan_id
pulse_params
type
class bbndb.qgl.LogicalMarkerChannel(**kwargs)[source]

Bases: bbndb.qgl.LogicalChannel, bbndb.qgl.ChannelMixin

A class for digital channels for gating sources or triggering other things.

channel_db_id
frequency
gate_chan
gate_chan_id
id
label
meas_chan_id
phys_chan_id
pulse_params
type
class bbndb.qgl.Measurement(**kwargs)[source]

Bases: bbndb.qgl.LogicalChannel, bbndb.qgl.ChannelMixin

A class for measurement channels. Measurements are special because they can be different types: autodyne which needs an IQ pair or hetero/homodyne which needs just a marker channel.

meas_type: Type of measurement (autodyne, homodyne) autodyne_freq: use to bake the modulation into the pulse, so that it has constant phase frequency: use to associate modulation with the channel
autodyne_freq
channel_db_id
control_chan_id
frequency
gate_chan
gate_chan_id
id
label
meas_type
phys_chan_id
processor_chan
pulse_params
receiver_chan
trig_chan
type
validate_frequency(key, value)[source]
validate_meas_type(key, source)[source]
class bbndb.qgl.MutableDict[source]

Bases: sqlalchemy.ext.mutable.Mutable, dict

classmethod coerce(key, value)[source]

Given a value, coerce it into the target type.

Can be overridden by custom subclasses to coerce incoming data into a particular type.

By default, raises ValueError.

This method is called in different scenarios depending on if the parent class is of type Mutable or of type MutableComposite. In the case of the former, it is called for both attribute-set operations as well as during ORM loading operations. For the latter, it is only called during attribute-set operations; the mechanics of the composite() construct handle coercion during load operations.

Parameters:
  • key – string name of the ORM-mapped attribute being set.
  • value – the incoming value.
Returns:

the method should return the coerced value, or raise ValueError if the coercion cannot be completed.

class bbndb.qgl.PhysicalChannel(**kwargs)[source]

Bases: bbndb.qgl.ChannelMixin, bbndb.qgl.Channel

The main class for actual Transmitter channels.

DCsource
DCsource_id
channel_db_id
delay
generator
generator_id
id
instrument
label
log_chan
q()[source]
receiver
receiver_id
sampling_rate
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
type
class bbndb.qgl.PhysicalMarkerChannel(**kwargs)[source]

Bases: bbndb.qgl.PhysicalChannel, bbndb.qgl.ChannelMixin

A digital output channel on an Transmitter.
gate_buffer: How much extra time should be added onto the beginning of a gating pulse gate_min_width: The minimum marker pulse width
DCsource
DCsource_id
channel
channel_db_id
delay
gate_buffer
gate_min_width
generator
generator_id
id
instrument
label
log_chan
receiver
receiver_id
sampling_rate
sequence_file
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
type
class bbndb.qgl.PhysicalQuadratureChannel(**kwargs)[source]

Bases: bbndb.qgl.PhysicalChannel, bbndb.qgl.ChannelMixin

Something used to implement a standard qubit channel with two analog channels and a microwave gating channel.

DCsource
DCsource_id
I_channel_amp_factor
I_channel_offset
Q_channel_amp_factor
Q_channel_offset
amp_factor
attenuation
channel
channel_db_id
delay
generator
generator_id
id
instrument
label
log_chan
phase_skew
receiver
receiver_id
sampling_rate
sequence_file
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
type
class bbndb.qgl.Processor(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

A hardware unit used for signal processing, e.g. a TDM model: currently TDM is the only supported model address: instrument address (string) master: true if trigger master (boolean) trigger_interval: (s) trigger_source: internal / external (string) channels: digital inputs (typically carrying the results of qubit state assignment). Used to map meas. results into memory (see QGL.PulsePrimitives.MEASA)

address
ch(name)[source]
channel_db_id
channels
get_chan(name)[source]
id
label
master
model
standalone
transceiver_id
trigger_interval
trigger_source
class bbndb.qgl.Qubit(**kwargs)[source]

Bases: bbndb.qgl.LogicalChannel, bbndb.qgl.ChannelMixin

The main class for generating qubit pulses. Effectively a logical “QuadratureChannel”.
frequency: modulation frequency of the channel (can be positive or negative)
channel_db_id
edge_source
edge_target
frequency
gate_chan
gate_chan_id
id
label
measure_chan
phys_chan_id
pulse_params
type
class bbndb.qgl.Receiver(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

A receiver , or generally an analog to digitial converter

acquire_mode
address
ch(name)[source]
channel_db_id
channels
get_chan(name)[source]
id
label
model
number_averages
number_segments
number_waveforms
record_length
reference
sampling_rate
standalone
stream_sel
stream_types
transceiver_id
trigger_source
validate_acquire_mode(key, source)[source]
validate_reference(key, source)[source]
validate_trigger_source(key, source)[source]
vertical_scale
class bbndb.qgl.ReceiverChannel(**kwargs)[source]

Bases: bbndb.qgl.PhysicalChannel, bbndb.qgl.ChannelMixin

ReceiverChannel denotes the physical receive channel on a transceiver. The actual stream type, and the dsp stream id, are handled by the pipeline.

DCsource
DCsource_id
channel
channel_db_id
delay
generator
generator_id
id
instrument
label
log_chan
pulse_check()[source]
receiver
receiver_id
sampling_rate
spectrumanalyzer
spectrumanalyzer_id
translator
transmitter
transmitter_id
triggering_chan_id
type
validate_stream_type(key, source)[source]
class bbndb.qgl.SpectrumAnalyzer(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

LO_source
address
channel_db_id
id
label
model
phys_chans
standalone
class bbndb.qgl.Transceiver(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

A single machine or rack of a2ds and d2as that we want to treat as a unit.

address
channel_db_id
get_thing(thing_type, name)[source]
id
initialize_separately
label
master
model
processors
px(name)[source]
receivers
rx(name)[source]
standalone
transmitters
tx(name)[source]
class bbndb.qgl.Transmitter(**kwargs)[source]

Bases: bbndb.qgl.DatabaseItem, sqlalchemy.ext.declarative.api.Base

An arbitrary waveform generator, or generally a digital to analog converter

address
ch(name)[source]
channel_db_id
channels
delay
get_chan(name)[source]
id
label
master
model
sequence_file
standalone
transceiver_id
trigger_interval
trigger_source
validate_trigger_source(key, source)[source]