|
| | TimeStepper () |
| |
| | TimeStepper (const Config &config, MasterEq *mastereq_, Output *output_, int ninit_local) |
| | Constructor for time stepper.
|
| |
| virtual | ~TimeStepper () |
| |
| double | getLeakageIntegral () |
| |
| double | getWeightedCostIntegral () |
| |
| double | getEnergyIntegral () |
| |
| double | getDPDMIntegral () |
| |
| Vec | getReducedGradient () |
| |
| void | setWriteTrajectoryDataFiles (bool write) |
| |
| void | setOptimTarget (OptimTarget *optim_target_) |
| |
| Vec | getFinalState (size_t iinit_local) |
| | Retrieves the final state for a specific local initial condition.
|
| |
| virtual double | getMinTimestepSize () const |
| | Get the smallest timestep size used during timestepping.
|
| |
| virtual Vec | solveODE (int initid, int iinit_local, Vec rho_t0) |
| | Solves the ODE forward in time.
|
| |
| virtual void | solveAdjointODE (int iinit_local, Vec rho_t0_bar, double Jbar_leakage, double Jbar_weightedcost, double Jbar_dpdm, double Jbar_energy) |
| | Solves the adjoint ODE backward in time.
|
| |
| double | evalLeakage (const Vec x) |
| | Evaluates leakage into guard levels.
|
| |
| void | evalLeakage_diff (const Vec x, Vec xbar, double Jbar) |
| | Computes derivative of leakage term.
|
| |
| double | evalWeightedCost (double time, const Vec x) |
| | Evaluates the weighted cost function term.
|
| |
| void | evalWeightedCost_diff (double time, const Vec x, Vec xbar, double Jbar) |
| | Computes derivative of weighted cost function term.
|
| |
| double | evalDpDm (Vec x, Vec xm1, Vec xm2) |
| | Evaluates second-order derivative variation for the state.
|
| |
| void | evalDpDm_diff (int n, Vec xbar, double Jbar) |
| | Computes derivative of second-order derivative variation term.
|
| |
| double | evalEnergy (double time) |
| | Evaluates energy integral term.
|
| |
| void | evalEnergy_diff (double time, double Jbar, Vec redgrad) |
| | Computes derivative of energy integral.
|
| |
| virtual void | evolveFWD (const double tstart, const double tstop, Vec x)=0 |
| | Evolves state forward by one time-step from tstart to tstop.
|
| |
| virtual void | evolveBWD (const double tstart, const double tstop, const Vec x_stop, Vec x_adj, Vec grad, bool compute_gradient) |
| | Evolves adjoint state backward by one time-step and updates reduced gradient.
|
| |
|
| Vec | x |
| | Auxiliary vector for forward time stepping.
|
| |
| Vec | xadj |
| | Auxiliary vector needed for adjoint (backward) time stepping.
|
| |
| Vec | xprimal |
| | Auxiliary vector for backward time stepping.
|
| |
| std::vector< std::vector< Vec > > | trajectory_states |
| | Storage for primal states during forward evolution, one trajectory for each local initial condition..
|
| |
| std::vector< Vec > | final_states |
| | Storage for final states for each local initial condition. Always filled after solveODE.
|
| |
| std::vector< Vec > | dpdm_states |
| | Storage for states needed for second-order derivative penalty.
|
| |
| int | mpirank_world |
| | MPI rank in global communicator.
|
| |
| int | mpisize_petsc |
| | MPI size in Petsc communicator.
|
| |
| int | mpirank_petsc |
| | MPI rank in Petsc communicator.
|
| |
| PetscInt | localsize_u |
| | Size of local sub vector u or v in state x=[u,v].
|
| |
| PetscInt | ilow |
| | First index of the local sub vector u,v.
|
| |
| PetscInt | iupp |
| | Last index (+1) of the local sub vector u,v.
|
| |
| bool | eval_leakage |
| | Flag to compute leakage integral term.
|
| |
| bool | eval_energy |
| | Flag to compute energy integral term.
|
| |
| bool | eval_dpdm |
| | Flag to compute second-order derivative integral term.
|
| |
| bool | eval_weightedcost |
| | Flag to compute weighted cost integral term.
|
| |
| double | leakage_integral |
| | Sums the integral over leakage.
|
| |
| double | energy_integral |
| | Sums the energy term.
|
| |
| double | dpdm_integral |
| | Sums second-order derivative variation value.
|
| |
| double | weightedcost_integral |
| | Sums the integral over weighted cost function.
|
| |
| double | weightedcost_width |
| | Width parameter for weighted cost function.
|
| |
| int | ntime |
| | Number of time steps.
|
| |
| double | total_time |
| | Final evolution time.
|
| |
| double | dt |
| | Time step size.
|
| |
| bool | writeTrajectoryDataFiles |
| | Flag to determine whether or not trajectory data will be written to files during forward simulation */.
|
| |
| Vec | redgrad |
| | Reduced gradient vector for optimization.
|
| |
| OptimTarget * | optim_target |
| | Pointer to optimization target specification.
|
| |
| Output * | output |
| | Pointer to output handler.
|
| |
| MasterEq * | mastereq |
| | Pointer to master equation solver.
|
| |
Base class for time integration schemes to evolve the quantum dynamics.
This abstract class provides the interface for time-stepping methods used to integrate the quantum evolution equations (Lindblad master equation or Schroedinger equation). It supports both forward and adjoint time integration, handles output of evolution data, and evaluates penalty integral terms.
Main functionality:
- solveODE propagates an initial state at time t0 to the final time T, while writing evolution data to files and adding to integral penalty terms, if needed.
- solveAdjointODE propagates a terminal (adjoint) condition through the time domain backwards in time from T to 0, while updating the reduced gradient along the way.
This class contains references to:
- MasterEq for evaluating and applying the right-hand-side system matrix of the real-valued, vectorized differential equation to a state vector at each time-step
- OptimTarget for evaluating integral penalty terms at each time step
- Output for writing evolution data to output files at each time step
| void TimeStepper::evolveBWD |
( |
const double |
tstart, |
|
|
const double |
tstop, |
|
|
const Vec |
x_stop, |
|
|
Vec |
x_adj, |
|
|
Vec |
grad, |
|
|
bool |
compute_gradient |
|
) |
| |
|
virtual |
Evolves adjoint state backward by one time-step and updates reduced gradient.
Abstract base-class implementation is empty. Derived classes that need backward time-stepping should implement this function.
- Parameters
-
| tstart | Start time (backward evolution) |
| tstop | Stop time (backward evolution) |
| x_stop | State at stop time |
| x_adj | Adjoint state vector |
| grad | Gradient vector to update |
| compute_gradient | Flag to compute gradient |
Reimplemented in ExplEuler, ImplMidpoint, CompositionalImplMidpoint, and PetscTS.