InteractionTermStr#

class scqubits.core.hilbert_space.InteractionTermStr(expr, operator_list, id_wrapped_operator_list=None, const=None, add_hc=False)[source]#

Class for specifying a term in the interaction Hamiltonian of a composite Hilbert space, and constructing the Hamiltonian in qutip.Qobj format. The form of the interaction is defined using the expr string. Each operator must be hermitian, unless add_hc = True in which case each operator my be non-hermitian. Acceptable functions inside of expr string include: cos(), sin(), dag(), conj(), exp(), sqrt(), trans(), cosm(), sinm(), expm(), and sqrtm() along with other operators allowed in Python expressions.

Parameters:
  • expr (str) – string that defines the interaction.

  • operator_list (List[Tuple[int, str, Union[ndarray, csc_matrix, dia_matrix]]]) – list of tuples of operator names, operators, and subsystem indices eg. {name: (operator, subsystem)}.

  • add_hc (bool) – If set to True, the interaction Hamiltonian is of type 2, and the Hermitian conjugate is added.

Return type:

SerializableType

Methods

InteractionTermStr.__init__(expr, operator_list)

InteractionTermStr.broadcast(event, **kwargs)

Request a broadcast from CENTRAL_DISPATCH reporting event.

InteractionTermStr.create_from_file(filename)

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

InteractionTermStr.deserialize(io_data)

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

InteractionTermStr.filewrite(filename)

Convenience method bound to the class.

InteractionTermStr.hamiltonian(subsystem_list)

type subsystem_list:

List[Union[QubitBaseClass, Oscillator, KerrOscillator, GenericQubit]]

InteractionTermStr.id_wrap_all_ops(subsys_list)

rtype:

Dict[str, Qobj]

InteractionTermStr.parse_qutip_functions(string)

rtype:

str

InteractionTermStr.receive(event, sender, ...)

Receive a message from CENTRAL_DISPATCH and initiate action on it.

InteractionTermStr.run_string_code(...)

rtype:

Qobj

InteractionTermStr.serialize()

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

Attributes

add_hc

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

expr

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

operator_list

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

broadcast(event, **kwargs)#

Request a broadcast from CENTRAL_DISPATCH reporting event.

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

  • **kwargs

Return type:

None

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

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

hamiltonian(subsystem_list, bare_esys=None)[source]#
Parameters:
  • subsystem_list (List[Union[QubitBaseClass, Oscillator, KerrOscillator, GenericQubit]]) – list of all quantum systems in HilbertSpace calling hamiltonian, needed for identity wrapping

  • bare_esys (Optional[Dict[int, ndarray]]) – optionally, the bare eigensystems for each subsystem can be provided to speed up computation; these are provided in dict form via <subsys>: esys)

Return type:

Qobj

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