File: trivial.cc

package info (click to toggle)
cadabra2 2.4.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,796 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (18 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "cadabra2++.hh"
#include <iostream>

using namespace cadabra;
using namespace cadabra::cpplib;

int main() {
   Kernel k(true);
   inject_property<AntiCommuting>(k, "{A,B}");
   auto ex = "A B - B A"_ex(k);
   sort_product sp(k, *ex);
   sp.apply_generic();

	collect_terms ct(k, *ex);
	ct.apply_generic();
	
   std::cout << pprint(k, ex) << std::endl;
}