I'm new here, so i hope to ask my question in a proper way! :)
I'm trying to implement a solver for the dissipativ lindblad equation with odeint in C++ using the Eigen libary for handling matrices.
With constant steps size everything works fine, but when I try to add an error estimation, the compiler vomits 50 errors. I suggest I have an error in the typedefs, but I have no idea where.
Here ist the call of the solver:
typedef runge_kutta4<state_type, double, state_type, double,vector_space_algebra > stepper;
typedef runge_kutta_cash_karp54< state_type > error_stepper_type;
typedef controlled_runge_kutta< error_stepper_type > controlled_stepper_type;
controlled_stepper_type controlled_stepper;
integrate_adaptive( controlled_stepper , bath , rho_init , 0.0 , 10.0 , 0.01 );
Here ist the call of the class for the ODE:
void qsys::operator() ( state_type &rho ,
state_type &drhodt , const double t )
{
state_type sum;
sum.resize(rho.rows(),rho.cols());
sum.setZero();
super_op(lindblads,rho,sum);
drhodt=-(H*rho-rho*H) + sum;
}
void qsys::super_op(const std::vector<lindblad_op*> lindblads,const state_type &rho, state_type &erg)
{
state_type a;
state_type b;
a.resize(rho.rows(),rho.cols());
b.resize(rho.rows(),rho.cols());
b.setZero();
erg.setZero();
for (unsigned int i=0;i<lindblads.size();i++){
a.setZero();
a= (lindblads[i]->m) * rho * (lindblads[i]->m.adjoint()) -
0.5 * ((lindblads[i]->m.adjoint()) * (lindblads[i]->m) * rho + rho * (lindblads[i]->m.adjoint() * lindblads[i]->m));
b=erg+a;
erg=b;
}
}
And state_type is Eigen::MatrixXd Is this helpful for you? I looked at the error messages, they are 26 pages long, so I wasnt able to post ist here, is there any opportunity to get it online?
I've downloaded boost 1.61 now, but it still doesnt work, my includes:
#ifndef qsys_HPP
#define qsys_HPP
#include <Eigen/Core>
#include <vector>
#include <iostream>
#include <vector>
#include <iostream>
//#include "boost/boost/numeric/odeint/external/eigen/eigen.hpp"
#include "boost/boost/numeric/odeint/algebra/vector_space_algebra.hpp"
#include "boost/boost/numeric/odeint.hpp"
#include "boost/boost/program_options.hpp"
#include <fstream>
#include "lindblad_op.hpp"
With "boost/boost/numeric/odeint/external/eigen/eigen.hpp" I now get following error messages:
||=== Build: Debug in ProgPrak (compiler: GNU GCC Compiler) ===|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra.hpp|98|error: ‘vector_space_norm_inf’ is not a class template|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|28|error: ‘algebra_dispatcher_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|error: ‘enable_if’ in namespace ‘boost’ does not name a type|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|error: expected template-argument before ‘<’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|error: expected ‘>’ before ‘<’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|37|error: ‘enable_if’ in namespace ‘boost’ does not name a type|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|37|error: expected template-argument before ‘<’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|37|error: expected ‘>’ before ‘<’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|37|error: wrong number of template arguments (2, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|error: provided for ‘template<class Derived> struct boost::numeric::odeint::algebra_dispatcher_sfinae’|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|38|error: expected ‘::’ before ‘{’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|38|error: expected identifier before ‘{’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|38|error: qualified name does not name a class before ‘{’ token|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|38|error: ‘is_resizeable_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|48|error: wrong number of template arguments (2, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|39|error: provided for ‘template<class Derived> struct boost::numeric::odeint::is_resizeable_sfinae’|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|57|error: ‘same_size_impl_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|69|error: wrong number of template arguments (3, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|58|error: provided for ‘template<class Derived> struct boost::numeric::odeint::same_size_impl_sfinae’|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|81|error: ‘resize_impl_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|92|error: wrong number of template arguments (3, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|82|error: provided for ‘template<class Derived> struct boost::numeric::odeint::resize_impl_sfinae’|
/usr/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp|40|error: redeclared with 2 template parameters|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|note: previous declaration ‘template<class Derived> struct boost::numeric::odeint::algebra_dispatcher_sfinae’ used 1 template parameter|
/usr/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp|58|error: wrong number of template arguments (2, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp|29|error: provided for ‘template<class Derived> struct boost::numeric::odeint::algebra_dispatcher_sfinae’|
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|70|error: wrong number of template arguments (2, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|39|error: provided for ‘template<class Derived> struct boost::numeric::odeint::is_resizeable_sfinae’|
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|88|error: wrong number of template arguments (3, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|58|error: provided for ‘template<class Derived> struct boost::numeric::odeint::same_size_impl_sfinae’|
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|110|error: wrong number of template arguments (3, should be 1)|
/usr/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp|82|error: provided for ‘template<class Derived> struct boost::numeric::odeint::resize_impl_sfinae’|
If I only include "boost/boost/numeric/odeint/algebra/vector_space_algebra.hpp" I get the following messages:
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|70|error: ‘is_resizeable_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|81|error: ‘same_size_impl_sfinae’ is not a class template|
/usr/include/boost/numeric/odeint/util/multi_array_adaption.hpp|103|error: ‘resize_impl_sfinae’ is not a class template|
Thanks for your help!