Cadabra
Computer algebra system for field theory problems
SympyCdb.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Props.hh"
5 #include "Storage.hh"
6 #include "Kernel.hh"
7 #include "Stopwatch.hh"
8 #include "DisplaySympy.hh"
9 
10 #ifndef NO_SYMPY
11 #include <pybind11/pybind11.h>
12 #endif
13 
14 namespace sympy {
15 
16 #ifndef NO_SYMPY
17 
20  public:
21  SympyBridge(const cadabra::Kernel&, std::shared_ptr<cadabra::Ex>);
22  virtual ~SympyBridge();
23 
24  pybind11::object export_ex();
25  void import_ex(const std::string&);
26 
27  private:
28  std::shared_ptr<cadabra::Ex> ex;
29  };
30 #endif
31 
37 
38  // cadabra::Ex* map_sympy(const cadabra::Kernel&, cadabra::Ex&,
39  // const std::vector<std::string>& wrap, const std::string& args, const std::string& method);
40 
47 
48  cadabra::Ex::iterator apply(const cadabra::Kernel&, cadabra::Ex&, cadabra::Ex::iterator&,
49  const std::vector<std::string>& wrap, std::vector<std::string> args, const std::string& method);
50 
51  // /// \ingroup scalar
52  // ///
53  // /// Low-level function to feed a string to Python and read the result back in
54  // /// as a Cadabra Ex. As compared to 'apply' above, this starts from a string rather
55  // /// than an Ex, and hence gives more flexibility in constructing input.
56  //
57  // Ex python(Kernel&, Ex&, Ex::iterator&, const std::string& head, const std::string& args);
58 
59 
65 
66  void invert_matrix(const cadabra::Kernel&, cadabra::Ex& ex, cadabra::Ex& rules, const cadabra::Ex& tocompute);
67 
72 
73  void determinant(const cadabra::Kernel&, cadabra::Ex& ex, cadabra::Ex& rules, const cadabra::Ex& tocompute);
74  void trace(const cadabra::Kernel&, cadabra::Ex& ex, cadabra::Ex& rules, const cadabra::Ex& tocompute);
75 
77  // extern Stopwatch sympy_stopwatch;
78 
79 };
sympy::determinant
void determinant(const cadabra::Kernel &, cadabra::Ex &ex, cadabra::Ex &rules, const cadabra::Ex &tocompute)
Definition: SympyDummy.cc:62
Storage.hh
sympy::SympyBridge::SympyBridge
SympyBridge(const cadabra::Kernel &, std::shared_ptr< cadabra::Ex >)
Definition: SympyCdb.cc:19
cadabra::Kernel
Definition: Kernel.hh:14
sympy::apply
cadabra::Ex::iterator apply(const cadabra::Kernel &, cadabra::Ex &, cadabra::Ex::iterator &, const std::vector< std::string > &wrap, std::vector< std::string > args, const std::string &method)
Definition: SympyDummy.cc:12
sympy::invert_matrix
void invert_matrix(const cadabra::Kernel &, cadabra::Ex &ex, cadabra::Ex &rules, const cadabra::Ex &tocompute)
Definition: SympyDummy.cc:56
sympy::SympyBridge
Helper class to enable conversion from/to sympy.
Definition: SympyCdb.hh:19
sympy::SympyBridge::import_ex
void import_ex(const std::string &)
Definition: SympyCdb.cc:42
sympy
Definition: SympyCdb.hh:14
DisplaySympy.hh
sympy::trace
void trace(const cadabra::Kernel &, cadabra::Ex &ex, cadabra::Ex &rules, const cadabra::Ex &tocompute)
Definition: SympyDummy.cc:67
Stopwatch.hh
cadabra::Ex
Definition: Storage.hh:140
sympy::SympyBridge::ex
std::shared_ptr< cadabra::Ex > ex
Definition: SympyCdb.hh:28
sympy::fill_matrix
cadabra::Ex fill_matrix(const cadabra::Kernel &, cadabra::Ex &ex, cadabra::Ex &rules)
Definition: SympyCdb.cc:146
Props.hh
sympy::SympyBridge::~SympyBridge
virtual ~SympyBridge()
Definition: SympyCdb.cc:24
Kernel.hh
cadabra::DisplaySympy
Definition: DisplaySympy.hh:21
sympy::SympyBridge::export_ex
pybind11::object export_ex()
Definition: SympyCdb.cc:28