Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyuan committed Feb 11, 2024
1 parent 4db333b commit 9f06235
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,20 @@ julia> dict_sigma = Parquet.diagdict_parquet(Parquet.SigmaDiag, renormalization_
The Back End architecture enables the compiler to output source code in a range of other programming languages and machine learning frameworks. The example code below demonstrates how to use the `Compilers` to generate the source code for the self-energy diagrams in Julia, C, and Python.
```julia
julia> g_o211 = dict_sigma[(2,1,1)] # select the self-energy with 2nd-order Green's function counterterms and 1st-order interaction counterterms.
#Access the self-energy data for the configuration with 2nd-order Green's function counterterms and 1st-order interaction counterterms.
julia> g_o211 = dict_sigma[(2,1,1)]

# Compile the self-energy to Julia RuntimeGeneratedFunction `func` and the `leafmap`, which maps the indices in the vector of leaf values to the corresponding leafs (propagators and interactions).
# Compile the selected self-energy into a Julia RuntimeGeneratedFunction `func` and a `leafmap`.
# The `leafmap` associates vector indices of leaf values with their corresponding leaves (propagators and interactions).
julia> func, leafmap = Compilers.compile(g_o211);

# Generate the source code for the self-energy in Julia and save it to a file.
# Export the self-energy's source code to a Julia file.
julia> Compilers.compile_Julia(g_o211, "func_g211.jl");

# Generate the source code for the self-energy in C-language and save it to a file.
# Export the self-energy's source code to a C file.
julia> Compilers.compile_C(g_o211, "func_g211.c");

# Generate the source code for the self-energy in Python and JAX machine learning framework and save it to a file.
# Export the self-energy's source code to a Python file for use with the JAX machine learning framework.
julia> Compilers.compile_Python(g_o211, :jax, "func_g211.py");
```
Expand Down

0 comments on commit 9f06235

Please sign in to comment.