From f13eacbc8e5ab714dd3544adab8189c313382c77 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Wed, 22 Jul 2015 13:55:29 +0000 Subject: Support for non-commuting fields --- src/kondo.c | 150 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 73 insertions(+), 77 deletions(-) (limited to 'src/kondo.c') diff --git a/src/kondo.c b/src/kondo.c index 39d74bb..79b7c56 100644 --- a/src/kondo.c +++ b/src/kondo.c @@ -29,16 +29,17 @@ limitations under the License. #include "definitions.cpp" #include "rational.h" -// dimension of A, B and h (must be <10) +// dimension of A, B, h and t (must be <10) #define KONDO_DIM 3 // number of spin components #define KONDO_SPIN 2 -// offsets for indices of A, B and h +// offsets for indices of A, B, h and t // order matters for symbols table #define KONDO_A_OFFSET 1 #define KONDO_B_OFFSET 2 #define KONDO_H_OFFSET 3 +#define KONDO_T_OFFSET 4 // parsing modes (from parse_file.c) #define PP_NULL_MODE 0 @@ -193,13 +194,19 @@ int kondo_fields_table(int box_count, Char_Array* str_fields, Fields_Table* fiel // parameters char_array_append_str("h:",str_fields); + // h for(i=0;i0){ for(i=0;i=0){ @@ -1001,8 +977,8 @@ int kondo_resolve_ABh(char* str, Polynomial* output, Fields_Table fields){ } } - // h's - if(offset==KONDO_H_OFFSET){ + // h's and t's + if(offset==KONDO_H_OFFSET || offset==KONDO_T_OFFSET){ // external field init_Int_Array(&monomial,1); init_Int_Array(&factor,1); @@ -1062,7 +1038,7 @@ int kondo_resolve_ABh(char* str, Polynomial* output, Fields_Table fields){ // read a Kondo scalar product (generalized to vector products as well) int kondo_resolve_scalar_prod(char* str, Polynomial* output, Fields_Table fields){ char* ptr; - // offset of each term (A,B or H) + // offset of each term (A,B,H or T) int offset=-1; // index of each term (0,...,box_count) int index=0; @@ -1091,6 +1067,9 @@ int kondo_resolve_scalar_prod(char* str, Polynomial* output, Fields_Table fields case 'h': offset=KONDO_H_OFFSET; break; + case 't': + offset=KONDO_T_OFFSET; + break; // scalar product case '.': @@ -1195,8 +1174,8 @@ int kondo_polynomial_vector(int offset, int index, Polynomial (*polys)[3], Field init_Polynomial((*polys)+i,POLY_SIZE); } - // h's - if(offset==KONDO_H_OFFSET){ + // h's and t's + if(offset==KONDO_H_OFFSET || offset==KONDO_T_OFFSET){ // construct every component field for(i=0;i=0){ @@ -1443,8 +1439,8 @@ int get_symbol_index(char* str){ if(offset==-1){ return(-1); } - // no symbol for h - if(offset==KONDO_H_OFFSET){ + // no symbol for h or t + if(offset==KONDO_H_OFFSET || offset==KONDO_T_OFFSET){ return(10*(10*offset+dim)); } else{ -- cgit v1.2.3-70-g09d2