|
Quandary
|
#include "mastereq.hpp"
Functions | |
| int | applyRHS_sparsemat (Mat RHS, Vec x, Vec y) |
| Sparse matrix MatMult. | |
| int | applyRHS_sparsemat_transpose (Mat RHS, Vec x, Vec y) |
| Transpose sparse matrix MatMult. | |
| void | compute_dRHS_dParams_sparsemat (const double t, const Vec x, const Vec xbar, const double alpha, Vec grad, std::vector< size_t > &nlevels, IS isu, IS isv, std::vector< Mat > &Ac_vec, std::vector< Mat > &Bc_vec, Vec aux, Oscillator **oscil_vec) |
| : Sparse-matrix version to compute gradient of RHS with respect to parameters | |
| void | compute_dRHS_dParams_matfree (const PetscInt dim, const double t, const Vec x, const Vec xbar, const double alpha, Vec grad, std::vector< size_t > &nlevels, DecoherenceType decoherence_type, Oscillator **oscil_vec) |
| : Matrix free version to compute gradient of RHS with respect to parameters | |
| template<int n0> | |
| int | applyRHS_matfree (Mat RHS, Vec x, Vec y) |
| template<int n0> | |
| int | applyRHS_matfree_transpose (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1> | |
| int | applyRHS_matfree (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1> | |
| int | applyRHS_matfree_transpose (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2> | |
| int | applyRHS_matfree (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2> | |
| int | applyRHS_matfree_transpose (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2, int n3> | |
| int | applyRHS_matfree (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2, int n3> | |
| int | applyRHS_matfree_transpose (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2, int n3, int n4> | |
| int | applyRHS_matfree (Mat RHS, Vec x, Vec y) |
| template<int n0, int n1, int n2, int n3, int n4> | |
| int | applyRHS_matfree_transpose (Mat RHS, Vec x, Vec y) |
| int | applyRHS_matfree_1Osc (Mat RHS, Vec x, Vec y) |
| Matrix-vector products to apply the RHS system matrix to a state vector. | |
| int | applyRHS_matfree_transpose_1Osc (Mat RHS, Vec x, Vec y) |
| Transpose matrix-free MatMult for 1 oscillator. | |
| int | applyRHS_matfree_2Osc (Mat RHS, Vec x, Vec y) |
| Matrix-free MatMult for 2 oscillators. | |
| int | applyRHS_matfree_transpose_2Osc (Mat RHS, Vec x, Vec y) |
| Transpose matrix-free MatMult for 2 oscillators. | |
| int | applyRHS_matfree_3Osc (Mat RHS, Vec x, Vec y) |
| Matrix-free MatMult for 3 oscillators. | |
| int | applyRHS_matfree_transpose_3Osc (Mat RHS, Vec x, Vec y) |
| Transpose matrix-free MatMult for 3 oscillators. | |
| int | applyRHS_matfree_4Osc (Mat RHS, Vec x, Vec y) |
| Matrix-free MatMult for 4 oscillators. | |
| int | applyRHS_matfree_transpose_4Osc (Mat RHS, Vec x, Vec y) |
| Transpose matrix-free MatMult for 4 oscillators. | |
| int | applyRHS_matfree_5Osc (Mat RHS, Vec x, Vec y) |
| Matrix-free MatMult for 5 oscillators. | |
| int | applyRHS_matfree_transpose_5Osc (Mat RHS, Vec x, Vec y) |
| Transpose matrix-free MatMult for 5 oscillators. | |
| int applyRHS_matfree | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_1Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Matrix-vector products to apply the RHS system matrix to a state vector.
Each function returns y = RHS*x. Matrix-free versions as well as sparse-matrix versions are implemented. Those functions will be passed to PETSc's MatMult operations to realize a Matrix-Vector Multiplication of the RHS with a state vector, such that one can call PETSc's MatMult(RHS, x, y) for the RHS. Note: The RHS matrix must be assembled before usage, see MasterEq::assemble_RHS. Matrix-free MatMult for 1 oscillator
| int applyRHS_matfree_2Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Matrix-free MatMult for 2 oscillators.
| int applyRHS_matfree_3Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Matrix-free MatMult for 3 oscillators.
| int applyRHS_matfree_4Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Matrix-free MatMult for 4 oscillators.
| int applyRHS_matfree_5Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Matrix-free MatMult for 5 oscillators.
| int applyRHS_matfree_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
| int applyRHS_matfree_transpose_1Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose matrix-free MatMult for 1 oscillator.
| int applyRHS_matfree_transpose_2Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose matrix-free MatMult for 2 oscillators.
| int applyRHS_matfree_transpose_3Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose matrix-free MatMult for 3 oscillators.
| int applyRHS_matfree_transpose_4Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose matrix-free MatMult for 4 oscillators.
| int applyRHS_matfree_transpose_5Osc | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose matrix-free MatMult for 5 oscillators.
| int applyRHS_sparsemat | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Sparse matrix MatMult.
| int applyRHS_sparsemat_transpose | ( | Mat | RHS, |
| Vec | x, | ||
| Vec | y | ||
| ) |
Transpose sparse matrix MatMult.
| void compute_dRHS_dParams_matfree | ( | const PetscInt | dim, |
| const double | t, | ||
| const Vec | x, | ||
| const Vec | x_bar, | ||
| const double | alpha, | ||
| Vec | grad, | ||
| std::vector< size_t > & | nlevels, | ||
| DecoherenceType | decoherence_type, | ||
| Oscillator ** | oscil_vec | ||
| ) |
: Matrix free version to compute gradient of RHS with respect to parameters
Updates grad += alpha * x^T * (d RHS / d params)^T * x_bar in a matrix-free manner. See compute_dRHS_dParams_sparsemat for the sparse-matrix version of this routine.
| [in] | dim | Dimension of full vectorized system: N^2 if Lindblad, N if Schroedinger |
| [in] | t | Current time |
| [in] | x | State vector |
| [in] | x_bar | Adjoint state vector |
| [in] | alpha | Scaling factor |
| [out] | grad | Gradient vector to update |
| [in] | nlevels | Number of energy levels per subsystem |
| [in] | decoherence_type | Type of Lindblad decoherence operators, or NONE |
| [in] | oscil_vec | Vector of quantum oscillators |
| void compute_dRHS_dParams_sparsemat | ( | const double | t, |
| const Vec | x, | ||
| const Vec | x_bar, | ||
| const double | alpha, | ||
| Vec | grad, | ||
| std::vector< size_t > & | nlevels, | ||
| IS | isu, | ||
| IS | isv, | ||
| std::vector< Mat > & | Ac_vec, | ||
| std::vector< Mat > & | Bc_vec, | ||
| Vec | aux, | ||
| Oscillator ** | oscil_vec | ||
| ) |
: Sparse-matrix version to compute gradient of RHS with respect to parameters
Updates grad += alpha * x^T * (d RHS / d params)^T * x_bar with sparse-matrix version of RHS. Compare compute_dRHS_dParams_matfree for the matrix-free version of this routine.
| [in] | t | Current time |
| [in] | x | State vector |
| [in] | x_bar | Adjoint state vector |
| [in] | alpha | Scaling factor |
| [out] | grad | Gradient vector to update |
| [in] | nlevels | Number of energy levels per subsystem |
| [in] | isu | Index stride to access real parts of a state vector |
| [in] | isv | Index stride to access imaginar parts of a state vector |
| [in] | Ac_vec | Vector of real parts of control matrices per oscillator |
| [in] | Bc_vec | Vector of imaginary parts of control matrices per oscillator |
| [in] | aux | Auxiliary vector for computations |
| [in] | oscil_vec | Vector of quantum oscilators |