paraqeet.model.rotating_frame_coupling.RotatingFrameCoupling#

class paraqeet.model.rotating_frame_coupling.RotatingFrameCoupling(subsystem_A, subsystem_B, coefficient, diffFreq)[source]#

Bases: TwoBodyCoupling

Implements the coupling in the rotating frame of the drive.

If multiple subsystems are coupled specify the difference frequency of the individual drive frames.

NOTE - Right now this only works for TWO SUBSYSTEMS. TODO - Generalize this for multiple subsystems

Parameters:
__init__(subsystem_A, subsystem_B, coefficient, diffFreq)[source]#
Parameters:

Methods

__init__(subsystem_A, subsystem_B, ...)

get_RWA_couplings(t)

Return the matrix representation of the coupling for all subsystems.

get_RWA_gradients(times)

Compute the gradients of the coupling expression in the rotating frame, i.e. include a phase factor for several timesteps.

get_RWA_gradients_one_time(t)

Get the one-time gradient of the matrix.

get_coupling_gradients()

Return the gradients of the coupling terms.

get_couplings()

Return the matrix representation of a time-indepedent coupling.

get_parameters()

Return the coupling coeffecient and the difference frequency.

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

name

Get the name of the parameter.

optimizable_parameters

Get the optimizable parameters

subsystem_A

Return subsystem A that is coupled by this term.

subsystem_B

Return subsystem A that is coupled by this term.

subsystems

Return the subsystems as a list to be compatible with other couplings with potentially more subsystems.

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]

get_RWA_couplings(t)[source]#

Return the matrix representation of the coupling for all subsystems.

A list of terms in the coupling is returned, where each of the term contains operators for each subsystem. A composite Hamiltonian puts these operators in the correct position in the tensor space to create the operators and then sum over the terms.

Parameters:

t (Array) – One time step.

Returns:

The outer list are the coupling terms. The inner list contains matrices for each subsystem. The matrices (Array) have the same shape as the subsystem’s Hamiltonian.get_value_one_time: (n,n) with n the subsystem dimension.

Return type:

list[list[Array]]

get_RWA_gradients(times)[source]#

Compute the gradients of the coupling expression in the rotating frame, i.e. include a phase factor for several timesteps.

Parameters:

times (Array)

get_RWA_gradients_one_time(t)[source]#

Get the one-time gradient of the matrix.

Returns the gradient of the matrix representation of the coupling for all subsystems. Each entry in the list is the gradient with respect to one parameter, factorised into subsystems (representing a list of term in the coupling).

Parameters:

t (Array) – One time point.

Returns:

The outer list represents the gradients with respect to all optimized parameters. The rest is in the same shape as the result of get_matrices_one_time.

Return type:

list[list[list[Array]]]

get_coupling_gradients()[source]#

Return the gradients of the coupling terms.

Returns:

The outer list represents the gradients with respect to all optimized parameters. The rest is in the same shape as the result of get_matrices.

Return type:

list[Array]

get_couplings()[source]#

Return the matrix representation of a time-indepedent coupling.

Returns:

The outer list are the coupling terms. The inner list represents the subsystems. The matrices (Array) have the same shape as the subsystem’s Hamiltonian.get_value: (t,n,n) with t the time and n the subsystem dimension.

Return type:

list[Array]

get_parameters()[source]#

Return the coupling coeffecient and the difference frequency.

NOTE - Optimization using relational quantities can be optimize the drive frequencies for the two subsystems.

Parameters:

list[Quantity] – Returns the list of parameters of the system.

Return type:

list[Quantity]

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

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

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 subsystem_A: DifferentiableHamiltonian#

Return subsystem A that is coupled by this term.

Returns:

List of subsystems.

Return type:

list[Hamiltonian]

property subsystem_B: DifferentiableHamiltonian#

Return subsystem A that is coupled by this term.

Returns:

List of subsystems.

Return type:

list[Hamiltonian]

property subsystems: list[DifferentiableHamiltonian]#

Return the subsystems as a list to be compatible with other couplings with potentially more subsystems.