Generator package¶
Submodules¶
Devices module¶
-
class
c3.generator.devices.
AWG
(**props)[source]¶ Bases:
c3.generator.devices.Device
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) → 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
-
create_IQ_drag
(instr: c3.signal.gates.Instruction, chan: str) → 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
-
create_IQ_pwc
(instr: c3.signal.gates.Instruction, chan: str) → 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
-
class
c3.generator.devices.
Device
(**props)[source]¶ Bases:
c3.c3objs.C3obj
A Device that is part of the stack generating the instruction signals.
- Parameters
resolution (np.float64) – Number of samples per second this device operates at.
-
calc_slice_num
(t_start: numpy.float64, t_end: numpy.float64)[source]¶ Effective number of time slices given start, end and resolution.
- Parameters
t_start (np.float64) – Starting time for this device.
t_end (np.float64) – End time for this device.
-
create_ts
(t_start: numpy.float64, t_end: numpy.float64, centered: bool = True)[source]¶ Compute time samples.
- Parameters
t_start (np.float64) – Starting time for this device.
t_end (np.float64) – 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:
c3.generator.devices.Device
Take the values at the awg resolution to the simulation resolution.
-
process
(instr, chan, awg_signal)[source]¶ Resample the awg values to higher resolution.
- Parameters
awg_signal (tf.Tensor) – Bandwith-limited, low-resolution AWG signal.
t_start (np.float64) – Beginning of the signal.
t_end (np.float64) – End of the signal.
- Returns
Inphase and Quadrature compontent of the upsampled signal.
- Return type
dict
-
-
class
c3.generator.devices.
Filter
(**props)[source]¶ Bases:
c3.generator.devices.Device
Apply a filter function to the signal.
-
class
c3.generator.devices.
FluxTuning
(**props)[source]¶ Bases:
c3.generator.devices.Device
Flux tunable qubit frequency.
- Parameters
-
class
c3.generator.devices.
LO
(**props)[source]¶ Bases:
c3.generator.devices.Device
Local oscillator device, generates a constant oscillating signal.
-
process
(instr: c3.signal.gates.Instruction, chan: str) → dict[source]¶ Generate a sinusodial signal.
- Parameters
channel (dict) – Drive channels.
t_start (float) – Beginning of the signal.
t_end (float) – End of the signal.
- Returns
Local oscillator signal and frequency.
- Return type
dict, tf.float64
-
-
class
c3.generator.devices.
Mixer
(**props)[source]¶ Bases:
c3.generator.devices.Device
Mixer device, combines inputs from the local oscillator and the AWG.
-
process
(instr: c3.signal.gates.Instruction, chan: str, in1: dict, in2: dict)[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
-
-
class
c3.generator.devices.
Readout
(**props)[source]¶ Bases:
c3.generator.devices.Device
Mimic the readout process by multiplying a state phase with a factor and offset.
-
class
c3.generator.devices.
Response
(rise_time=None, **props)[source]¶ Bases:
c3.generator.devices.Device
Make the AWG signal physical by convolution with a Gaussian to limit bandwith.
- Parameters
rise_time (Quantity) – Time constant for the gaussian convolution.
-
class
c3.generator.devices.
VoltsToHertz
(V_to_Hz=None, **props)[source]¶ Bases:
c3.generator.devices.Device
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.
Generator module¶
Signal generation stack.
Contrary to most quanutm simulators, C^3 includes a detailed simulation of the control stack. Each component in the stack and its functions are simulated individually and combined here.
Example: A local oscillator and arbitrary waveform generator signal are put through via a mixer device to produce an effective modulated signal.
-
class
c3.generator.generator.
Generator
(devices: dict = None, chain: list = None, resolution: numpy.float64 = 0.0)[source]¶ Bases:
object
Generator, creates signal from digital to what arrives to the chip.
- Parameters
devices (list) – Physical or abstract devices in the signal processing chain.
resolution (np.float64) – Resolution at which continuous functions are sampled.
-
generate_signals
(instr: c3.signal.gates.Instruction)[source]¶ Perform the signal chain for a specified instruction, including local oscillator, AWG generation and IQ mixing.
- Parameters
instr (Instruction) – Operation to be performed, e.g. logical gate.
- Returns
Signal to be applied to the physical device.
- Return type
dict