paraqeet.model.resonator.Resonator#

class paraqeet.model.resonator.Resonator(dimension, frequency, drives=None, t1=None, temp=None, t2star=None)#

Bases: DifferentiableHamiltonian

Hamiltonian of a harmonic oscillator.

The only optimizable parameter is the frequency.

Parameters:
  • dimension (int) – Dimension of the harmonic oscillator.

  • frequency (Quantity) – Frequency of the harmonic oscillator.

  • drives (list[Drive], optional) – List of time-dependent drives of the subsystem.

  • t1 (Quantity | None)

  • temp (Quantity | None)

  • t2star (Quantity | None)

__init__(dimension, frequency, drives=None, t1=None, temp=None, t2star=None)#
Parameters:

Methods

__init__(dimension, frequency[, drives, t1, ...])

dimension()

Get the dimension of the resonator.

get_collapseops()

Return a list tuples of decay rates and collapse operators for each subsystem.

get_decay_rates()

Return decay rate for T1, T2star and Temp respectively.

get_gradient_at_timestep(time)

Get the gradient of the drive.

get_parameters()

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

all_optimizable_parameters

Get the optimizable parameters

drives

Return the list of Drives of the system.

frequency

Get the frequency of the resonator.

name

Get the name of the parameter.

optimizable_parameters

Get the optimizable parameters

t1

Get the t1 of the resonator.

t2star

Get the t2star of the resonator.

temp

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]

property frequency: Quantity#

Get the frequency of the resonator.

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.

Parameters:
  • params (List[Quantity]) – List of optimizable parameters to be set.

  • all_params (list[Quantity])

Return type:

None

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

property t1: Quantity | None#

Get the t1 of the resonator.

property t2star: Quantity | None#

Get the t2star of the resonator.

property temp: Quantity | None#

Get the temp of the resonator.