paraqeet.model.resonator.Resonator#
- class paraqeet.model.resonator.Resonator(dimension, frequency, drives=None, t1=None, temp=None, t2star=None)#
Bases:
DifferentiableHamiltonianHamiltonian of a harmonic oscillator.
The only optimizable parameter is the frequency.
- Parameters:
- __init__(dimension, frequency, drives=None, t1=None, temp=None, t2star=None)#
Methods
__init__(dimension, frequency[, drives, t1, ...])Get the dimension of the resonator.
Return a list tuples of decay rates and collapse operators for each subsystem.
Return decay rate for T1, T2star and Temp respectively.
get_gradient_at_timestep(time)Get the gradient of the drive.
Get parameters of the model.
get_value(times)Return the matrix representation of the Hamiltonian.
get_value_and_gradient(times)Compute value and gradient for given timesteps.
get_value_at_timestep(timestep)Get the drive matrix.
set_all_optimizable_parameters(all_params)Set all optimizable parameters in the optimization.
set_optimizable_parameters(params)Set which parameters associated with the object shall be considered during optimization.
Attributes
Get the optimizable parameters
Return the list of Drives of the system.
Get the frequency of the resonator.
Get the name of the parameter.
Get the optimizable parameters
Get the t1 of the resonator.
Get the t2star of the resonator.
Get the temp of the resonator.
- property all_optimizable_parameters: list[Quantity]#
Get the optimizable parameters
- Returns:
The list of all the optimizable parameters considered in the optimization
- Return type:
list[Quantity]
- dimension()#
Get the dimension of the resonator.
- property drives: list[Drive]#
Return the list of Drives of the system.
- Returns:
Returns a list of time-dependent drives of the system.
- Return type:
list[Drive]
- get_collapseops()#
Return a list tuples of decay rates and collapse operators for each subsystem.
- Returns:
List of collapse operators
- Return type:
list[tuple[Array, Array]]
- get_decay_rates()#
Return decay rate for T1, T2star and Temp respectively.
- Return type:
list[Array]
- get_gradient_at_timestep(time)#
Get the gradient of the drive.
- Parameters:
times (float) – One time stamp.
time (float)
- Returns:
Returns the gradients of the drive.
- Return type:
Array
- get_parameters()#
Get parameters of the model.
- Returns:
Returns the list of parameters of the system.
- Return type:
List[Quantity]
- get_value(times)#
Return the matrix representation of the Hamiltonian.
The default implementation calls get_value_at_timestep for each time step. Subclasses can override this function for a more efficient implementation.
- Parameters:
times (Array) – Vector of time samples.
- Returns:
Hamiltonian of shape [t, n, n] with ‘t’ as time and ‘n’ as the Hilbert space dimension.
- Return type:
Array
- get_value_and_gradient(times)#
Compute value and gradient for given timesteps. The gradient call uses vmap over at_timestep methods.
- Parameters:
times (Array)
- Return type:
tuple[Array, Array]
- get_value_at_timestep(timestep)#
Get the drive matrix.
- Parameters:
timestep (float) – One time stamp.
- Returns:
The drive matrix at a single timestamp.
- Return type:
Array
- property name: str | None#
Get the name of the parameter.
- Returns:
Name of the parameter.
- Return type:
str | None
- property optimizable_parameters: list[Quantity]#
Get the optimizable parameters
- Returns:
The list of optimizable parameters associated with the object.
- Return type:
list[Quantity]
- set_all_optimizable_parameters(all_params)#
Set all optimizable parameters in the optimization.
- set_optimizable_parameters(params)#
Set which parameters associated with the object shall be considered during optimization.
All quantities that are not in the response of get_parameters will be filtered out. This function is called by the optimizer before gradient based optimization to tell the layers which gradients to compute.
- Parameters:
params (list[Quantity]) – List of optimizable parameters to be set.
- Return type:
None