paraqeet.propagation.differentiable_propagation.DifferentiablePropagation#
- class paraqeet.propagation.differentiable_propagation.DifferentiablePropagation(model, resolution)#
Bases:
Propagation,DifferentiablePropagation methods that provide a get_value_and_gradient method.
- Parameters:
model (Model) – Represents the equation of motion for a given Hamiltonian.
resolution (float)
- __init__(model, resolution)#
- Parameters:
model (EquationOfMotion)
resolution (float)
Methods
__init__(model, resolution)Per default, propagation methods have no parameters to optimize.
get_value_and_gradient(times)Gradient method to be implemented
propagate(time)Return the solution of the equations of motion.
set_initial_state(state)Set the initial state for the propagation.
Attributes
Return if the propagation is for open or closed system.
Return the propagation resolution.
- get_parameters()#
Per default, propagation methods have no parameters to optimize.
- abstract get_value_and_gradient(times)#
Gradient method to be implemented
- Parameters:
times (Array) – Array of timesteps.
- Returns:
First dimension is time, second dimension is the parameter.
- Return type:
tuple[Array, Array]
- property is_open: bool#
Return if the propagation is for open or closed system.
- abstract propagate(time)#
Return the solution of the equations of motion.
The first dimension of the result will always be the time. Like in the model, the format of the other dimensions depends on the implementation and could for example be a propagated state vector or a propagator in matrix form.
- Parameters:
time (Array) – Any one-dimensional vector of timestamps.
- Returns:
Returns the solution of the equations of motion.
- Return type:
Array
- property resolution: float#
Return the propagation resolution.
- set_initial_state(state)#
Set the initial state for the propagation. (Default implementation)
Propagation implementations that do not need the state should not implement this function.
Subclasses can access the state in the _initial_sate field.
- Parameters:
state (Array) – Parameter value to be set as the initial state for the propagation.