paraqeet.model.rotating_frame_drive.RotatingFrameDrive#

class paraqeet.model.rotating_frame_drive.RotatingFrameDrive(signal_generator)#

Bases: Drive

Drive Hamiltonian in the Frame rotating at the frequency of the drive.

_signal_generator: Generator

Signal Generator without a LO, like the PWCGenerator

Parameters:

signal_generator (Generator)

__init__(signal_generator)#
Parameters:

signal_generator (Generator)

Methods

__init__(signal_generator)

get_gradient(annihilation_operator, times)

Return the gradient of the system.

get_gradient_at_timestep(...)

Get the one-time gradient of the system.

get_parameters()

Get a list of parameters of the system.

get_value(annihilation_operator, times)

Return the matrix representation of the drive.

get_value_at_timestep(annihilation_operator, t)

Implement drive in the rotating frame of drive.

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

generator

Get the signal generator from the system.

name

Get the name of the parameter.

optimizable_parameters

Get the optimizable parameters

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]

property generator: Generator#

Get the signal generator from the system.

Returns:

Returns the signal generator object from the system.

Return type:

Generator

get_gradient(annihilation_operator, times)#

Return the gradient of the system.

Returns the gradient of the matrix representation of the Hamiltonian with respect to each parameter as a list.

Parameters:
  • annihilation_operator (Array) – Operator of the subsystem to which this drive is attached.

  • times (Array) – Vector of time samples.

Returns:

Array of shape [t, p, n, n] with ‘t’ as time, ‘p’ as number of parameters and ‘n’ as the Hilbert space dimension.

Return type:

Array

get_gradient_at_timestep(annihilation_operator, timestep)#

Get the one-time gradient of the system.

Fetches the gradient from the drive and transforms it into the correct shape for the Hamiltonian.

Parameters:
  • annihilation_operator (Array) – Operator for longitudinal or transverse drive.

  • timestep (Array) – One-dimensional vector of timestamps.

Returns:

Returns the shape-shifted gradient from the drive.

Return type:

Array

get_parameters()#

Get a list of parameters of the system.

Returns:

List of optimizable parameters of the system.

Return type:

list[Quantity]

get_value(annihilation_operator, times)#

Return the matrix representation of the drive.

The dimension is given by the Hamiltonian to which this drive is attached. The default implementation calls getMatrixOneTime for each time step. Subclasses can override this function for a more efficient implementation.

Parameters:
  • annihilation_operator (Array) – Operator of the subsystem to which this drive is attached

  • times (Array) – Vector of time samples.

Returns:

Matrix of shape [t, n, n] with ‘t’ as time and ‘n’ as the Hilbert space dimension.

Return type:

Array

get_value_at_timestep(annihilation_operator, t)#

Implement drive in the rotating frame of drive.

Drive Hamiltonian is implemented as \big\{ \Omega a + \Omega^* a^\dagger \big\} Where \Omega is the envelope (without the LO).

Parameters:
  • annihilation_operator (Array) – Annihilation operator of the subsystem

  • t (Array) – One time step

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