CircuitRoutines¶
- class scqubits.core.circuit_routines.CircuitRoutines[source]¶
Methods
CircuitRoutines.__init__()CircuitRoutines.create()Returns a dictionary, where each variable is associated with its respective cutoff.
CircuitRoutines.default_params()CircuitRoutines.deserialize(io_data)CircuitRoutines.discretized_grids_dict_for_vars()CircuitRoutines.exp_i_operator(var_sym, ...)Returns the bare operator exp(i* heta*prefactor), without the kron product.
Returns the eigensystem of the Circuit, and all the subsystems involved in the bare basis.
Method to get the cutoffs for each of the circuit's degree of freedom.
Get the ext_basis object for the Circuit instance, according to the setting in self.hierarchical_diagonalization.
CircuitRoutines.get_operator_by_name(...[, ...])Returns the operator for the given operator symbol which has the same dimension as the hilbertdim of the instance from which the operator is requested.
CircuitRoutines.get_osc_param(var_index[, ...])Returns the oscillator parameters based on the oscillator used to diagonalize the Hamiltonian in the harmonic oscillator basis.
CircuitRoutines.get_subsystem_index(var_index)Returns the subsystem index for the subsystem to which the given var_index belongs.
Returns the Hamiltonian of the Circuit.
Returns the Hilbert dimension of the Circuit instance.
CircuitRoutines.identity_wrap_for_hd(...[, ...])Returns an identity wrapped operator whose size is equal to the self.hilbertdim().
CircuitRoutines.is_subsystem(instance)Returns true if the instance is a subsystem of self (regardless of the hierarchy)
Returns all the offset charges set using the circuit attributes for each of the periodic degree of freedom.
CircuitRoutines.receive(event, sender, **kwargs)Method to help the CentralDispatch keep track of the sync status in Circuit and SubSystem modules.
Returns the parent Circuit instance.
CircuitRoutines.return_root_child(var_index)Returns the root child of the subsystem instance with var_index in its dynamic_var_indices.
CircuitRoutines.serialize()CircuitRoutines.set_and_return(attr_name, value)Allows to set an attribute after which self is returned. This is useful for doing something like example::.
CircuitRoutines.set_bare_eigensys(eigensys)Sets the bare eigensystem of the Circuit in the lookup table of
hilbert_spaceattribute, if hierarchical diagonalization is used.Sets the flux range for discretized phi basis or for plotting.
CircuitRoutines.update([calculate_bare_esys])Syncs all the parameters of the subsystems with the current instance.
- cutoffs_dict()[source]¶
Returns a dictionary, where each variable is associated with its respective cutoff.
- exp_i_operator(var_sym, prefactor)[source]¶
Returns the bare operator exp(i* heta*prefactor), without the kron product.
Needs the oscillator lengths to be set in the attribute,
osc_lengths, when ext_basis is set to “harmonic”.- Return type:
Union[csc_matrix,ndarray]- Parameters:
- generate_bare_eigensys()[source]¶
Returns the eigensystem of the Circuit, and all the subsystems involved in the bare basis.
- get_ext_basis()[source]¶
Get the ext_basis object for the Circuit instance, according to the setting in self.hierarchical_diagonalization.
- get_operator_by_name(operator_name, power=None, bare_esys=None)[source]¶
Returns the operator for the given operator symbol which has the same dimension as the hilbertdim of the instance from which the operator is requested.
- Parameters:
- Return type:
- Returns:
operator identified by operator_name
- get_osc_param(var_index, which_param='length')[source]¶
Returns the oscillator parameters based on the oscillator used to diagonalize the Hamiltonian in the harmonic oscillator basis.
- Parameters:
- Return type:
- Returns:
returns the float value which is the oscillator length or the frequency of the oscillator corresponding to var_index depending on the string which_param.
- get_subsystem_index(var_index)[source]¶
Returns the subsystem index for the subsystem to which the given var_index belongs.
- hamiltonian()[source]¶
Returns the Hamiltonian of the Circuit.
- Return type:
Union[csc_matrix,ndarray]
- identity_wrap_for_hd(operator, child_instance, bare_esys=None)[source]¶
Returns an identity wrapped operator whose size is equal to the self.hilbertdim(). Only converts operator which belongs to a specific variable index. For example, operator Q_1 or cos( heta_1). But not, Q1*Q2.
- Parameters:
- Return type:
- Returns:
identity wrapped operator.
- is_subsystem(instance)[source]¶
Returns true if the instance is a subsystem of self (regardless of the hierarchy)
- offset_free_charge_values()[source]¶
Returns all the offset charges set using the circuit attributes for each of the periodic degree of freedom.
- receive(event, sender, **kwargs)[source]¶
Method to help the CentralDispatch keep track of the sync status in Circuit and SubSystem modules.
- return_root_child(var_index)[source]¶
Returns the root child of the subsystem instance with var_index in its dynamic_var_indices.
- Parameters:
var_index (
int) – index of one of the dynamical degrees of freedom (fromdynamic_var_indices)- Returns:
Subsystem instance with var_index in its dynamic_var_indices.
- set_and_return(attr_name, value)[source]¶
Allows to set an attribute after which self is returned. This is useful for doing something like example:
qubit.set_and_return('flux', 0.23).some_method()
instead of example:
qubit.flux=0.23 qubit.some_method()
- Parameters:
- Return type:
- Returns:
self
- set_bare_eigensys(eigensys)[source]¶
Sets the bare eigensystem of the Circuit in the lookup table of
hilbert_spaceattribute, if hierarchical diagonalization is used.