Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
symmetrization.h
Go to the documentation of this file.
1 #ifndef __INT_SYMMETRIZATION_H__
2 #define __INT_SYMMETRIZATION_H__
3 
4 #include <assert.h>
5 #include "../tensor/untyped_tensor.h"
6 #include "../summation/summation.h"
7 #include "../contraction/contraction.h"
8 
9 namespace CTF_int {
16  void desymmetrize(tensor * sym_tsr,
17  tensor * nonsym_tsr,
18  bool is_C);
19 
25  void symmetrize(tensor * sym_tsr,
26  tensor * nonsym_tsr);
27 
37  void cmp_sym_perms(int ndim,
38  int const * sym,
39  int * nperm,
40  int ** perm,
41  double * sign);
42 
57  void order_perm(tensor const * A,
58  tensor const * B,
59  int * idx_arr,
60  int off_A,
61  int off_B,
62  int * idx_A,
63  int * idx_B,
64  int & add_sign,
65  int & mod);
66 
84  void order_perm(tensor const * A,
85  tensor const * B,
86  tensor const * C,
87  int * idx_arr,
88  int off_A,
89  int off_B,
90  int off_C,
91  int * idx_A,
92  int * idx_B,
93  int * idx_C,
94  int & add_sign,
95  int & mod);
96 
97 
107  void add_sym_perm(std::vector<summation>& perms,
108  std::vector<int>& signs,
109  summation const & new_perm,
110  int new_sign);
111 
121  void add_sym_perm(std::vector<contraction>& perms,
122  std::vector<int>& signs,
123  contraction const & new_perm,
124  int new_sign);
125 
126 
127 
128 
137  void get_sym_perms(summation const & sum,
138  std::vector<summation>& perms,
139  std::vector<int>& signs);
140 
149  void get_sym_perms(contraction const & ctr,
150  std::vector<contraction>& perms,
151  std::vector<int>& signs);
152 
153 
154 
155 }
156 #endif
def sum(tensor, init_A, axis=None, dtype=None, out=None, keepdims=None)
Definition: core.pyx:4261
void get_sym_perms(summation const &sum, std::vector< summation > &perms, std::vector< int > &signs)
finds all permutations of a summation that must be done for a broken symmetry
double sign(int par)
void order_perm(tensor const *A, tensor const *B, int *idx_arr, int off_A, int off_B, int *idx_A, int *idx_B, int &add_sign, int &mod)
orders the summation indices of one tensor that don&#39;t break summation symmetries
void desymmetrize(tensor *sym_tsr, tensor *nonsym_tsr, bool is_C)
unfolds the data of a tensor
void add_sym_perm(std::vector< summation > &perms, std::vector< int > &signs, summation const &new_perm, int new_sign)
puts a summation map into a nice ordering according to preserved symmetries, and adds it if it is dis...
void cmp_sym_perms(int ndim, int const *sym, int *nperm, int **perm, double *sign)
finds all permutations of a tensor according to a symmetry
void symmetrize(tensor *sym_tsr, tensor *nonsym_tsr)
folds the data of a tensor