GenericQubit#

class scqubits.core.generic_qubit.GenericQubit(E, id_str=None)[source]#

Class for a generic qubit (genuine two-level system). Create a class instance via:

GenericQubit(E=4.3)
Parameters:
  • E (float) – qubit energy splitting

  • 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.

Return type:

QuantumSystemType

Methods

GenericQubit.__init__(E[, id_str])

GenericQubit.broadcast(event, **kwargs)

Request a broadcast from CENTRAL_DISPATCH reporting event.

GenericQubit.create()

Use ipywidgets to create a new class instance

GenericQubit.create_from_file(filename)

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

GenericQubit.default_params()

Return dictionary with default parameter values for initialization of class instance

GenericQubit.deserialize(io_data)

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

GenericQubit.eigensys([evals_count])

rtype:

Tuple[ndarray, ndarray]

GenericQubit.eigenvals([evals_count])

rtype:

ndarray

GenericQubit.filewrite(filename)

Convenience method bound to the class.

GenericQubit.get_initdata()

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

GenericQubit.get_operator_names()

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

GenericQubit.hamiltonian()

GenericQubit.hilbertdim()

Returns Hilbert space dimension

GenericQubit.matrixelement_table(operator)

Returns table of matrix elements for operator with respect to the eigenstates of the qubit.

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

Receive a message from CENTRAL_DISPATCH and initiate action on it.

GenericQubit.serialize()

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

GenericQubit.set_params(**kwargs)

Set new parameters through the provided dictionary.

GenericQubit.set_params_from_gui(change)

Set new parameters through the provided dictionary.

GenericQubit.sm_operator()

GenericQubit.sp_operator()

GenericQubit.supported_noise_channels()

Returns a list of noise channels this QuantumSystem supports.

GenericQubit.sx_operator()

GenericQubit.sy_operator()

GenericQubit.sz_operator()

GenericQubit.widget([params])

Use ipywidgets to modify parameters of class instance

Attributes

E

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

id_str

truncated_dim

broadcast(event, **kwargs)#

Request a broadcast from CENTRAL_DISPATCH reporting event.

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

  • **kwargs

Return type:

None

classmethod create()[source]#

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) –

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) –

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

matrixelement_table(operator)[source]#

Returns table of matrix elements for operator with respect to the eigenstates of the qubit. The operator is given as a string matching a class method returning an operator matrix.

Parameters:

operator (str) – name of class method in string form, returning operator matrix in qubit-internal basis.

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)[source]#

Use ipywidgets to modify parameters of class instance

Parameters:

params (Dict[str, Any] | None) –