Ian Jauslin
summaryrefslogtreecommitdiff
blob: b6f05c29eead87a869439ead2fb423e7afacc75d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Copyright 2015 Ian Jauslin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/* declaring fields */

#ifndef FIELDS_H
#define FIELDS_H

#include "types.h"

// init
int init_Fields_Table(Fields_Table* fields);
int free_Fields_Table(Fields_Table fields);

// determine field type
int field_type(int index, Fields_Table fields);
// check whether a field anticommutes
int is_fermion(int index, Fields_Table fields);
// check whether a field is non-commuting
int is_noncommuting(int index, Fields_Table fields);


// init
int init_Identities(Identities* identities,int size);
int free_Identities(Identities identities);

// resize
int resize_identities(Identities* identities,int new_size);

// copy
int identities_cpy(Identities input, Identities* output);
int identities_cpy_noinit(Identities input, Identities* output);

// append an element to a identities
int identities_append(Int_Array lhs, Polynomial rhs, Identities* output);
int identities_append_noinit(Int_Array lhs, Polynomial rhs, Identities* output);

// concatenate two identitiess
int identities_concat(Identities input, Identities* output);

// resolve the identities
int resolve_ids(Polynomial* polynomial, Fields_Table fields);
// check whether an array is a sub-array of another, support for noncommuting elements
int int_array_is_subarray_noncommuting(Int_Array input, Int_Array test_array, Fields_Table fields);


// init
int init_Symbols(Symbols* symbols,int size);
int free_Symbols(Symbols symbols);

// resize
int resize_symbols(Symbols* symbols,int new_size);

// copy
int symbols_cpy(Symbols input, Symbols* output);
int symbols_cpy_noinit(Symbols input, Symbols* output);

// append an element to a symbols
int symbols_append(int index, Polynomial expr, Symbols* output);
int symbols_append_noinit(int index, Polynomial expr, Symbols* output);

// concatenate two symbolss
int symbols_concat(Symbols input, Symbols* output);


// init
int init_Groups(Groups* groups,int size);
int free_Groups(Groups groups);

// resize
int resize_groups(Groups* groups,int new_size);

// copy
int groups_cpy(Groups input, Groups* output);
int groups_cpy_noinit(Groups input, Groups* output);

// append an element to a groups
int groups_append(Int_Array indices, Groups* output);
int groups_append_noinit(Int_Array indices, Groups* output);

// concatenate two groupss
int groups_concat(Groups input, Groups* output);

// find which group an index belongs to
int find_group(int index, Groups groups);


#define FIELDS_H_DONE
#endif