paraqeet.model.equation_of_motion.EquationOfMotion#
- class paraqeet.model.equation_of_motion.EquationOfMotion(hamiltonian)#
Bases:
OptimizableRepresents the equation of motion for a given Hamiltonian.
Implementations can for example be the Schrödinger equation for a closed system, Lindbladian for an open system, or Hamilton’s equations for a classical system.
- Parameters:
hamiltonian (Hamiltonian) – Matrix representation of a Hamiltonian.
- __init__(hamiltonian)#
- Parameters:
hamiltonian (DifferentiableHamiltonian)
Methods
__init__(hamiltonian)Return all parameters of this class that can be optimized.
get_right_hand_side(time, state)Return the right-hand side of the equations of motion.
get_value(times)Abstract method to get the prefactor matrix.
get_value_and_gradient(times)Implement the gradient of either getEquationOfMotion or getMatrixEOM.
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.
ode_propagationGet 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]
- abstract get_parameters()#
Return all parameters of this class that can be optimized.
- Raises:
NotImplementedError – Subclasses derived from this class must implement this method.
- Return type:
list[Quantity]
- get_right_hand_side(time, state)#
Return the right-hand side of the equations of motion.
The format depends on the implementation and could for example be a state vector or a matrix. Default implementation assumes a homogeneous ODE with matrix operator given by self.getMatrix().
- Parameters:
time (Array) – Any one-dimensional vector of timestamps.
state (Array)
- Returns:
The right-hand side of the equation of motion at each time stamp.
- Return type:
Array
- abstract get_value(times)#
Abstract method to get the prefactor matrix.
- Parameters:
times (Array) – Any one-dimensional vector of timestamps.
- Returns:
Returns matrix equations of motion.
- Return type:
Array
- Raises:
NotImplementedError – Subclasses derived from this class must implement this method.
- abstract get_value_and_gradient(times)#
Implement the gradient of either getEquationOfMotion or getMatrixEOM.
- Parameters:
times (Array) – Any one-dimensional vector of timestamps.
- Raises:
NotImplementedError – Subclasses derived from this class must implement this method.
- Return type:
tuple[Array, 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