From 3f0510629e422e979b57d3f93791937912a4183a Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Tue, 14 Jun 2022 09:26:07 +0200 Subject: Update to v1.5. The update to version 1.5 is rather substantial, and introduces some minor backward-incompatibilities: * The header "#!symbols" has been replaced by "#!virtual_fields" * Multiplying polynomials using the '*' symbol is no longer supported (or, rather, the symbolic capabilities of meankondo were enhanced, and the syntax has been changed). * 'meantools exp' has been removed (its functionality is now handled by other means) * 'meantoolds derive' has been replaced by 'meantools differentiate' * The symbolic capabilities were enhanced: polynomials can now be multiplied, added, exponentiated, and their logarithms can be taken directly in the configuration file. * The flow equation can now be processed after being computed using the various "#!postprocess_*" entries. * Deprecated kondo_preprocess. * Compute the mean using an LU decomposition if possible. * More detailed checks for syntax errors in configuration file. * Check that different '#!group' entries are indeed uncorrelated. * New flags in meankondo: '-p' and '-A'. * New tool: meantools expand. * Improve conversion to LaTeX using meantools-convert * Assign terms randomly to different threads. * Created vim files to implement syntax highlighting for configuration files. * Multiple bug fixes --- src/kondo.c | 69 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'src/kondo.c') diff --git a/src/kondo.c b/src/kondo.c index 79b7c56..93318d5 100644 --- a/src/kondo.c +++ b/src/kondo.c @@ -1,5 +1,5 @@ /* -Copyright 2015 Ian Jauslin +Copyright 2015-2022 Ian Jauslin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ limitations under the License. #define KONDO_SPIN 2 // offsets for indices of A, B, h and t -// order matters for symbols table +// order matters for virtual_fields table #define KONDO_A_OFFSET 1 #define KONDO_B_OFFSET 2 #define KONDO_H_OFFSET 3 @@ -72,6 +72,7 @@ limitations under the License. int kondo_generate_conf(Str_Array* str_args, int box_count){ Str_Array new_args; Fields_Table fields; + Variables variables; Char_Array tmp_str; int arg_index; int i; @@ -83,16 +84,19 @@ int kondo_generate_conf(Str_Array* str_args, int box_count){ kondo_fields_table(box_count, &tmp_str, &fields); str_array_append_noinit(tmp_str, &new_args); - // symbols - kondo_symbols(&tmp_str, box_count, &fields); - arg_index=find_str_arg("symbols", *str_args); + // dummy variables + init_Variables(&variables,1); + + // virtual fields + kondo_virtual_fields(&tmp_str, box_count, &fields); + arg_index=find_str_arg("virtual_fields", *str_args); if(arg_index>=0){ if(tmp_str.length>0){ char_array_snprintf(&tmp_str,",\n"); } char_array_concat((*str_args).strs[arg_index], &tmp_str); } - parse_input_symbols(tmp_str, &fields); + parse_input_virtual_fields(tmp_str, &fields, variables); str_array_append_noinit(tmp_str, &new_args); // identities @@ -104,7 +108,7 @@ int kondo_generate_conf(Str_Array* str_args, int box_count){ } char_array_concat((*str_args).strs[arg_index], &tmp_str); } - parse_input_identities(tmp_str, &fields); + parse_input_identities(tmp_str, &fields, variables); str_array_append_noinit(tmp_str, &new_args); // groups @@ -136,7 +140,7 @@ int kondo_generate_conf(Str_Array* str_args, int box_count){ // copy remaining entries for(i=0;i<(*str_args).length;i++){ get_str_arg_title((*str_args).strs[i], &title); - if(str_cmp(title.str, "symbols")==0 &&\ + if(str_cmp(title.str, "virtual_fields")==0 &&\ str_cmp(title.str, "identities")==0 &&\ str_cmp(title.str, "propagator")==0 &&\ str_cmp(title.str, "input_polynomial")==0 &&\ @@ -149,6 +153,7 @@ int kondo_generate_conf(Str_Array* str_args, int box_count){ } free_Fields_Table(fields); + free_Variables(variables); free_Str_Array(*str_args); *str_args=new_args; @@ -250,15 +255,15 @@ int kondo_fields_table(int box_count, Char_Array* str_fields, Fields_Table* fiel } -// generate Kondo symbols -int kondo_symbols(Char_Array* str_symbols, int box_count, Fields_Table* fields){ +// generate Kondo virtual_fields +int kondo_virtual_fields(Char_Array* str_virtual_fields, int box_count, Fields_Table* fields){ int i,j,k,l; Char_Array tmp_str; Polynomial poly; char letters[3]={'A','B','h'}; - init_Char_Array(str_symbols, STR_SIZE); - char_array_snprintf(str_symbols, "#!symbols\n"); + init_Char_Array(str_virtual_fields, STR_SIZE); + char_array_snprintf(str_virtual_fields, "#!virtual_fields\n"); // loop over box index for(i=1;i<=box_count;i++){ @@ -267,7 +272,7 @@ int kondo_symbols(Char_Array* str_symbols, int box_count, Fields_Table* fields){ // loop over space dimension for(k=0;k0){ for(i=0;i