paraqeet.model.closed_system.ClosedSystem#
- class paraqeet.model.closed_system.ClosedSystem(hamiltonian, ode_propagation=False)#
Bases:
EquationOfMotionModel of a closed physical system, defined by a Hamiltonian.
Its dynamics is given by the Schrödinger equation.
- Parameters:
hamiltonian (Hamiltonian) – Matrix representation of a Hamiltonian.
ode_propagation (bool)
- __init__(hamiltonian, ode_propagation=False)#
- Parameters:
hamiltonian (DifferentiableHamiltonian)
ode_propagation (bool)
Methods
__init__(hamiltonian[, ode_propagation])Get a list of optimizable parameters.
get_right_hand_side(time, state)Return the right-hand side of the equations of motion.
get_value(times)Get the matrix equations of motion.
get_value_and_gradient(times)Compute the gradient of getMatrix.
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.
Flag to set method of propagation to ODE.
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]
- get_parameters()#
Get a list of optimizable parameters.
- Returns:
List of optimizable parameters of the system.
- 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
- get_value(times)#
Get the matrix equations of motion.
Computes the right hand side of the Schrödinger equation without multiplying the state. Used for unitary solvers.
- Parameters:
times (Array) – Vector of time samples.
- Returns:
RHS with dimension [t, n, n] with ‘t’ as time and ‘n’ as Hilbert space dimension.
- Return type:
Array
- get_value_and_gradient(times)#
Compute the gradient of getMatrix.
- Parameters:
times (Array) – Vector of time samples.
- Returns:
Returns the gradient of getMatrix.
- Return type:
Array
- property name: str | None#
Get the name of the parameter.
- Returns:
Name of the parameter.
- Return type:
str | None
- property ode_propagation: bool#
Flag to set method of propagation to ODE.
- Returns:
Flag to use ODE propagation.
- Return type:
bool
- 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