c3.generator.devices

Module Contents

c3.generator.devices.dev_reg_deco(func: Callable) Callable[source]

Decorator for making registry of functions

class c3.generator.devices.Device(**props)[source]

Bases: c3.c3objs.C3obj

Inheritance diagram of c3.generator.devices.Device

A Device that is part of the stack generating the instruction signals.

Parameters

resolution (float) – Number of samples per second this device operates at.

write_config(filepath: str) None[source]

Write dictionary to a HJSON file.

__str__() str[source]

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None[source]

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant[source]

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

abstract process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any][source]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

class c3.generator.devices.Readout(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Readout

Mimic the readout process by multiplying a state phase with a factor and offset.

Parameters
readout(phase)[source]

Apply the readout rescaling

Parameters

phase (tf.float64) – Raw phase of a quantum state

Returns

Rescaled readout value

Return type

tf.float64

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

abstract process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

class c3.generator.devices.VoltsToHertz(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.VoltsToHertz

Convert the voltage signal to an amplitude to plug into the model Hamiltonian.

Parameters
  • V_to_Hz (Quantity) – Conversion factor.

  • offset (tf.float64) – Drive frequency offset.

process(instr: c3.signal.gates.Instruction, chan: str, mixed_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Transform signal from value of V to Hz.

Parameters

mixed_signal (tf.Tensor) – Waveform as line voltages after IQ mixing

Returns

Waveform as control amplitudes

Return type

tf.Tensor

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.Crosstalk(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Crosstalk

Device to phenomenologically include crosstalk in the model by explicitly mixing drive lines.

crosstalk_matrix: tf.constant

Matrix description of how to mix drive channels.

Examples

xtalk = Crosstalk(
    name="crosstalk",
    channels=["TC1", "TC2"],
    crosstalk_matrix=Quantity(
        value=[[1, 0], [0, 1]],
        min_val=[[0, 0], [0, 0]],
        max_val=[[1, 1], [1, 1]],
        unit="",
    ),
)
process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any][source]

Mix channels in the input signal according to a crosstalk matrix.

Parameters

signal (Dict[str, Any]) –

Dictionary of several signals identified by their channel as dict keys, e.g.

signal = {
    "TC1": {"values": [0, 0.5, 1, 1, ...]},
    "TC2": {"values": [1, 1, 1, 1, ...],
}

Returns

signal

Return type

Dict[str, Any]

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.DigitalToAnalog(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.DigitalToAnalog

Take the values at the awg resolution to the simulation resolution.

process(instr: c3.signal.gates.Instruction, chan: str, awg_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Resample the awg values to higher resolution.

Parameters
  • instr (Instruction) – The logical instruction or qubit operation for which the signal is generated.

  • chan (str) – Specifies which channel is being processed if needed.

  • awg_signal (dict) – Dictionary of several signals identified by their channel as dict keys.

Returns

Inphase and Quadrature compontent of the upsampled signal.

Return type

dict

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.Filter(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Filter

Apply a filter function to the signal.

process(instr: c3.signal.gates.Instruction, chan: str, Hz_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Apply a filter function to the signal.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.CouplingTuning(two_inputs=False, **props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.CouplingTuning

Coupling dependent on frequency of coupled elements.

Parameters
  • two_inputs (bool) – True if both coupled elements are frequency tuned

  • w_1 (Quantity) – Bias frequency of first coupled element

  • w_2 (Quantity) – Bias frequency of second coupled element.

  • g0 (Quantity) – Coupling at bias frequencies.

process(instr: c3.signal.gates.Instruction, chan: str, signal_in: List[Dict[str, Any]]) Dict[str, Any][source]

Compute the qubit frequency resulting from an applied flux.

Parameters

signal (tf.float64) –

Returns

Qubit frequency.

Return type

tf.float64

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.FluxTuning(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.FluxTuning

Flux tunable qubit frequency.

Parameters
process(instr: c3.signal.gates.Instruction, chan: str, signal_in: List[Dict[str, Any]]) Dict[str, Any][source]

Compute the qubit frequency resulting from an applied flux.

Parameters

signal (tf.float64) –

Returns

Qubit frequency.

Return type

tf.float64

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.FluxTuningLinear(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.FluxTuningLinear

Flux tunable qubit frequency linear adjustment.

Parameters
frequency(signal: tensorflow.float64) tensorflow.constant[source]

Compute the qubit frequency resulting from an applied flux.

Parameters

signal (tf.float64) –

Returns

Qubit frequency.

Return type

tf.float64

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

abstract process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

class c3.generator.devices.Response(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Response

Make the AWG signal physical by convolution with a Gaussian to limit bandwith.

Parameters

rise_time (Quantity) – Time constant for the gaussian convolution.

process(instr, chan, iq_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Apply a Gaussian shaped limiting function to an IQ signal.

Parameters

iq_signal (dict) – I and Q components of an AWG signal.

Returns

Bandwidth limited IQ signal.

Return type

dict

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.ResponseFFT(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.ResponseFFT

Make the AWG signal physical by convolution with a Gaussian to limit bandwith.

Parameters

rise_time (Quantity) – Time constant for the gaussian convolution.

process(instr, chan, iq_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Apply a Gaussian shaped limiting function to an IQ signal.

Parameters

iq_signal (dict) – I and Q components of an AWG signal.

Returns

Bandwidth limited IQ signal.

Return type

dict

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.StepFuncFilter(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.StepFuncFilter

Base class for filters that are based on the step response function Step function has to be defined explicetly

process(instr, chan, signal_in: List[Dict[str, Any]]) Dict[str, Any][source]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.ExponentialIIR(**props)[source]

Bases: StepFuncFilter

Inheritance diagram of c3.generator.devices.ExponentialIIR

Implement IIR filter with step response of the form s(t) = (1 + A * exp(-t / t_iir) )

Parameters
process(instr, chan, signal_in: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.HighpassExponential(**props)[source]

Bases: StepFuncFilter

Inheritance diagram of c3.generator.devices.HighpassExponential

Implement Highpass filter based on exponential with step response of the form s(t) = exp(-t / t_hp)

Parameters
process(instr, chan, signal_in: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.SkinEffectResponse(**props)[source]

Bases: StepFuncFilter

Inheritance diagram of c3.generator.devices.SkinEffectResponse

Implement Highpass filter based on exponential with step response of the form s(t) = exp(-t / t_hp)

Parameters
process(instr, chan, signal_in: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.HighpassFilter(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.HighpassFilter

Introduce a highpass filter

Parameters
  • cutoff (Quantity) – cutoff frequency of highpass filter

  • keep_mean (bool) – should the mean of the signal be restored

convolve(signal: list, resp_shape: list)[source]

Compute the convolution with a function.

Parameters
  • signal (list) – Potentially unlimited signal samples.

  • resp_shape (list) – Samples of the function to model limited bandwidth.

Returns

Processed signal.

Return type

tf.Tensor

process(instr, chan, iq_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Apply a highpass cutoff to an IQ signal.

Parameters

iq_signal (dict) – I and Q components of an AWG signal.

Returns

Filtered IQ signal.

Return type

dict

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.Mixer(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Mixer

Mixer device, combines inputs from the local oscillator and the AWG.

process(instr: c3.signal.gates.Instruction, chan: str, inputs: List[Dict[str, Any]]) Dict[str, Any][source]

Combine signal from AWG and LO.

Parameters
  • lo_signal (dict) – Local oscillator signal.

  • awg_signal (dict) – Waveform generator signal.

Returns

Mixed signal.

Return type

dict

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.LONoise(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.LONoise

Noise applied to the local oscillator

proces(instr, chan, lo_signal: List[Dict[str, Any]]) Dict[str, Any][source]

Distort signal by adding noise.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

abstract process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

class c3.generator.devices.Additive_Noise(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.Additive_Noise

Noise applied to a signal

process(instr, chan, signal: List[Dict[str, Any]]) Dict[str, Any][source]

Distort signal by adding noise.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.DC_Noise(**props)[source]

Bases: Additive_Noise

Inheritance diagram of c3.generator.devices.DC_Noise

Add a random constant offset to the signals

process(instr, chan, signal: List[Dict[str, Any]]) Dict[str, Any]

Distort signal by adding noise.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.Pink_Noise(**props)[source]

Bases: Additive_Noise

Inheritance diagram of c3.generator.devices.Pink_Noise

Device creating pink noise, i.e. 1/f noise.

process(instr, chan, signal: List[Dict[str, Any]]) Dict[str, Any]

Distort signal by adding noise.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.DC_Offset(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.DC_Offset

Noise applied to a signal

process(instr, chan, signal: List[Dict[str, Any]]) Dict[str, Any][source]

Distort signal by adding noise.

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.LO(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.LO

Local oscillator device, generates a constant oscillating signal.

process(instr: c3.signal.gates.Instruction, chan: str, signal: List[Dict[str, Any]]) dict[source]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

class c3.generator.devices.AWG(**props)[source]

Bases: Device

Inheritance diagram of c3.generator.devices.AWG

AWG device, transforms digital input to analog signal.

Parameters

logdir (str) – Filepath to store generated waveforms.

create_IQ(instr: c3.signal.gates.Instruction, chan: str, inputs: List[Dict[str, Any]]) dict[source]

Construct the in-phase (I) and quadrature (Q) components of the signal. These are universal to either experiment or simulation. In the xperiment these will be routed to AWG and mixer electronics, while in the simulation they provide the shapes of the instruction fields to be added to the Hamiltonian.

Parameters
  • channel (str) – Identifier for the selected drive line.

  • components (dict) – Separate signals to be combined onto this drive line.

  • t_start (float) – Beginning of the signal.

  • t_end (float) – End of the signal.

Returns

Waveforms as I and Q components.

Return type

dict

get_average_amp(line)[source]

Compute average and sum of the amplitudes. Used to estimate effective drive power for non-trivial shapes.

Returns

Average and sum.

Return type

tuple

write_config(filepath: str) None

Write dictionary to a HJSON file.

__str__() str

Return str(self).

calc_slice_num(t_start: float = 0.0, t_end: float = 0.0) None

Effective number of time slices given start, end and resolution.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

create_ts(t_start: float = 0, t_end: float = 0, centered: bool = True) tensorflow.constant

Compute time samples.

Parameters
  • t_start (float) – Starting time for this device.

  • t_end (float) – End time for this device.

  • centered (boolean) – Sample in the middle of an interval, otherwise at the beginning.

abstract process(instr: c3.signal.gates.Instruction, chan: str, signals: List[Dict[str, Any]]) Dict[str, Any]

To be implemented by inheriting class.

Parameters
  • instr (Instruction) – Information about the instruction or gate to be excecuted.

  • chan (str) – Identifier of the drive line

  • signals (List[Dict[str, Any]]) – List of potentially multiple input signals to this device.

Returns

Output signal of this device.

Return type

Dict[str, Any]

Raises

NotImplementedError