make_orbit_bfuncs#

casm.bset.clexwriter.make_orbit_bfuncs(
prim_neighbor_list: PrimNeighborList,
clusters: list[list[Cluster]],
functions: list[list[list[PolynomialFunction]]],
occ_site_functions: list[dict],
cpp_fmt: CppFormatProperties,
linear_function_indices: set[int] | None = None,
) tuple[list[dict], dict[str, list[list[int]]]][source]#

Convert clusters and functions to data used by Jinja templates to write the orbit basis function evaluating methods (i.e. the contributions to the global correlations from one unit cell).

Parameters:
  • prim_neighbor_list (PrimNeighborList) – PrimNeighborList, containing all the neighbors needed for evaluation, as generated by ClusterFunctionBuilder.

  • clusters (list[list[Cluster]]) – List of clusters, as generated by ClusterFunctionBuilder. Site order must be consistent with functions.

  • functions (list[list[list[PolynomialFunction]]]) – List of functions, as generated by ClusterFunctionBuilder.

  • occ_site_functions (list[dict]) –

    List of occupation site basis functions. For each sublattice with discrete site basis functions, must include:

    • ”sublattice_index”: int, index of the sublattice

    • ”value”: list[list[float]], list of the site basis function values, as value = functions[function_index][occupant_index].

  • cpp_fmt (CppFormatProperties) – C++ string formatting properties. If None, the default values are used.

  • linear_function_indices (Optional[set[int]]) – The linear indices of the functions that will be included. If None, all functions will be included in the Clexulator. Otherwise, only the specified functions will be included in the Clexulator

Returns:

  • orbit_bfuncs (list[dict]) – Data for each orbit basis function (i.e. the contribution to the global correlations from one unit cell). Includes:

    • "linear_function_index": int, Linear function index

    • "linear_orbit_index": int, Linear cluster orbit index

    • "cpp": str, C++ expression for evaluating the global correlation contribution

    • "latex_prototype": str, Latex formula for the prototype

    • latex_orbit": str, Latex formula for the orbit contribution

  • variables_needed (dict[str,list[list[int]]]) – The variables needed to evaluate the orbit basis functions. The dictionary keys are DoF type key, and values are lists of [component_index, neighbor_list_index, sublattice_index] for variables of that type. The neighbor_list_index and sublattice_index for global continuous DoF are None.