The model class, containing information on the system and its modelling.

Module Contents

class c3.model.Model(subsystems=None, couplings=None, tasks=None, max_excitations=0)[source]

What the theorist thinks about from the system.

Class to store information about our system/problem/device. Different models can represent the same system.

  • subsystems (list) – List of individual, non-interacting physical components like qubits or resonators

  • couplings (list) – List of interaction operators between subsystems, like couplings or drives.

  • tasks (list) – Badly named list of processing steps like line distortions and read out modeling

  • max_excitations (int) – Allow only up to max_excitations in the system

get_init_state(self) tensorflow.Tensor[source]

Get an initial state. If a task to compute a thermal state is set, return that.

set_max_excitations(self, max_excitations) None[source]

Set the maximum number of excitations in the system used for propagation.

read_config(self, filepath: str) None[source]

Load a file and parse it to create a Model object.


filepath (str) – Location of the configuration file

fromdict(self, cfg: dict) None[source]

Load a file and parse it to create a Model object.


cfg (dict) – configuration file

write_config(self, filepath: str) None[source]

Write dictionary to a HJSON file.

asdict(self) dict[source]

Return a dictionary compatible with config files.

__str__(self) str[source]

Return str(self).

set_dressed(self, dressed)[source]

Go to a dressed frame where static couplings have been eliminated.


dressed (boolean) –

set_lindbladian(self, lindbladian: bool) None[source]

Set whether to include open system dynamics.


lindbladian (boolean) –

set_FR(self, use_FR)[source]

Setter for the frame rotation option for adjusting the individual rotating frames of qubits when using gate sequences

get_Hamiltonian(self, signal=None)[source]

Get a hamiltonian with an optional signal. This will return an hamiltonian over time. Can be used e.g. for tuning the frequency of a transmon, where the control hamiltonian is not easily accessible. If max.excitation is non-zero the resulting Hamiltonian is cut accordingly


Recompute the matrix representations of the Hamiltonians.


Return Lindbladian operators and their prefactors.

update_drift_eigen(self, ordered=True)[source]

Compute the eigendecomposition of the drift Hamiltonian and store both the Eigenenergies and the transformation matrix.

update_dressed(self, ordered=True)[source]

Compute the Hamiltonians in the dressed basis by diagonalizing the drift and applying the resulting transformation to the control Hamiltonians.

get_Frame_Rotation(self, t_final: numpy.float64, freqs: dict, framechanges: dict)[source]

Compute the frame rotation needed to align Lab frame and rotating Eigenframes of the qubits.

  • t_final (tf.float64) – Gate length

  • freqs (list) – Frequencies of the local oscillators.

  • framechanges (list) – List of framechanges. A phase shift applied to the control signal to compensate relative phases of drive oscillator and qubit.


A (diagonal) propagator that adjust phases

Return type


get_dephasing_channel(self, t_final, amps)[source]

Compute the matrix of the dephasing channel to be applied on the operation.

  • t_final (tf.float64) – Duration of the operation.

  • amps (dict of tf.float64) – Dictionary of average amplitude on each drive line.


Matrix representation of the dephasing channel.

Return type