Oscillator

class scqubits.core.oscillator.Oscillator(E_osc, l_osc=None, truncated_dim=6, id_str=None)[source]

Class representing a harmonic oscillator/resonator governed by a Hamiltonian \(H=E_\text{osc} a^{\dagger} a\), with \(a\) being the annihilation operator.

Parameters:
  • E_osc (float) – energy of the oscillator

  • l_osc (Optional[float]) – oscillator length (required to define phi_operator and n_operator)

  • truncated_dim (int) – desired dimension of the truncated quantum system; expected: truncated_dim > 1

  • id_str (Optional[str]) – optional string by which this instance can be referred to in HilbertSpace and ParameterSweep. If not provided, an id is auto-generated.

Methods

Oscillator.__init__(E_osc[, l_osc, ...])

Oscillator.annihilation_operator()

Returns the annihilation operator

Oscillator.broadcast(event, **kwargs)

Request a broadcast from CENTRAL_DISPATCH reporting event.

Oscillator.create()

Use ipywidgets to create a new class instance

Oscillator.create_from_file(filename)

Read initdata and spectral data from file, and use those to create a new SpectrumData object.

Oscillator.creation_operator()

Returns the creation operator

Oscillator.default_params()

Return dictionary with default parameter values for initialization of class instance

Oscillator.deserialize(io_data)

Take the given IOData and return an instance of the described class, initialized with the data stored in io_data.

Oscillator.eigensys([evals_count])

Returns array of eigenvalues and eigenvectors

Oscillator.eigenvals([evals_count])

Returns array of eigenvalues.

Oscillator.filewrite(filename)

Convenience method bound to the class.

Oscillator.get_initdata()

Returns dict appropriate for creating/initializing a new Serializable object.

Oscillator.get_operator_names()

Returns a list of all operator names for the quantum system.

Oscillator.hilbertdim()

Returns Hilbert space dimension

Oscillator.matrixelement_table(*args, **kwargs)

rtype:

ndarray

Oscillator.n_operator()

Returns the charge-number n operator defined as \(i (a^{\dagger} - a)/ ( \sqrt{2} l_\text{osc})\), with \(a\) representing an annihilation operator, and \(l_\text{osc}\) the oscillator length.

Oscillator.phi_operator()

Returns the phase operator defined as \(l_\text{osc} (a + a^{\dagger})/\sqrt{2}\), with \(a\) representing an annihilation operator, and \(l_\text{osc}\) the oscillator length.

Oscillator.receive(event, sender, **kwargs)

Receive a message from CENTRAL_DISPATCH and initiate action on it.

Oscillator.serialize()

Convert the content of the current class instance into IOData format.

Oscillator.set_params(**kwargs)

Set new parameters through the provided dictionary.

Oscillator.set_params_from_gui(change)

Set new parameters through the provided dictionary.

Oscillator.supported_noise_channels()

Returns a list of noise channels this QuantumSystem supports.

Oscillator.widget([params])

Use ipywidgets to modify parameters of class instance

Attributes

E_osc

Descriptor class for properties that are to be monitored for changes.

id_str

l_osc

Descriptor class for properties that are to be monitored for changes.

truncated_dim

Descriptor class for properties that are to be monitored for changes.

annihilation_operator()[source]

Returns the annihilation operator

Return type:

ndarray

broadcast(event, **kwargs)

Request a broadcast from CENTRAL_DISPATCH reporting event.

Parameters:
  • event (str) – event name from EVENTS

  • **kwargs

Return type:

None

classmethod create()

Use ipywidgets to create a new class instance

Return type:

QuantumSystem

classmethod create_from_file(filename)

Read initdata and spectral data from file, and use those to create a new SpectrumData object.

Returns:

new SpectrumData object, initialized with data read from file

Return type:

SpectrumData

Parameters:

filename (str)

creation_operator()[source]

Returns the creation operator

Return type:

ndarray

static default_params()[source]

Return dictionary with default parameter values for initialization of class instance

Return type:

Dict[str, Any]

classmethod deserialize(io_data)

Take the given IOData and return an instance of the described class, initialized with the data stored in io_data.

Return type:

TypeVar(SerializableType, bound= Serializable)

Parameters:

io_data (IOData)

eigensys(evals_count=6)[source]

Returns array of eigenvalues and eigenvectors

Parameters:

evals_count (int) – number of desired eigenvalues (default value = 6)

Return type:

Tuple[ndarray, ndarray]

eigenvals(evals_count=6)[source]

Returns array of eigenvalues.

Parameters:

evals_count (int) – number of desired eigenvalues (default value = 6)

Return type:

ndarray

filewrite(filename)

Convenience method bound to the class. Simply accesses the write function.

Return type:

None

Parameters:

filename (str)

get_initdata()

Returns dict appropriate for creating/initializing a new Serializable object.

Return type:

Dict[str, Any]

classmethod get_operator_names()

Returns a list of all operator names for the quantum system. Note that this list omits any operators that start with “_”.

Parameters:

subsys – Class instance of quantum system

Return type:

List[str]

Returns:

list of operator names

hilbertdim()[source]

Returns Hilbert space dimension

Return type:

int

n_operator()[source]

Returns the charge-number n operator defined as \(i (a^{\dagger} - a)/ ( \sqrt{2} l_\text{osc})\), with \(a\) representing an annihilation operator, and \(l_\text{osc}\) the oscillator length.

Return type:

ndarray

phi_operator()[source]

Returns the phase operator defined as \(l_\text{osc} (a + a^{\dagger})/\sqrt{2}\), with \(a\) representing an annihilation operator, and \(l_\text{osc}\) the oscillator length.

Return type:

ndarray

receive(event, sender, **kwargs)

Receive a message from CENTRAL_DISPATCH and initiate action on it.

Parameters:
  • event (str) – event name from EVENTS

  • sender (DispatchClient) – original sender reporting the event

  • **kwargs

Return type:

None

serialize()

Convert the content of the current class instance into IOData format.

Return type:

IOData

set_params(**kwargs)

Set new parameters through the provided dictionary.

set_params_from_gui(change)

Set new parameters through the provided dictionary.

supported_noise_channels()

Returns a list of noise channels this QuantumSystem supports. If none, return an empty list.

Return type:

List

widget(params=None)

Use ipywidgets to modify parameters of class instance

Parameters:

params (Dict[str, Any] | None)