Signal package

Submodules

Gates module

class c3.signal.gates.GateSet[source]

Bases: object

Contains all operations and corresponding instructions.

add_instruction(instr)[source]

Add one instruction to the gateset.

Parameters

instr (Instruction) – Instruction specifies an operation on the device.

get_parameters(opt_map=None, scaled=False, to_str=False)[source]

Return list of parameter values in opt_map in physical units. If scaled is set, the internal value between [-1, 1] is returned.

Parameters

opt_map (list) –

List of parameters that will be optimized, specified with a tuple of gate name, control name, component name and parameter. Parameters that are copies of each other are collected in lists.

Example:
opt_map = [
[(‘X90p’,’line1’,’gauss1’,’sigma’),

(‘Y90p’,’line1’,’gauss1’,’sigma’)],

[(‘X90p’,’line1’,’gauss2’,’amp’)], [(‘Cnot’,’line1’,’flattop’,’amp’)], [(‘Cnot’,’line2’,’DC’,’amp’)]

]

Returns

opt_params – Dictionary with values, bounds lists.

Example:
opt_params = (

[0, 0, 0, 0], # Values )

Return type

dict

list_parameters()[source]

List all parameters in this gateset in a hierarchical way. Multiple grouped identifiers mean the same value is used in all places. Structure is

[gate name, drive channel, component, parameter]

e.g.

[“X90p”, “qubit 1 Drive”, “local oscillator”, “frequency”]

Returns

Parameter identifiers.

Return type

list

print_parameters(opt_map=None)[source]

Human readable, printable string of the parameter ids and their values.

Parameters

opt_map (list) – Nested list identifying the parameters of interest. If none is given, the full opt_map is used.

Returns

Parameters and their values

Return type

str

set_parameters(values: list, opt_map: list, scaled=False)[source]

Set the values in the original instruction class. If scaled is set, internal values between [-1, 1] are used.

Parameters
  • values (tf.Tensor) – Linear vector of parameter values

  • opt_map (list) – Nested list identifying each entry in the parameter vector

  • scaled (boolean) – Use the bare, optimizer friendly scaling

update_par_lens()[source]

Helper to update the lengths of each parameter in the case of vector or matrix valued parameters.

write_config()[source]
class c3.signal.gates.Instruction(name: str = ' ', channels: list = [], t_start: numpy.float64 = 0.0, t_end: numpy.float64 = 0.0)[source]

Bases: object

Collection of components making up the control signal for a line.

Parameters
  • t_start (np.float64) – Start of the signal.

  • t_end (np.float64) – End of the signal.

  • channels (list) – List of channel names (strings)

comps

Nested dictionary with lines and components as keys

Type

dict

Example
comps = {
‘channel_1’{

‘envelope1’: envelope1, ‘envelope2’: envelope2, ‘carrier’: carrier }

}

add_component(comp: c3.signal.pulse.InstructionComponent, chan: str)[source]

Add one component, e.g. an envelope, local oscillator, to a channel.

Parameters
  • comp (InstructionComponent) – Component to be added.

  • chan (str) – Identifier for the target channel

write_config()[source]

Pulse module

class c3.signal.pulse.Carrier(name: str, desc: str = ' ', comment: str = ' ', params: dict = {})[source]

Bases: c3.signal.pulse.InstructionComponent

Represents the carrier of a pulse.

params: dict
class c3.signal.pulse.Envelope(name: str, desc: str = ' ', comment: str = ' ', params: dict = {}, shape: function = None)[source]

Bases: c3.signal.pulse.InstructionComponent

Represents the envelopes shaping a pulse.

Parameters

shape (function) – function evaluating the shape in time

get_shape_values(ts, t_before=None)[source]

Return the value of the shape function at the specified times.

Parameters
  • ts (tf.Tensor) – Vector of time samples.

  • t_before (tf.float64) – Offset the beginning of the shape by this time.

params: dict
class c3.signal.pulse.InstructionComponent(name: str, desc: str = ' ', comment: str = ' ', params: dict = {})[source]

Bases: c3.c3objs.C3obj

Represents the components making up a pulse.

Parameters

params (dict) – dictionary of the parameters needed for the shape-function to create the desired pulse

params: dict

Module contents