paraqeet.model.coupling.TwoBodyCoupling#
- class paraqeet.model.coupling.TwoBodyCoupling(subsystem_A, subsystem_B, coefficient, is_longitudinal, use_rwa=False)#
Bases:
OptimizableCreate a coupling optimizable model.
Represents the coupling of two or more subsystems in a composite Hamiltonian. This class implements longitudinal and transversal coupling with a constant scalar coefficient. The coefficient is the only optimizable parameter. Subclasses can alter the behavior by overriding the get_couplings function.
- Parameters:
subsystems (list[Hamiltonian]) – The coupled subsystems.
coefficient (Quantity) – Either a constant coefficient as float or a callable that returns the coefficient for a given time.
is_longitudinal (bool) – Whether the coupling is longitudinal or transversal.
use_rwa (bool, optional) – If the transversal coupling should use the rotating-wave approximation or should include double excitation terms.
subsystem_A (DifferentiableHamiltonian)
subsystem_B (DifferentiableHamiltonian)
- __init__(subsystem_A, subsystem_B, coefficient, is_longitudinal, use_rwa=False)#
- Parameters:
subsystem_A (DifferentiableHamiltonian)
subsystem_B (DifferentiableHamiltonian)
coefficient (Quantity)
is_longitudinal (bool)
use_rwa (bool)
Methods
__init__(subsystem_A, subsystem_B, ...[, ...])Return the gradients of the coupling terms.
Return the matrix representation of a time-indepedent coupling.
Collect parameters from all subsystems and couplings.
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
Get the name of the parameter.
Get the optimizable parameters
Return subsystem A that is coupled by this term.
Return subsystem A that is coupled by this term.
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_coupling_gradients()#
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()#
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()#
Collect parameters from all subsystems and couplings.
- 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)#
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
- 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.