Signal package

Submodules

Gates module

class c3.signal.gates.Instruction(name: str = ' ', targets: Optional[list] = None, params: Optional[dict] = None, ideal: Optional[ndarray] = None, channels: List[str] = [], t_start: float = 0.0, t_end: float = 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: C3obj, chan: str, options=None, name=None) None[source]

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

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

  • chan (str) – Identifier for the target channel

  • options (dict) –

    Options for this component, available keys are
    delay: Quantity

    Delay execution of this component by a certain time

    trigger_comp: Tuple[str]

    Tuple of (chan, name) of component acting as trigger. Delay time will be counted beginning with end of trigger

    t_final_cut: Quantity

    Length of component, signal will be cut after this time. Also used for the trigger. If not given this invokation from components t_final will be attempted.

    drag: bool

    Use drag correction for this component.

  • t_end (float) – End of this component. None will use the full instruction. If t_end is None and t_start is given a length will be inherited from the instruction.

as_openqasm() dict[source]
asdict() dict[source]
auto_adjust_t_end(buffer=0)[source]
from_dict(cfg, name=None)[source]
get_awg_signal(chan, ts)[source]
get_full_gate_length()[source]
get_ideal_gate(dims, index=None)[source]
get_key() str[source]
get_optimizable_parameters()[source]
get_timings(chan, name, minimal_time=False)[source]
quick_setup(chan, qubit_freq, gate_time, v2hz=1, sideband=None) None[source]

Initialize this instruction with a default envelope and carrier.

set_ideal(ideal)[source]
set_name(name, ideal=None)[source]

Pulse module

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

Bases: C3obj

Represents the carrier of a pulse.

write_config(filepath: str) None[source]

Write dictionary to a HJSON file.

class c3.signal.pulse.Envelope(name: str, desc: str = ' ', comment: str = ' ', params: Dict[str, Quantity] = {}, shape: Optional[Union[Callable, str]] = None, use_t_before=False)[source]

Bases: C3obj

Represents the envelopes shaping a pulse.

Parameters

shape (Callable) – function evaluating the shape in time

asdict() dict[source]
compute_mask(ts, t_end) Tensor[source]

Compute a mask to cut out a signal after t_final.

Parameters

ts (tf.Tensor) – Vector of time steps.

Returns

[description]

Return type

tf.Tensor

set_use_t_before(use_t_before)[source]
write_config(filepath: str) None[source]

Write dictionary to a HJSON file.

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

Bases: Envelope

get_shape_values(ts, t_final=1)[source]
set_use_t_before(use_t_before)[source]
class c3.signal.pulse.EnvelopeNetZero(name: str, desc: str = ' ', comment: str = ' ', params: dict = {}, shape: Optional[function] = None, use_t_before=False)[source]

Bases: Envelope

Represents the envelopes shaping a pulse.

Parameters
  • shape (function) – function evaluating the shape in time

  • params (dict) – Parameters of the envelope Note: t_final

get_shape_values(ts)[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.

set_use_t_before(use_t_before)[source]
c3.signal.pulse.comp_reg_deco(func)[source]

Decorator for making registry of functions

Module contents